{
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");
}
void Service::processMakeCredential(
- SocketManager::ConnectionID connectionID,
+ SocketManager::ConnectionID connectionID,
MessageBuffer &buffer)
{
wauthn_client_data_s *client_data;
}
}
-void Service::processGetAssertion(SocketManager::ConnectionID connectionID,
+void Service::processGetAssertion(SocketManager::ConnectionID connectionID,
MessageBuffer &buffer)
{
wauthn_client_data_s *client_data;
}
}
-void Service::processCancel(SocketManager::ConnectionID connectionID,
+void Service::processCancel(SocketManager::ConnectionID connectionID,
MessageBuffer &buffer)
{
buffer.ModeStreaming();
= {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};
= {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};
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;
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;
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)
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;
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)
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)
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)