Skip to content

Commit

Permalink
Add debug logging when hmac-secret output decryption fails
Browse files Browse the repository at this point in the history
  • Loading branch information
emlun committed Jul 10, 2024
1 parent b833a60 commit a02ed2b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/ctap2/commands/get_assertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,13 @@ impl GetAssertion {
{
dev.get_shared_secret()
.and_then(|shared_secret| hmac_response.decrypt_secrets(shared_secret))
.and_then(Result::ok)
.and_then(|result| match result {
Ok(ok) => Some(ok),
Err(err) => {
debug!("Failed to decrypt hmac-secret response: {:?}", err);
None
}
})
} else {
None
};
Expand All @@ -398,7 +404,13 @@ impl GetAssertion {
{
dev.get_shared_secret()
.and_then(|shared_secret| hmac_response.decrypt_secrets(shared_secret))
.and_then(Result::ok)
.and_then(|result| match result {
Ok(ok) => Some(ok),
Err(err) => {
debug!("Failed to decrypt hmac-secret response: {:?}", err);
None
}
})
.map(|outputs| outputs.into())
} else {
None
Expand Down

0 comments on commit a02ed2b

Please sign in to comment.