diff --git a/Cargo.toml b/Cargo.toml index 06432c4..fa73e90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,13 +11,13 @@ repository = "https://github.com/trussed-dev/ctap-types" arbitrary = { version = "1.3.2", features = ["derive"], optional = true } bitflags = "1.3" cbor-smol = "0.4" -cosey = "0.3.1" +cosey = { path = "../cosey_fork" } delog = "0.1" heapless = { version = "0.7", default-features = false, features = ["serde"] } heapless-bytes = "0.3" iso7816 = "0.1.2" serde = { version = "1", default-features = false, features = ["derive"] } -serde-indexed = "0.1.1" +serde-indexed = "0.1.0" serde_bytes = { version = "0.11.14", default-features = false } serde_repr = "0.1" diff --git a/src/ctap2/client_pin.rs b/src/ctap2/client_pin.rs index 048f375..70f5754 100644 --- a/src/ctap2/client_pin.rs +++ b/src/ctap2/client_pin.rs @@ -73,7 +73,7 @@ pub struct Request<'a> { // 0x07 #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) _placeholder07: Option<()>, + pub key_agreement_pqc: Option>, // 0x08 #[serde(skip_serializing_if = "Option::is_none")] @@ -136,7 +136,7 @@ mod tests { pin_auth: None, new_pin_enc: None, pin_hash_enc: None, - _placeholder07: None, + key_agreement_pqc: None, _placeholder08: None, permissions: None, rp_id: None, @@ -165,7 +165,7 @@ mod tests { pin_auth: None, new_pin_enc: None, pin_hash_enc: None, - _placeholder07: None, + key_agreement_pqc: None, _placeholder08: None, permissions: None, rp_id: None, @@ -198,7 +198,7 @@ mod tests { pin_auth: Some(serde_bytes::Bytes::new(PIN_AUTH)), new_pin_enc: Some(serde_bytes::Bytes::new(NEW_PIN_ENC)), pin_hash_enc: None, - _placeholder07: None, + key_agreement_pqc: None, _placeholder08: None, permissions: None, rp_id: None, @@ -256,7 +256,7 @@ mod tests { pin_auth: Some(serde_bytes::Bytes::new(PIN_AUTH)), new_pin_enc: Some(serde_bytes::Bytes::new(NEW_PIN_ENC)), pin_hash_enc: Some(serde_bytes::Bytes::new(PIN_HASH_ENC)), - _placeholder07: None, + key_agreement_pqc: None, _placeholder08: None, permissions: None, rp_id: None, @@ -317,7 +317,7 @@ mod tests { pin_auth: None, new_pin_enc: None, pin_hash_enc: Some(serde_bytes::Bytes::new(PIN_HASH_ENC)), - _placeholder07: None, + key_agreement_pqc: None, _placeholder08: None, permissions: None, rp_id: None, @@ -372,7 +372,7 @@ mod tests { pin_auth: None, new_pin_enc: None, pin_hash_enc: Some(serde_bytes::Bytes::new(PIN_HASH_ENC)), - _placeholder07: None, + key_agreement_pqc: None, _placeholder08: None, permissions: Some(0x04), rp_id: Some("example.com"), diff --git a/src/sizes.rs b/src/sizes.rs index 3f36595..4a146a6 100644 --- a/src/sizes.rs +++ b/src/sizes.rs @@ -1,10 +1,10 @@ -pub const AUTHENTICATOR_DATA_LENGTH: usize = 676; +pub const AUTHENTICATOR_DATA_LENGTH: usize = 2392; // pub const AUTHENTICATOR_DATA_LENGTH_BYTES: usize = 512; -pub const ASN1_SIGNATURE_LENGTH: usize = 77; +pub const ASN1_SIGNATURE_LENGTH: usize = 3293; // pub const ASN1_SIGNATURE_LENGTH_BYTES: usize = 72; -pub const COSE_KEY_LENGTH: usize = 256; +pub const COSE_KEY_LENGTH: usize = 2048; // pub const COSE_KEY_LENGTH_BYTES: usize = 256; pub const MAX_CREDENTIAL_ID_LENGTH: usize = 255; diff --git a/src/webauthn.rs b/src/webauthn.rs index 48d4dc6..f165b74 100644 --- a/src/webauthn.rs +++ b/src/webauthn.rs @@ -158,9 +158,12 @@ pub enum UnknownPKCredentialParam { pub const ES256: i32 = -7; /// EdDSA pub const ED_DSA: i32 = -8; +/// PQC +pub const CRYDI3: i32 = -20; +pub const KYBER768: i32 = -24; -pub const COUNT_KNOWN_ALGS: usize = 2; -pub const KNOWN_ALGS: [i32; COUNT_KNOWN_ALGS] = [ES256, ED_DSA]; +pub const COUNT_KNOWN_ALGS: usize = 4; +pub const KNOWN_ALGS: [i32; COUNT_KNOWN_ALGS] = [ES256, ED_DSA, CRYDI3, KYBER768]; impl TryFrom for KnownPublicKeyCredentialParameters { type Error = UnknownPKCredentialParam;