improved testing, addresses comments and a default level fix
This commit is contained in:
@@ -440,7 +440,7 @@ impl TryFrom<&cbor::Value> for SignatureAlgorithm {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, PartialOrd)]
|
||||
#[derive(Clone, Copy, PartialEq, PartialOrd)]
|
||||
#[cfg_attr(any(test, feature = "debug_ctap"), derive(Debug))]
|
||||
pub enum CredentialProtectionPolicy {
|
||||
UserVerificationOptional = 0x01,
|
||||
@@ -1079,6 +1079,22 @@ mod test {
|
||||
assert_eq!(unknown_algorithm, Ok(expected_unknown_algorithm));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cred_protection_policy_order() {
|
||||
assert!(
|
||||
CredentialProtectionPolicy::UserVerificationOptional
|
||||
< CredentialProtectionPolicy::UserVerificationOptionalWithCredentialIdList
|
||||
);
|
||||
assert!(
|
||||
CredentialProtectionPolicy::UserVerificationOptional
|
||||
< CredentialProtectionPolicy::UserVerificationRequired
|
||||
);
|
||||
assert!(
|
||||
CredentialProtectionPolicy::UserVerificationOptionalWithCredentialIdList
|
||||
< CredentialProtectionPolicy::UserVerificationRequired
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_from_into_cred_protection_policy() {
|
||||
let cbor_policy = cbor_int!(CredentialProtectionPolicy::UserVerificationOptional as i64);
|
||||
|
||||
Reference in New Issue
Block a user