add identity_key to wauthn_hybrid_linked_data_s 34/309634/5
authorDongsun Lee <ds73.lee@samsung.com>
Mon, 15 Apr 2024 01:09:57 +0000 (10:09 +0900)
committerDongsun Lee <ds73.lee@samsung.com>
Mon, 15 Apr 2024 09:16:11 +0000 (18:16 +0900)
Change-Id: I82b82e8f9feaf08dc8d54c51cf78e808721dedbc

include/webauthn-types.h
srcs/common/serialization.cpp
tests/serialization-test.cpp
tests/test-common.cpp
tests/test-common.h

index 9f696e1c0162e1410dfc4851ba492192663434fa..ec2c212cd6ed5f57b2e6dd3eec6f3a12b65c1492 100644 (file)
@@ -450,14 +450,14 @@ typedef struct __wauthn_pubkey_cred_hints {
  *
  */
 typedef struct __wauthn_hybrid_linked_data {
-    wauthn_const_buffer_s *contact_id;           // cbor:"1"
-    wauthn_const_buffer_s *link_id;              // cbor:"2"
-    wauthn_const_buffer_s *link_secret;          // cbor:"3"
-    wauthn_const_buffer_s *authenticator_pubkey; // cbor:"4"
-    wauthn_const_buffer_s *authenticator_name;   // cbor:"5"
-    wauthn_const_buffer_s *signature;            // cbor:"6"
-    wauthn_const_buffer_s *auth_pubkey;
-    wauthn_const_buffer_s *tunnel_server_domain;
+    wauthn_const_buffer_s *contact_id;           /**< cbor:"1" */
+    wauthn_const_buffer_s *link_id;              /**< cbor:"2" */
+    wauthn_const_buffer_s *link_secret;          /**< cbor:"3" */
+    wauthn_const_buffer_s *authenticator_pubkey; /**< cbor:"4" */
+    wauthn_const_buffer_s *authenticator_name;   /**< cbor:"5" */
+    wauthn_const_buffer_s *signature;            /**< cbor:"6" */
+    wauthn_const_buffer_s *tunnel_server_domain; /**< Domain String of tunnel server.*/
+    wauthn_const_buffer_s *identity_key;         /**< Identity Key created during QR initiated transaction.*/
 } wauthn_hybrid_linked_data_s;
 
 /**
index 8335da0bc488af710bfe61c29ef4719b83c2d30e..32ec092f14cd2f0d88036cac15058b3483c49971 100644 (file)
@@ -590,8 +590,8 @@ void WAuthnCtypeSerializer::serialize(IStream& stream, const wauthn_hybrid_linke
     serialize(stream, data->authenticator_pubkey);
     serialize(stream, data->authenticator_name);
     serialize(stream, data->signature);
-    serialize(stream, data->auth_pubkey);
     serialize(stream, data->tunnel_server_domain);
+    serialize(stream, data->identity_key);
 }
 void WAuthnCtypeSerializer::deserialize(IStream& stream, wauthn_hybrid_linked_data_s** data) {
     // Deserialize struct itself
@@ -605,8 +605,8 @@ void WAuthnCtypeSerializer::deserialize(IStream& stream, wauthn_hybrid_linked_da
     deserialize(stream, &((*data)->authenticator_pubkey));
     deserialize(stream, &((*data)->authenticator_name));
     deserialize(stream, &((*data)->signature));
-    deserialize(stream, &((*data)->auth_pubkey));
     deserialize(stream, &((*data)->tunnel_server_domain));
+    deserialize(stream, &((*data)->identity_key));
 }
 
 // For wauthn_attestation_formats_s
index 5e11197b24f054b71968d4e4afea1cb923c65587..5a8d2d1753551571f7155ae326a3fa48fa0de66d 100644 (file)
@@ -787,10 +787,10 @@ bool __compareWAuthnHybridLinkedDataS(const wauthn_hybrid_linked_data_s *expecte
         return false;
     if (__compareWAuthnBuffers(actual->signature, expected->signature) == false)
         return false;
-    if (__compareWAuthnBuffers(actual->auth_pubkey, expected->auth_pubkey) == false)
-        return false;
     if (__compareWAuthnBuffers(actual->tunnel_server_domain, expected->tunnel_server_domain) == false)
         return false;
+    if (__compareWAuthnBuffers(actual->identity_key, expected->identity_key) == false)
+        return false;
     return true;
 }
 TEST_F(WAuthnSerializationTest, wauthn_hybrid_linked_data_s_P)
index aa6aee8b9aab8a05aa4234f5a71505a359878423..533d8e682d4fa4b403b302542c58c4d4bc43ef16 100644 (file)
@@ -125,17 +125,17 @@ namespace TestCommonData {
     unsigned char linkSecretRaw[26] = {0x11, 0x12, 0x13, 0x14, };
     unsigned char authenticatorPubkeyRaw[16] = {0x11, 0x12, 0x13, 0x14, };
     unsigned char authenticatorNameRaw[26] = {0x11, 0x12, 0x13, 0x14, };
-    unsigned char authPubkeyRaw[36] = {0x11, 0x12, 0x13, 0x14, };
     unsigned char tunnelServerDomainRaw[36] = {0x11, 0x12, 0x13, 0x14, };
+    unsigned char identityKeyRaw[36] = {0x11, 0x12, 0x13, 0x14, };
     wauthn_const_buffer_s contactId = {contactIdRaw, sizeof(contactIdRaw)};
     wauthn_const_buffer_s linkId = {linkIdRaw, sizeof(linkIdRaw)};
     wauthn_const_buffer_s linkSecret = {linkSecretRaw, sizeof(linkSecretRaw)};
     wauthn_const_buffer_s authenticatorPubkey = {authenticatorPubkeyRaw, sizeof(authenticatorPubkeyRaw)};
     wauthn_const_buffer_s authenticatorName = {authenticatorNameRaw, sizeof(authenticatorNameRaw)};
-    wauthn_const_buffer_s authPubkey = {authPubkeyRaw, sizeof(authPubkeyRaw)};
+    wauthn_const_buffer_s identityKey = {identityKeyRaw, sizeof(identityKeyRaw)};
     wauthn_const_buffer_s tunnelServerDomain = {tunnelServerDomainRaw, sizeof(tunnelServerDomainRaw)};
     wauthn_hybrid_linked_data_s hybridLinkedData = {&contactId, &linkId, &linkSecret, &authenticatorPubkey,
-                                &authenticatorName, &signature, &authPubkey, &tunnelServerDomain};
+                                &authenticatorName, &signature, &tunnelServerDomain, &identityKey};
     wauthn_hybrid_linked_data_s emptyHybridLinkedData = {nullptr, nullptr, nullptr, nullptr,
                                             nullptr, nullptr, nullptr, nullptr};
 
index 5d9f3e21789413c759f732973e72b4a9f3c73711..b6511fd0b43a552c2bed15a1a6fc7ece134b6cc9 100644 (file)
@@ -191,14 +191,14 @@ namespace TestCommonData {
     extern unsigned char linkSecretRaw[26];
     extern unsigned char authenticatorPubkeyRaw[16];
     extern unsigned char authenticatorNameRaw[26];
-    extern unsigned char authPubkeyRaw[36];
+    extern unsigned char identityKeyRaw[36];
     extern unsigned char tunnelServerDomainRaw[36];
     extern wauthn_const_buffer_s contactId;
     extern wauthn_const_buffer_s linkId;
     extern wauthn_const_buffer_s linkSecret;
     extern wauthn_const_buffer_s authenticatorPubkey;
     extern wauthn_const_buffer_s authenticatorName;
-    extern wauthn_const_buffer_s authPubkey;
+    extern wauthn_const_buffer_s identityKey;
     extern wauthn_const_buffer_s tunnelServerDomain;
     extern wauthn_hybrid_linked_data_s hybridLinkedData;
     extern wauthn_hybrid_linked_data_s emptyHybridLinkedData;