From: 강용구/Security&Privacy팀(SR)/삼성전자 Date: Tue, 23 Jan 2024 00:01:18 +0000 (+0900) Subject: Fix typo (#46) X-Git-Tag: accepted/tizen/unified/20240220.115627~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=260cc34d1513862a73e5539d388330ffdaee4ccf;p=platform%2Fcore%2Fsecurity%2Fwebauthn.git Fix typo (#46) * Fix typo * Remove end space of line --- diff --git a/srcs/server/service.cpp b/srcs/server/service.cpp index e4a2bb5..960fab8 100644 --- a/srcs/server/service.cpp +++ b/srcs/server/service.cpp @@ -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); 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(); diff --git a/tests/serialization-test.cpp b/tests/serialization-test.cpp index 9914d54..4264ba5 100644 --- a/tests/serialization-test.cpp +++ b/tests/serialization-test.cpp @@ -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}; diff --git a/tests/webauthn-client-test.cpp b/tests/webauthn-client-test.cpp index b5d73c6..48e1896 100644 --- a/tests/webauthn-client-test.cpp +++ b/tests/webauthn-client-test.cpp @@ -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))->test_data << ", " << (static_cast(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)