Skip to content

Commit

Permalink
Merge in upstream changes and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKotowick committed Jul 13, 2024
1 parent 72eb68b commit 54b4822
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
14 changes: 7 additions & 7 deletions src/ctap2/client_pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Bytes<1088>>,

// 0x08
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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"),
Expand Down
6 changes: 3 additions & 3 deletions src/sizes.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
7 changes: 5 additions & 2 deletions src/webauthn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PublicKeyCredentialParameters> for KnownPublicKeyCredentialParameters {
type Error = UnknownPKCredentialParam;
Expand Down

0 comments on commit 54b4822

Please sign in to comment.