Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion attestation-agent/deps/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "Apache-2.0"

[dependencies]
aes-gcm = { workspace = true, optional = true }
aes-kw = { version = "0.2.1", optional = true }
aes-kw = { version = "0.3.0", optional = true }
anyhow.workspace = true
base64.workspace = true
concat-kdf = { version = "0.1.0", optional = true }
Expand Down
7 changes: 3 additions & 4 deletions attestation-agent/deps/crypto/src/rust/ec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ use crate::{
AES_GCM_256_KEY_BITS,
};

use aes_gcm::aead::generic_array::GenericArray;
use aes_kw::{Kek, KekAes256};
use aes_kw::{KeyInit, KwAes256};
use anyhow::{anyhow, Result};
use p256::{
ecdh::diffie_hellman as diffie_hellman_p256,
Expand Down Expand Up @@ -156,10 +155,10 @@ impl EcKeyPair {
let unwrapping_key: [u8; 32] = unwrapping_key
.try_into()
.map_err(|_| anyhow!("invalid bytes length of AES wrapping key"))?;
let unwrapping_key: KekAes256 = Kek::new(&GenericArray::from(unwrapping_key));
let unwrapping_key = KwAes256::new(&unwrapping_key.into());
let mut decrypted_key = vec![0; encrypted_key.len() - 8];
unwrapping_key
.unwrap(&encrypted_key, &mut decrypted_key)
.unwrap_key(&encrypted_key, &mut decrypted_key)
.map_err(|e| anyhow!("failed to unwrap key: {e:?}"))?;

Ok(decrypted_key)
Expand Down
Loading