Implement file-backed persistent storage

This allows running ctap2 authenticator application on non-embedded host OS
to implement virtual FIDO2 authenticator for QEMU
This commit is contained in:
Egor Duda
2022-05-31 21:46:02 +03:00
parent 12f6ed6e0b
commit db26f6125b
6 changed files with 206 additions and 1 deletions

View File

@@ -34,6 +34,18 @@ pub enum StorageError {
/// Implementation-specific error.
CustomError,
// I/O error
#[cfg(feature = "hostenv")]
IOError,
}
#[cfg(feature = "hostenv")]
#[allow(unused_variables)]
impl From<std::io::Error> for StorageError {
fn from(error: std::io::Error) -> Self {
Self::IOError
}
}
pub type StorageResult<T> = Result<T, StorageError>;