diff --git a/services/keystore/src/lib.rs b/services/keystore/src/lib.rs index 903fc0625..ce5124010 100644 --- a/services/keystore/src/lib.rs +++ b/services/keystore/src/lib.rs @@ -46,6 +46,17 @@ impl Keystore { /// which secrets are stored. pub fn ensure_password(&self) -> PasswordState { PasswordState::Correct } + /// The ephemeral secret is a 128-bit value that wipes on device reset. The value itself + /// is provided by another library. It's intended to be a store for user-provided PIN values, + /// and thus would not be generated internally to the keystore. + /// + /// Returns `IntegrityCheckFailed` if the secret was not previously set. + pub fn get_volatile_secret(&self) -> Result<[u8; 16], KeywrapError> { + Err(KeywrapError::IntegrityCheckFailed) + } + + pub fn set_volatile_secret(&self, _secret: &[u8; 16]) { todo!() } + pub fn wrap_key(&self, input: &[u8]) -> Result, KeywrapError> { if input.len() > MAX_WRAP_DATA { // of course, the underlying crypto can handle a much larger piece of data, diff --git a/services/keystore/src/platform/baosec/server.rs b/services/keystore/src/platform/baosec/server.rs index 3607ca80f..54affb42a 100644 --- a/services/keystore/src/platform/baosec/server.rs +++ b/services/keystore/src/platform/baosec/server.rs @@ -35,6 +35,9 @@ pub fn keystore(sid: SID) -> ! { store.aes_kwp(&mut kwp).expect("couldn't wrap key"); buffer.replace(kwp).unwrap(); } + Opcode::EphemeralOp => { + todo!() + } Opcode::InvalidCall => { log::error!("Invalid call in keystore: {:?}", opcode); } diff --git a/services/keystore/src/platform/hosted.rs b/services/keystore/src/platform/hosted.rs index a17eed4fe..536e19829 100644 --- a/services/keystore/src/platform/hosted.rs +++ b/services/keystore/src/platform/hosted.rs @@ -133,6 +133,9 @@ pub fn keystore(sid: SID) -> ! { } buffer.replace(kwp).unwrap(); } + Opcode::EphemeralOp => { + todo!() + } Opcode::InvalidCall => { log::error!("Invalid call in keystore: {:?}", opcode); }