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

Commit

Permalink
Merge pull request #100 from registreerocks/feat-channel-sealing-helpers
Browse files Browse the repository at this point in the history
feat(rtc_tenclave): channel sealing helpers
  • Loading branch information
PiDelport authored Jun 17, 2021
2 parents 3a3ec1d + 11124e1 commit ac98979
Show file tree
Hide file tree
Showing 10 changed files with 475 additions and 30 deletions.
1 change: 1 addition & 0 deletions rtc_auth_enclave/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rtc_data_enclave/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rtc_exec_enclave/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 75 additions & 27 deletions rtc_tenclave/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions rtc_tenclave/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ ring = { version = "0.17.0-alpha.8", default-features = false }
sodalite = { version = "0.4.0", default-features = false }
cfg-if = "1.0.0"
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
rkyv = { version = "0.6.6", default_features = false, features = ["const_generics", "strict"] }

[dev-dependencies]
thiserror_std = { package = "thiserror", version = "1.0.9" }
Expand All @@ -74,6 +75,7 @@ once_cell_std = { package = "once_cell", version="1.7.2" }

# Test-only dependencies
proptest = "1.0.0"
proptest-derive = "0.3.0"
tempfile = "3.2.0"
mockall = { version = "0.9.1", features = ["nightly"] }

Expand Down
1 change: 1 addition & 0 deletions rtc_tenclave/src/dh/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Support for establishing secure local inter-enclave sessions using [`sgx_tdh`].
mod protected_channel;
pub mod sealing;
mod sessions;
mod types;

Expand Down
4 changes: 2 additions & 2 deletions rtc_tenclave/src/dh/protected_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl ProtectedChannel {
pub fn decrypt_message<const MESSAGE_SIZE: usize, const AAD_SIZE: usize>(
&self,
message: EncryptedEnclaveMessage<MESSAGE_SIZE, AAD_SIZE>,
) -> Result<[u8; MESSAGE_SIZE], sgx_status_t> {
) -> Result<([u8; MESSAGE_SIZE], [u8; AAD_SIZE]), sgx_status_t> {
let mut dst = [0_u8; MESSAGE_SIZE];
rsgx_rijndael128GCM_decrypt(
self.key.expose_secret().key(),
Expand All @@ -65,7 +65,7 @@ impl ProtectedChannel {
&message.tag,
&mut dst,
)?;
Ok(dst)
Ok((dst, message.aad))
}
}

Expand Down
Loading

0 comments on commit ac98979

Please sign in to comment.