Corrects the GetInfo output without Config command (#665)

This commit is contained in:
kaczmarczyck
2023-11-23 14:52:02 +01:00
committed by GitHub
parent c160b034ef
commit eaeb927d92

View File

@@ -1282,15 +1282,19 @@ impl<E: Env> CtapState<E> {
options.append(&mut vec![ options.append(&mut vec![
(String::from("rk"), true), (String::from("rk"), true),
(String::from("up"), true), (String::from("up"), true),
(String::from("alwaysUv"), has_always_uv),
(String::from("credMgmt"), true), (String::from("credMgmt"), true),
#[cfg(feature = "config_command")]
(String::from("authnrCfg"), true), (String::from("authnrCfg"), true),
(String::from("clientPin"), storage::pin_hash(env)?.is_some()), (String::from("clientPin"), storage::pin_hash(env)?.is_some()),
(String::from("largeBlobs"), true), (String::from("largeBlobs"), true),
(String::from("pinUvAuthToken"), true), (String::from("pinUvAuthToken"), true),
#[cfg(feature = "config_command")]
(String::from("setMinPINLength"), true), (String::from("setMinPINLength"), true),
(String::from("makeCredUvNotRqd"), !has_always_uv), (String::from("makeCredUvNotRqd"), !has_always_uv),
]); ]);
if cfg!(feature = "config_command") || env.customization().enforce_always_uv() {
options.push((String::from("alwaysUv"), has_always_uv));
}
let mut pin_protocols = vec![PinUvAuthProtocol::V2 as u64]; let mut pin_protocols = vec![PinUvAuthProtocol::V2 as u64];
if env.customization().allows_pin_protocol_v1() { if env.customization().allows_pin_protocol_v1() {
pin_protocols.push(PinUvAuthProtocol::V1 as u64); pin_protocols.push(PinUvAuthProtocol::V1 as u64);
@@ -1499,12 +1503,15 @@ mod test {
"ep" => env.customization().enterprise_attestation_mode().map(|_| false), "ep" => env.customization().enterprise_attestation_mode().map(|_| false),
"rk" => true, "rk" => true,
"up" => true, "up" => true,
#[cfg(feature = "config_command")]
"alwaysUv" => false, "alwaysUv" => false,
"credMgmt" => true, "credMgmt" => true,
#[cfg(feature = "config_command")]
"authnrCfg" => true, "authnrCfg" => true,
"clientPin" => false, "clientPin" => false,
"largeBlobs" => true, "largeBlobs" => true,
"pinUvAuthToken" => true, "pinUvAuthToken" => true,
#[cfg(feature = "config_command")]
"setMinPINLength" => true, "setMinPINLength" => true,
"makeCredUvNotRqd" => true, "makeCredUvNotRqd" => true,
}, },