void *data)
{
auto *testContents = static_cast<TestContents *>(data);
- auto lock = std::unique_lock{testContents->mutex};
+ std::lock_guard<std::mutex> ulock(testContents->mutex);
if (result != WAUTHN_ERROR_NONE && result != WAUTHN_ERROR_NONE_AND_WAIT) {
std::cout << __FUNCTION__ << ": failed\n"
<< "Error code: " << result << std::endl;
std::cout << "ret: " << wauthn_error_to_string(ret) << std::endl;
+ if (ret != WAUTHN_ERROR_NONE)
+ return false;
+
int timeCount = 120;
std::cout << "MC: Waiting Authenticate with mobile device for 120 seconds.." << std::endl;
while (testContents.statusMC == 0 && timeCount != 0) // exit after called Response CB
}
if (testContents.statusMC != 1) {
+ std::cout << "FAILED: Make Credential" << std::endl;
return false;
}
wauthn_pubkey_cred_request_options_s gaOptions;
std::memset(&gaOptions, 0, sizeof(gaOptions)); // For future compatibility.
- gaOptions.timeout = 60000; // 60s
+ gaOptions.timeout = 120000; // 120s
gaOptions.rpId = rpId;
gaOptions.user_verification = UVR_REQUIRED;
gaOptions.allow_credentials = &pubkeyCredDescriptors;
ret = wauthn_get_assertion(&clientData, &gaOptions, &gaCallbacks);
std::cout << "ret: " << wauthn_error_to_string(ret) << std::endl;
-
timeCount = 120;
std::cout << "GA: Waiting Authenticate with mobile device for 120 seconds.." << std::endl;
while (testContents.statusGA == 0 && timeCount != 0) // exit after called Response CB
sleep(1);
timeCount--;
}
-
if (testContents.statusGA != 1) {
+ std::cout << "FAILED: Get Assertion" << std::endl;
testContents.succeeded = false;
}
timeCount = 120;
- std::cout << "Waiting UpdateLinkedDataCallbacks for 120 seconds.." << std::endl;
- while (testContents.updateGARet != WAUTHN_ERROR_NONE && timeCount != 0)
+ std::cout << "Waiting UpdateLinkedData CBs for 120 seconds.." << std::endl;
+ while (((testContents.statusMC == 1 && testContents.updateMCRet != WAUTHN_ERROR_NONE)
+ || (testContents.statusGA == 1 && testContents.updateGARet != WAUTHN_ERROR_NONE)
+ ) && timeCount != 0)
{
sleep(1);
timeCount--;
}
-
std::cout << "MC: " << testContents.statusMC << ", GA: " << testContents.statusGA
<< std::endl;
std::cout << "MCRet: " << testContents.updateMCRet << ", GARet: "