mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
add placeholders for ephemeral/volatile data in keystore
This commit is contained in:
parent
c168c7d720
commit
315bee22dc
3 changed files with 17 additions and 0 deletions
|
|
@ -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<Vec<u8>, KeywrapError> {
|
||||
if input.len() > MAX_WRAP_DATA {
|
||||
// of course, the underlying crypto can handle a much larger piece of data,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue