diff --git a/codegen/auth_enclave/bindings.h b/codegen/auth_enclave/bindings.h index eba213e9..9820e422 100644 --- a/codegen/auth_enclave/bindings.h +++ b/codegen/auth_enclave/bindings.h @@ -12,6 +12,8 @@ */ #define DATA_UPLOAD_RESPONSE_LEN (16 + (24 + 16)) +#define ARCHIVED_ENCLAVE_ID_SIZE 8 + #define SET_ACCESS_KEY_REQUEST_SIZE 40 #define SET_ACCESS_KEY_RESPONSE_SIZE 1 diff --git a/codegen/data_enclave/bindings.h b/codegen/data_enclave/bindings.h index e0c026ed..63570f99 100644 --- a/codegen/data_enclave/bindings.h +++ b/codegen/data_enclave/bindings.h @@ -12,6 +12,8 @@ */ #define DATA_UPLOAD_RESPONSE_LEN (16 + (24 + 16)) +#define ARCHIVED_ENCLAVE_ID_SIZE 8 + #define SET_ACCESS_KEY_REQUEST_SIZE 40 #define SET_ACCESS_KEY_RESPONSE_SIZE 1 diff --git a/codegen/exec_enclave/bindings.h b/codegen/exec_enclave/bindings.h index eba213e9..9820e422 100644 --- a/codegen/exec_enclave/bindings.h +++ b/codegen/exec_enclave/bindings.h @@ -12,6 +12,8 @@ */ #define DATA_UPLOAD_RESPONSE_LEN (16 + (24 + 16)) +#define ARCHIVED_ENCLAVE_ID_SIZE 8 + #define SET_ACCESS_KEY_REQUEST_SIZE 40 #define SET_ACCESS_KEY_RESPONSE_SIZE 1 diff --git a/rtc_types/src/enclave_messages/ffi_set_access_key.rs b/rtc_types/src/enclave_messages/ffi_set_access_key.rs index 2c7b27b2..aed70674 100644 --- a/rtc_types/src/enclave_messages/ffi_set_access_key.rs +++ b/rtc_types/src/enclave_messages/ffi_set_access_key.rs @@ -13,6 +13,9 @@ use sgx_types::sgx_aes_gcm_128bit_tag_t; use super::{set_access_key, RecommendedAesGcmIv}; +// See enclave_messages::ARCHIVED_ENCLAVE_ID_SIZE +pub const ARCHIVED_ENCLAVE_ID_SIZE: usize = 8; + // Begin FFI types // (Keep these FFI type comments in sync between set_access_key and ffi_set_access_key, for diffing!) @@ -24,7 +27,7 @@ pub const SET_ACCESS_KEY_REQUEST_SIZE: usize = 40; pub struct SetAccessKeyEncryptedRequest { pub tag: sgx_aes_gcm_128bit_tag_t, pub ciphertext: [u8; SET_ACCESS_KEY_REQUEST_SIZE], - pub aad: [u8; 0], + pub aad: [u8; ARCHIVED_ENCLAVE_ID_SIZE], pub nonce: RecommendedAesGcmIv, } diff --git a/rtc_types/src/enclave_messages/set_access_key.rs b/rtc_types/src/enclave_messages/set_access_key.rs index fdb40a3f..544e2935 100644 --- a/rtc_types/src/enclave_messages/set_access_key.rs +++ b/rtc_types/src/enclave_messages/set_access_key.rs @@ -24,7 +24,7 @@ pub struct Response { pub const REQUEST_SIZE: usize = mem::size_of::(); // FFI type: EncryptedRequest -pub type EncryptedRequest = EncryptedEnclaveMessage; +pub type EncryptedRequest = EncryptedEnclaveMessage; // FFI type: RESPONSE_SIZE pub const RESPONSE_SIZE: usize = mem::size_of::();