hmac-secret: Forbid up=false

Fixes: https://github.com/Nitrokey/fido-authenticator/issues/19
This commit is contained in:
Robin Krahl
2025-05-07 16:04:44 +02:00
parent 91a57756c0
commit 7ff0518b68
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -1448,6 +1448,10 @@ impl<UP: UserPresence, T: TrussedRequirements> crate::Authenticator<UP, T> {
.transpose()?
.unwrap_or(PinProtocolVersion::V1);
if !get_assertion_state.up_performed {
return Err(Error::UnsupportedOption);
}
// We derive credRandom as an hmac of the existing private key.
// UV is used as input data since credRandom should depend UV
// i.e. credRandom = HMAC(private_key, uv)
+5
View File
@@ -774,6 +774,11 @@ impl TestGetAssertion {
if !self.rk && !self.allow_list {
return Some(0x2e);
}
if let Some(options) = self.options {
if options.up == Some(false) && self.ga_hmac_secret {
return Some(0x2b);
}
}
None
}
}