WIP: 0.3.0 #5

Draft
shimun wants to merge 34 commits from 0.3.0 into master
3 changed files with 5 additions and 4 deletions
Showing only changes of commit 88b9677e7a - Show all commits

View File

@ -33,6 +33,9 @@ fn derive_secret(
timeout: u64,
pin: Option<&str>,
) -> Fido2LuksResult<([u8; 32], FidoCredential)> {
if credentials.len() == 0 {
return Err(Fido2LuksError::InsufficientCredentials);
}
let timeout = Duration::from_secs(timeout);
let start = SystemTime::now();

View File

@ -31,6 +31,8 @@ pub enum Fido2LuksError {
StringEncodingError { cause: FromUtf8Error },
#[fail(display = "not an hex string: {}", string)]
HexEncodingError { string: String },
#[fail(display = "couldn't obtain at least one credential")]
InsufficientCredentials,
}
impl Fido2LuksError {

View File

@ -103,10 +103,6 @@ impl LuksDevice {
Ok(())
}
pub fn add_credential(&mut self, slot: u32, credential: Vec<u8>) -> Fido2LuksResult<()> {
self.add_token(&Fido2LuksToken::with_credentials(&[credential], slot))
}
pub fn remove_token(&mut self, token: u32) -> Fido2LuksResult<()> {
self.require_luks2()?;
self.device