From 33a75016678032c930e3178a543b304f177272b3 Mon Sep 17 00:00:00 2001 From: Rene Leveille Date: Wed, 31 Jul 2024 14:17:25 -0400 Subject: [PATCH] Change make_credential::Response order to follow CTAP2.1 --- .../src/authenticator/make_credential.rs | 4 ++-- passkey-types/src/ctap2/make_credential.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/passkey-authenticator/src/authenticator/make_credential.rs b/passkey-authenticator/src/authenticator/make_credential.rs index d3721e0..6cdb077 100644 --- a/passkey-authenticator/src/authenticator/make_credential.rs +++ b/passkey-authenticator/src/authenticator/make_credential.rs @@ -144,9 +144,9 @@ where .set_make_credential_extensions(extensions.signed)?; let response = Response { - auth_data, fmt: "None".into(), - att_stmt: vec![0xa0].into(), // CBOR equivalent to empty map + auth_data, + att_stmt: coset::cbor::value::Value::Map(vec![]), ep_att: None, large_blob_key: None, unsigned_extension_outputs: extensions.unsigned, diff --git a/passkey-types/src/ctap2/make_credential.rs b/passkey-types/src/ctap2/make_credential.rs index 9f79625..cb95836 100644 --- a/passkey-types/src/ctap2/make_credential.rs +++ b/passkey-types/src/ctap2/make_credential.rs @@ -258,13 +258,13 @@ serde_workaround! { /// Upon successful creation of a credential, the authenticator returns an attestation object. #[derive(Debug)] pub struct Response { - /// The authenticator data object + /// The attestation statement format identifier #[serde(rename = 0x01)] - pub auth_data: AuthenticatorData, + pub fmt: String, - /// The attestation statement format identifier + /// The authenticator data object #[serde(rename = 0x02)] - pub fmt: String, + pub auth_data: AuthenticatorData, /// The attestation statement, whose format is identified by the "fmt" object member. /// The client treats it as an opaque object.