Skip to content
This repository was archived by the owner on May 9, 2022. It is now read-only.

Commit cce761b

Browse files
committed
feat(rtc_types::enclave_messages::set_access_key): add enclave ID to EncryptedRequest as AAD
1 parent a126303 commit cce761b

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

codegen/auth_enclave/bindings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
*/
1313
#define DATA_UPLOAD_RESPONSE_LEN (16 + (24 + 16))
1414

15+
#define ARCHIVED_ENCLAVE_ID_SIZE 8
16+
1517
#define SET_ACCESS_KEY_REQUEST_SIZE 40
1618

1719
#define SET_ACCESS_KEY_RESPONSE_SIZE 1

codegen/data_enclave/bindings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
*/
1313
#define DATA_UPLOAD_RESPONSE_LEN (16 + (24 + 16))
1414

15+
#define ARCHIVED_ENCLAVE_ID_SIZE 8
16+
1517
#define SET_ACCESS_KEY_REQUEST_SIZE 40
1618

1719
#define SET_ACCESS_KEY_RESPONSE_SIZE 1

codegen/exec_enclave/bindings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
*/
1313
#define DATA_UPLOAD_RESPONSE_LEN (16 + (24 + 16))
1414

15+
#define ARCHIVED_ENCLAVE_ID_SIZE 8
16+
1517
#define SET_ACCESS_KEY_REQUEST_SIZE 40
1618

1719
#define SET_ACCESS_KEY_RESPONSE_SIZE 1

rtc_types/src/enclave_messages/ffi_set_access_key.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ use sgx_types::sgx_aes_gcm_128bit_tag_t;
1313

1414
use super::{set_access_key, RecommendedAesGcmIv};
1515

16+
// See enclave_messages::ARCHIVED_ENCLAVE_ID_SIZE
17+
pub const ARCHIVED_ENCLAVE_ID_SIZE: usize = 8;
18+
1619
// Begin FFI types
1720
// (Keep these FFI type comments in sync between set_access_key and ffi_set_access_key, for diffing!)
1821

@@ -24,7 +27,7 @@ pub const SET_ACCESS_KEY_REQUEST_SIZE: usize = 40;
2427
pub struct SetAccessKeyEncryptedRequest {
2528
pub tag: sgx_aes_gcm_128bit_tag_t,
2629
pub ciphertext: [u8; SET_ACCESS_KEY_REQUEST_SIZE],
27-
pub aad: [u8; 0],
30+
pub aad: [u8; ARCHIVED_ENCLAVE_ID_SIZE],
2831
pub nonce: RecommendedAesGcmIv,
2932
}
3033

rtc_types/src/enclave_messages/set_access_key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub struct Response {
2424
pub const REQUEST_SIZE: usize = mem::size_of::<ArchivedRequest>();
2525

2626
// FFI type: EncryptedRequest
27-
pub type EncryptedRequest = EncryptedEnclaveMessage<REQUEST_SIZE, 0>;
27+
pub type EncryptedRequest = EncryptedEnclaveMessage<REQUEST_SIZE, ARCHIVED_ENCLAVE_ID_SIZE>;
2828

2929
// FFI type: RESPONSE_SIZE
3030
pub const RESPONSE_SIZE: usize = mem::size_of::<ArchivedResponse>();

0 commit comments

Comments
 (0)