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

Commit

Permalink
feat(rtc_types::enclave_messages::set_access_key): add enclave ID to …
Browse files Browse the repository at this point in the history
…EncryptedRequest as AAD
  • Loading branch information
PiDelport committed Jun 11, 2021
1 parent 91e1ac6 commit a5fbec2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions codegen/auth_enclave/bindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions codegen/data_enclave/bindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions codegen/exec_enclave/bindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion rtc_types/src/enclave_messages/ffi_set_access_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!)

Expand All @@ -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,
}

Expand Down
2 changes: 1 addition & 1 deletion rtc_types/src/enclave_messages/set_access_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct Response {
pub const REQUEST_SIZE: usize = mem::size_of::<ArchivedRequest>();

// FFI type: EncryptedRequest
pub type EncryptedRequest = EncryptedEnclaveMessage<REQUEST_SIZE, 0>;
pub type EncryptedRequest = EncryptedEnclaveMessage<REQUEST_SIZE, ARCHIVED_ENCLAVE_ID_SIZE>;

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

0 comments on commit a5fbec2

Please sign in to comment.