From d128a9189249b9bcd0ecb1bafd51e1a07620b639 Mon Sep 17 00:00:00 2001 From: bunnie Date: Wed, 3 Aug 2022 23:45:54 +0800 Subject: [PATCH] don't completely break the CTAP2.0 compliance suite The response to get OpenSSH to work is non-compliant (because it's trying to read a 2.1 command set out of a 2.0 device). This will lead to breakage in the 2.0 test bench, but, it will allow the device to work with OpenSSH. meh. specs, schmecs. --- apps/vault/src/ctap/mod.rs | 2 +- apps/vault/src/ctap/response.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/vault/src/ctap/mod.rs b/apps/vault/src/ctap/mod.rs index 6b8e60cba..28e55e942 100644 --- a/apps/vault/src/ctap/mod.rs +++ b/apps/vault/src/ctap/mod.rs @@ -918,7 +918,7 @@ where transports: Some(vec![AuthenticatorTransport::Usb]), #[cfg(feature = "with_ctap2_1")] algorithms: Some(vec![ES256_CRED_PARAM]), - default_cred_protect: DEFAULT_CRED_PROTECT, + default_cred_protect: DEFAULT_CRED_PROTECT.is_some(), #[cfg(feature = "with_ctap2_1")] min_pin_length: self.persistent_store.min_pin_length()?, #[cfg(feature = "with_ctap2_1")] diff --git a/apps/vault/src/ctap/response.rs b/apps/vault/src/ctap/response.rs index d7fec6788..bd5294a38 100644 --- a/apps/vault/src/ctap/response.rs +++ b/apps/vault/src/ctap/response.rs @@ -15,7 +15,7 @@ #[cfg(feature = "with_ctap2_1")] use super::data_formats::{AuthenticatorTransport, PublicKeyCredentialParameter}; use super::data_formats::{ - CoseKey, CredentialProtectionPolicy, PackedAttestationStatement, PublicKeyCredentialDescriptor, + CoseKey, PackedAttestationStatement, PublicKeyCredentialDescriptor, PublicKeyCredentialUserEntity, }; use std::collections::BTreeMap; @@ -126,7 +126,7 @@ pub struct AuthenticatorGetInfoResponse { pub transports: Option>, #[cfg(feature = "with_ctap2_1")] pub algorithms: Option>, - pub default_cred_protect: Option, + pub default_cred_protect: bool, #[cfg(feature = "with_ctap2_1")] pub min_pin_length: u8, #[cfg(feature = "with_ctap2_1")] @@ -171,7 +171,7 @@ impl From for cbor::Value { 0x08 => max_credential_id_length, 0x09 => transports.map(|vec| cbor_array_vec!(vec)), 0x0A => algorithms.map(|vec| cbor_array_vec!(vec)), - 0x0C => default_cred_protect.map(|p| p as u64), + 0x0C => default_cred_protect, 0x0D => min_pin_length as u64, 0x0E => firmware_version, }