Fix typo (#46)
author강용구/Security&Privacy팀(SR)/삼성전자 <ygace.kang@samsung.com>
Tue, 23 Jan 2024 00:01:18 +0000 (09:01 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 23 Jan 2024 00:01:18 +0000 (09:01 +0900)
* Fix typo
* Remove end space of line

srcs/server/service.cpp
tests/serialization-test.cpp
tests/webauthn-client-test.cpp

index e4a2bb55ecd2cecc8310570c9d75d5fcdec23f0a..960fab89d36a6a1d61d12dd8e64bdc0dab5140eb 100644 (file)
@@ -114,7 +114,7 @@ void cb_mc_on_response(const wauthn_pubkey_credential_attestaion_s *pubkey_cred,
 {
     LogDebug("result: " << wauthn_error_to_string(result));
     if (user_data == nullptr)
-        ThrowMsg(ServiceException::InvalidUserdata, "Invalid user_data");    
+        ThrowMsg(ServiceException::InvalidUserdata, "Invalid user_data");
     user_data_s *userData = static_cast<user_data_s *>(user_data);
     if (userData->service == nullptr || userData->connectionID.sock == 0)
         ThrowMsg(ServiceException::InvalidUserdata, "Invalid user_data");
@@ -274,7 +274,7 @@ void Service::processEvent(Event &&msg)
 }
 
 void Service::processMakeCredential(
-    SocketManager::ConnectionID connectionID, 
+    SocketManager::ConnectionID connectionID,
     MessageBuffer &buffer)
 {
     wauthn_client_data_s *client_data;
@@ -308,7 +308,7 @@ void Service::processMakeCredential(
     }
 }
 
-void Service::processGetAssertion(SocketManager::ConnectionID connectionID, 
+void Service::processGetAssertion(SocketManager::ConnectionID connectionID,
     MessageBuffer &buffer)
 {
     wauthn_client_data_s *client_data;
@@ -341,7 +341,7 @@ void Service::processGetAssertion(SocketManager::ConnectionID connectionID,
     }
 }
 
-void Service::processCancel(SocketManager::ConnectionID connectionID, 
+void Service::processCancel(SocketManager::ConnectionID connectionID,
     MessageBuffer &buffer)
 {
     buffer.ModeStreaming();
index 9914d54ac6fb3256bb08f73c679b0f653d473541..4264ba58f86339dc63e0f31fd86d670b74cbaba8 100644 (file)
@@ -45,11 +45,11 @@ namespace SerializationTestData {
             = {nullptr, nullptr, 0x00, nullptr, nullptr, pubkey_alg};
 
     unsigned char signatureRaw[26] = {0x21, 0x22, 0x23, 0x24, };
-    unsigned char userHnadleRaw[36] = {0x31, 0x32, 0x33, 0x34, };
+    unsigned char userHandleRaw[36] = {0x31, 0x32, 0x33, 0x34, };
     wauthn_buffer_s signature = {signatureRaw, sizeof(signatureRaw)};
-    wauthn_buffer_s userHnadle = {userHnadleRaw, sizeof(userHnadleRaw)};
+    wauthn_buffer_s userHandle = {userHandleRaw, sizeof(userHandleRaw)};
     wauthn_authenticator_assertion_response_s authenticatorAssertionResponse
-            = {&clientDataJson, &authenticatorData, &signature, &userHnadle, &attestationObject};
+            = {&clientDataJson, &authenticatorData, &signature, &userHandle, &attestationObject};
     wauthn_authenticator_assertion_response_s emptyAuthenticatorAssertionResponse
             = {nullptr, nullptr, nullptr, nullptr, nullptr};
 
index b5d73c659a564a1131f0f92305d5544b141d8fa6..48e18967caca4ad5b6172bdd3d0a4618b5f6acf2 100644 (file)
@@ -48,11 +48,11 @@ namespace CommonTestData {
             = {nullptr, nullptr, 0x00, nullptr, nullptr, pubkey_alg};
 
     unsigned char signatureRaw[26] = {0x21, 0x22, 0x23, 0x24, };
-    unsigned char userHnadleRaw[36] = {0x31, 0x32, 0x33, 0x34, };
+    unsigned char userHandleRaw[36] = {0x31, 0x32, 0x33, 0x34, };
     wauthn_buffer_s signature = {signatureRaw, sizeof(signatureRaw)};
-    wauthn_buffer_s userHnadle = {userHnadleRaw, sizeof(userHnadleRaw)};
+    wauthn_buffer_s userHandle = {userHandleRaw, sizeof(userHandleRaw)};
     wauthn_authenticator_assertion_response_s authenticatorAssertionResponse
-            = {&clientDataJson, &authenticatorData, &signature, &userHnadle, &attestationObject};
+            = {&clientDataJson, &authenticatorData, &signature, &userHandle, &attestationObject};
     wauthn_authenticator_assertion_response_s emptyAuthenticatorAssertionResponse
             = {nullptr, nullptr, nullptr, nullptr, nullptr};
 
@@ -201,8 +201,8 @@ typedef struct _user_data_s {
 
 class WebAuthnTest : public ::testing::Test {
 protected:
-    void SetUp() override {        
-        int ret = WAUTHN_ERROR_NONE;        
+    void SetUp() override {
+        int ret = WAUTHN_ERROR_NONE;
         if (ret != WAUTHN_ERROR_NONE) {
             std::cout << "[webauthn_initialize] failed." << std::endl;
             return;
@@ -231,13 +231,13 @@ void test_cb_mc_on_response(const wauthn_pubkey_credential_attestaion_s *pubkey_
     if (pubkey_cred == nullptr)
         std::cout << "pubkey_cred is null" << std::endl;
     else
-        std::cout << "pubkey_cred is not null: " << 
+        std::cout << "pubkey_cred is not null: " <<
         pubkey_cred->type << ", " <<
         pubkey_cred->authenticator_attachment << std::endl;
     if (user_data == nullptr)
         std::cout << "user_data is null" << std::endl;
     else
-        std::cout << "user_data is not null:" << 
+        std::cout << "user_data is not null:" <<
         (static_cast<user_data_s*>(user_data))->test_data << 
         ", " << (static_cast<user_data_s*>(user_data))->test_int << std::endl;
     
@@ -274,8 +274,8 @@ void mc_func1()
     userdata->test_data = (char*)("user data");
     userdata->test_int = 10;
     callbacks->user_data = userdata;
-    ret = wauthn_make_credential(&CommonTestData::clientData, 
-        &CommonTestData::pubkeyCredCreationOptions, 
+    ret = wauthn_make_credential(&CommonTestData::clientData,
+        &CommonTestData::pubkeyCredCreationOptions,
         callbacks);
 
     EXPECT_EQ(ret, WAUTHN_ERROR_NONE)
@@ -296,8 +296,8 @@ void ga_func1()
     userdata->test_data = (char*)("user data");
     userdata->test_int = 10;
     callbacks->user_data = userdata;
-    ret = wauthn_get_assertion(&CommonTestData::clientData, 
-        &CommonTestData::pubkeyCredRequestOptions, 
+    ret = wauthn_get_assertion(&CommonTestData::clientData,
+        &CommonTestData::pubkeyCredRequestOptions,
         callbacks);
     EXPECT_EQ(ret, WAUTHN_ERROR_NONE)
             << "[wauthn_get_assertion] failed. " << "ret=" << wauthn_error_to_string(ret) << std::endl;
@@ -328,8 +328,8 @@ TEST_F(WebAuthnTest, testNotAllowedByBusy)
     mc_callbacks = (wauthn_mc_callbacks_s*) calloc(1, sizeof(wauthn_mc_callbacks_s));
     mc_callbacks->qrcode_callback = test_cb_display_qrcode;
     mc_callbacks->response_callback = test_cb_mc_on_response;
-    ret = wauthn_make_credential(&CommonTestData::clientData, 
-        &CommonTestData::pubkeyCredCreationOptions, 
+    ret = wauthn_make_credential(&CommonTestData::clientData,
+        &CommonTestData::pubkeyCredCreationOptions,
         mc_callbacks);
 
     EXPECT_EQ(ret, WAUTHN_ERROR_NONE)
@@ -342,8 +342,8 @@ TEST_F(WebAuthnTest, testNotAllowedByBusy)
     ga_callbacks = (wauthn_ga_callbacks_s*) calloc(1, sizeof(wauthn_ga_callbacks_s));
     ga_callbacks->qrcode_callback = test_cb_display_qrcode;
     ga_callbacks->response_callback = test_cb_ga_on_response;
-    ret = wauthn_get_assertion(&CommonTestData::clientData, 
-        &CommonTestData::pubkeyCredRequestOptions, 
+    ret = wauthn_get_assertion(&CommonTestData::clientData,
+        &CommonTestData::pubkeyCredRequestOptions,
         ga_callbacks);
 
     EXPECT_EQ(ret, WAUTHN_ERROR_NOT_ALLOWED)
@@ -360,8 +360,8 @@ TEST_F(WebAuthnTest, testCancelOK)
     mc_callbacks = (wauthn_mc_callbacks_s*) calloc(1, sizeof(wauthn_mc_callbacks_s));
     mc_callbacks->qrcode_callback = test_cb_display_qrcode;
     mc_callbacks->response_callback = test_cb_mc_on_response;
-    ret = wauthn_make_credential(&CommonTestData::clientData, 
-        &CommonTestData::pubkeyCredCreationOptions, 
+    ret = wauthn_make_credential(&CommonTestData::clientData,
+        &CommonTestData::pubkeyCredCreationOptions,
         mc_callbacks);
 
     EXPECT_EQ(ret, WAUTHN_ERROR_NONE)