Skip to content

Commit

Permalink
throw error if UV not performed
Browse files Browse the repository at this point in the history
  • Loading branch information
coroiu committed Jun 27, 2024
1 parent 4aee67f commit 31f271b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions crates/bitwarden-fido/src/authenticator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,19 +631,21 @@ impl passkey::authenticator::UserValidationMethod for UserValidationMethodImpl<'
user_verified: verification != UV::Discouraged,
})
}
UIHint::RequestExistingCredential(cipher) => {
let options = match cipher.cipher.reprompt {
CipherRepromptType::None => options,
CipherRepromptType::Password => CheckUserOptions {
require_verification: Verification::Required,
..options
},
};

self.authenticator
UIHint::RequestExistingCredential(cipher)
if matches!(cipher.cipher.reprompt, CipherRepromptType::Password) =>
{
let result = self
.authenticator
.user_interface
.check_user(options, map_ui_hint(hint))
.await
.map_err(|_| Ctap2Error::OperationDenied)?;

if !result.user_verified {
return Err(Ctap2Error::UserVerificationInvalid);
}

Ok(result)
}

Check warning on line 649 in crates/bitwarden-fido/src/authenticator.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-fido/src/authenticator.rs#L634-L649

Added lines #L634 - L649 were not covered by tests
_ => {
self.authenticator
Expand Down

0 comments on commit 31f271b

Please sign in to comment.