|
Lines 38-43
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec1
|
| 38 |
#import <WebCore/ExceptionData.h> |
38 |
#import <WebCore/ExceptionData.h> |
| 39 |
#import <WebCore/LocalAuthenticator.h> |
39 |
#import <WebCore/LocalAuthenticator.h> |
| 40 |
#import <WebCore/PublicKeyCredentialCreationOptions.h> |
40 |
#import <WebCore/PublicKeyCredentialCreationOptions.h> |
|
|
41 |
#import <WebCore/PublicKeyCredentialData.h> |
| 41 |
#import <WebCore/PublicKeyCredentialRequestOptions.h> |
42 |
#import <WebCore/PublicKeyCredentialRequestOptions.h> |
| 42 |
#import <wtf/BlockPtr.h> |
43 |
#import <wtf/BlockPtr.h> |
| 43 |
#import <wtf/text/Base64.h> |
44 |
#import <wtf/text/Base64.h> |
|
Lines 266-281
TEST(LocalAuthenticator, MakeCredentialNotSupportedPubKeyCredParams)
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec2
|
| 266 |
|
267 |
|
| 267 |
bool done = false; |
268 |
bool done = false; |
| 268 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
269 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
| 269 |
auto callback = [&done] (const Vector<uint8_t>&, const Vector<uint8_t>&) { |
270 |
auto callback = [&done] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { |
| 270 |
EXPECT_FALSE(true); |
271 |
WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData&) { |
| 271 |
done = true; |
272 |
EXPECT_FALSE(true); |
| 272 |
}; |
273 |
done = true; |
| 273 |
auto exceptionCallback = [&done] (const WebCore::ExceptionData& exception) mutable { |
274 |
}, [&](const WebCore::ExceptionData& exception) { |
| 274 |
EXPECT_EQ(WebCore::NotSupportedError, exception.code); |
275 |
EXPECT_EQ(WebCore::NotSupportedError, exception.code); |
| 275 |
EXPECT_STREQ("The platform attached authenticator doesn't support any provided PublicKeyCredentialParameters.", exception.message.ascii().data()); |
276 |
EXPECT_STREQ("The platform attached authenticator doesn't support any provided PublicKeyCredentialParameters.", exception.message.ascii().data()); |
| 276 |
done = true; |
277 |
done = true; |
|
|
278 |
}); |
| 277 |
}; |
279 |
}; |
| 278 |
authenticator->makeCredential({ }, creationOptions, WTFMove(callback), WTFMove(exceptionCallback)); |
280 |
authenticator->makeCredential({ }, creationOptions, WTFMove(callback)); |
| 279 |
|
281 |
|
| 280 |
TestWebKitAPI::Util::run(&done); |
282 |
TestWebKitAPI::Util::run(&done); |
| 281 |
} |
283 |
} |
|
Lines 294-311
TEST(LocalAuthenticator, MakeCredentialExcludeCredentialsMatch)
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec3
|
| 294 |
|
296 |
|
| 295 |
bool done = false; |
297 |
bool done = false; |
| 296 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
298 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
| 297 |
auto callback = [&done] (const Vector<uint8_t>&, const Vector<uint8_t>&) { |
299 |
auto callback = [&done] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { |
| 298 |
EXPECT_FALSE(true); |
300 |
WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData&) { |
| 299 |
cleanUpKeychain(); |
301 |
EXPECT_FALSE(true); |
| 300 |
done = true; |
302 |
cleanUpKeychain(); |
| 301 |
}; |
303 |
done = true; |
| 302 |
auto exceptionCallback = [&done] (const WebCore::ExceptionData& exception) mutable { |
304 |
}, [&](const WebCore::ExceptionData& exception) { |
| 303 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
305 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
| 304 |
EXPECT_STREQ("At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.", exception.message.ascii().data()); |
306 |
EXPECT_STREQ("At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.", exception.message.ascii().data()); |
| 305 |
cleanUpKeychain(); |
307 |
cleanUpKeychain(); |
| 306 |
done = true; |
308 |
done = true; |
|
|
309 |
}); |
| 307 |
}; |
310 |
}; |
| 308 |
authenticator->makeCredential({ }, creationOptions, WTFMove(callback), WTFMove(exceptionCallback)); |
311 |
authenticator->makeCredential({ }, creationOptions, WTFMove(callback)); |
| 309 |
|
312 |
|
| 310 |
TestWebKitAPI::Util::run(&done); |
313 |
TestWebKitAPI::Util::run(&done); |
| 311 |
} |
314 |
} |
|
Lines 319-334
TEST(LocalAuthenticator, MakeCredentialBiometricsNotEnrolled)
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec4
|
| 319 |
|
322 |
|
| 320 |
bool done = false; |
323 |
bool done = false; |
| 321 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
324 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
| 322 |
auto callback = [&done] (const Vector<uint8_t>&, const Vector<uint8_t>&) { |
325 |
auto callback = [&done] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { |
| 323 |
EXPECT_FALSE(true); |
326 |
WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData&) { |
| 324 |
done = true; |
327 |
EXPECT_FALSE(true); |
| 325 |
}; |
328 |
done = true; |
| 326 |
auto exceptionCallback = [&done] (const WebCore::ExceptionData& exception) mutable { |
329 |
}, [&](const WebCore::ExceptionData& exception) { |
| 327 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
330 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
| 328 |
EXPECT_STREQ("No avaliable authenticators.", exception.message.ascii().data()); |
331 |
EXPECT_STREQ("No avaliable authenticators.", exception.message.ascii().data()); |
| 329 |
done = true; |
332 |
done = true; |
|
|
333 |
}); |
| 330 |
}; |
334 |
}; |
| 331 |
authenticator->makeCredential({ }, creationOptions, WTFMove(callback), WTFMove(exceptionCallback)); |
335 |
authenticator->makeCredential({ }, creationOptions, WTFMove(callback)); |
| 332 |
|
336 |
|
| 333 |
TestWebKitAPI::Util::run(&done); |
337 |
TestWebKitAPI::Util::run(&done); |
| 334 |
} |
338 |
} |
|
Lines 343-358
TEST(LocalAuthenticator, MakeCredentialBiometricsNotAuthenticated)
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec5
|
| 343 |
|
347 |
|
| 344 |
bool done = false; |
348 |
bool done = false; |
| 345 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
349 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
| 346 |
auto callback = [&done] (const Vector<uint8_t>&, const Vector<uint8_t>&) { |
350 |
auto callback = [&done] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { |
| 347 |
EXPECT_FALSE(true); |
351 |
WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData&) { |
| 348 |
done = true; |
352 |
EXPECT_FALSE(true); |
| 349 |
}; |
353 |
done = true; |
| 350 |
auto exceptionCallback = [&done] (const WebCore::ExceptionData& exception) mutable { |
354 |
}, [&](const WebCore::ExceptionData& exception) { |
| 351 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
355 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
| 352 |
EXPECT_STREQ("Couldn't get user consent.", exception.message.ascii().data()); |
356 |
EXPECT_STREQ("Couldn't get user consent.", exception.message.ascii().data()); |
| 353 |
done = true; |
357 |
done = true; |
|
|
358 |
}); |
| 354 |
}; |
359 |
}; |
| 355 |
authenticator->makeCredential({ }, creationOptions, WTFMove(callback), WTFMove(exceptionCallback)); |
360 |
authenticator->makeCredential({ }, creationOptions, WTFMove(callback)); |
| 356 |
|
361 |
|
| 357 |
TestWebKitAPI::Util::run(&done); |
362 |
TestWebKitAPI::Util::run(&done); |
| 358 |
} |
363 |
} |
|
Lines 368-383
TEST(LocalAuthenticator, MakeCredentialNotAttestated)
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec6
|
| 368 |
bool done = false; |
373 |
bool done = false; |
| 369 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
374 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
| 370 |
authenticator->setFailureFlag(); |
375 |
authenticator->setFailureFlag(); |
| 371 |
auto callback = [&done] (const Vector<uint8_t>&, const Vector<uint8_t>&) { |
376 |
auto callback = [&done] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { |
| 372 |
EXPECT_FALSE(true); |
377 |
WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData&) { |
| 373 |
done = true; |
378 |
EXPECT_FALSE(true); |
| 374 |
}; |
379 |
done = true; |
| 375 |
auto exceptionCallback = [&done] (const WebCore::ExceptionData& exception) mutable { |
380 |
}, [&](const WebCore::ExceptionData& exception) { |
| 376 |
EXPECT_EQ(WebCore::UnknownError, exception.code); |
381 |
EXPECT_EQ(WebCore::UnknownError, exception.code); |
| 377 |
EXPECT_STREQ("Unknown internal error.", exception.message.ascii().data()); |
382 |
EXPECT_STREQ("Unknown internal error.", exception.message.ascii().data()); |
| 378 |
done = true; |
383 |
done = true; |
|
|
384 |
}); |
| 379 |
}; |
385 |
}; |
| 380 |
authenticator->makeCredential({ }, creationOptions, WTFMove(callback), WTFMove(exceptionCallback)); |
386 |
authenticator->makeCredential({ }, creationOptions, WTFMove(callback)); |
| 381 |
|
387 |
|
| 382 |
TestWebKitAPI::Util::run(&done); |
388 |
TestWebKitAPI::Util::run(&done); |
| 383 |
} |
389 |
} |
|
Lines 399-420
TEST(LocalAuthenticator, MakeCredentialDeleteOlderCredenital)
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec7
|
| 399 |
bool done = false; |
405 |
bool done = false; |
| 400 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
406 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
| 401 |
authenticator->setFailureFlag(); |
407 |
authenticator->setFailureFlag(); |
| 402 |
auto callback = [&done] (const Vector<uint8_t>&, const Vector<uint8_t>&) { |
408 |
auto callback = [&done] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { |
| 403 |
EXPECT_FALSE(true); |
409 |
WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData&) { |
| 404 |
done = true; |
410 |
EXPECT_FALSE(true); |
| 405 |
}; |
411 |
done = true; |
| 406 |
auto exceptionCallback = [&done] (const WebCore::ExceptionData&) mutable { |
412 |
}, [&](const WebCore::ExceptionData& exception) { |
| 407 |
NSDictionary *query = @{ |
413 |
NSDictionary *query = @{ |
| 408 |
(id)kSecClass: (id)kSecClassKey, |
414 |
(id)kSecClass: (id)kSecClassKey, |
| 409 |
(id)kSecAttrKeyClass: (id)kSecAttrKeyClassPrivate, |
415 |
(id)kSecAttrKeyClass: (id)kSecAttrKeyClassPrivate, |
| 410 |
(id)kSecAttrLabel: testRpId, |
416 |
(id)kSecAttrLabel: testRpId, |
| 411 |
(id)kSecAttrApplicationTag: [NSData dataWithBytes:testUserhandle length:sizeof(testUserhandle)], |
417 |
(id)kSecAttrApplicationTag: [NSData dataWithBytes:testUserhandle length:sizeof(testUserhandle)], |
| 412 |
}; |
418 |
}; |
| 413 |
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, NULL); |
419 |
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, NULL); |
| 414 |
EXPECT_EQ(errSecItemNotFound, status); |
420 |
EXPECT_EQ(errSecItemNotFound, status); |
| 415 |
done = true; |
421 |
done = true; |
|
|
422 |
}); |
| 416 |
}; |
423 |
}; |
| 417 |
authenticator->makeCredential({ }, creationOptions, WTFMove(callback), WTFMove(exceptionCallback)); |
424 |
authenticator->makeCredential({ }, creationOptions, WTFMove(callback)); |
| 418 |
|
425 |
|
| 419 |
TestWebKitAPI::Util::run(&done); |
426 |
TestWebKitAPI::Util::run(&done); |
| 420 |
} |
427 |
} |
|
Lines 432-534
TEST(LocalAuthenticator, MakeCredentialPassedWithSelfAttestation)
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec8
|
| 432 |
|
439 |
|
| 433 |
bool done = false; |
440 |
bool done = false; |
| 434 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
441 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
| 435 |
auto callback = [&done] (const Vector<uint8_t>& credentialId, const Vector<uint8_t>& attestationObjet) { |
442 |
auto callback = [&done] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { |
| 436 |
// Check Keychain |
443 |
WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData& data) { |
| 437 |
NSDictionary *query = @{ |
444 |
Vector<uint8_t> credentialId; |
| 438 |
(id)kSecClass: (id)kSecClassKey, |
445 |
credentialId.append(reinterpret_cast<uint8_t*>(data.rawId->data()), data.rawId->byteLength()); |
| 439 |
(id)kSecAttrKeyClass: (id)kSecAttrKeyClassPrivate, |
446 |
Vector<uint8_t> attestationObject; |
| 440 |
(id)kSecAttrLabel: testRpId, |
447 |
attestationObject.append(reinterpret_cast<uint8_t*>(data.attestationObject->data()), data.attestationObject->byteLength()); |
| 441 |
(id)kSecAttrApplicationLabel: adoptNS([[NSData alloc] initWithBase64EncodedString:testCredentialIdBase64 options:NSDataBase64DecodingIgnoreUnknownCharacters]).get(), |
448 |
|
| 442 |
(id)kSecAttrApplicationTag: [NSData dataWithBytes:testUserhandle length:sizeof(testUserhandle)], |
449 |
// Check Keychain |
| 443 |
}; |
450 |
NSDictionary *query = @{ |
| 444 |
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, NULL); |
451 |
(id)kSecClass: (id)kSecClassKey, |
| 445 |
EXPECT_FALSE(status); |
452 |
(id)kSecAttrKeyClass: (id)kSecAttrKeyClassPrivate, |
| 446 |
|
453 |
(id)kSecAttrLabel: testRpId, |
| 447 |
// Check Credential ID |
454 |
(id)kSecAttrApplicationLabel: adoptNS([[NSData alloc] initWithBase64EncodedString:testCredentialIdBase64 options:NSDataBase64DecodingIgnoreUnknownCharacters]).get(), |
| 448 |
EXPECT_TRUE(WTF::base64Encode(credentialId.data(), credentialId.size()) == testCredentialIdBase64); |
455 |
(id)kSecAttrApplicationTag: [NSData dataWithBytes:testUserhandle length:sizeof(testUserhandle)], |
| 449 |
|
456 |
}; |
| 450 |
// Check Attestation Object |
457 |
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, NULL); |
| 451 |
auto attestationObjectMap = cbor::CBORReader::read(attestationObjet); |
458 |
EXPECT_FALSE(status); |
| 452 |
ASSERT_TRUE(!!attestationObjectMap); |
459 |
|
| 453 |
|
460 |
// Check Credential ID |
| 454 |
// Check Authenticator Data. |
461 |
EXPECT_TRUE(WTF::base64Encode(credentialId.data(), credentialId.size()) == testCredentialIdBase64); |
| 455 |
auto& authData = attestationObjectMap->getMap().find(cbor::CBORValue("authData"))->second.getByteString(); |
462 |
|
| 456 |
size_t pos = 0; |
463 |
// Check Attestation Object |
| 457 |
uint8_t expectedRpIdHash[] = { |
464 |
auto attestationObjectMap = cbor::CBORReader::read(attestationObject); |
| 458 |
0x49, 0x96, 0x0d, 0xe5, 0x88, 0x0e, 0x8c, 0x68, |
465 |
ASSERT_TRUE(!!attestationObjectMap); |
| 459 |
0x74, 0x34, 0x17, 0x0f, 0x64, 0x76, 0x60, 0x5b, |
466 |
|
| 460 |
0x8f, 0xe4, 0xae, 0xb9, 0xa2, 0x86, 0x32, 0xc7, |
467 |
// Check Authenticator Data. |
| 461 |
0x99, 0x5c, 0xf3, 0xba, 0x83, 0x1d, 0x97, 0x63 |
468 |
auto& authData = attestationObjectMap->getMap().find(cbor::CBORValue("authData"))->second.getByteString(); |
| 462 |
}; |
469 |
size_t pos = 0; |
| 463 |
EXPECT_FALSE(memcmp(authData.data() + pos, expectedRpIdHash, sizeof(expectedRpIdHash))); |
470 |
uint8_t expectedRpIdHash[] = { |
| 464 |
pos += sizeof(expectedRpIdHash); |
471 |
0x49, 0x96, 0x0d, 0xe5, 0x88, 0x0e, 0x8c, 0x68, |
| 465 |
|
472 |
0x74, 0x34, 0x17, 0x0f, 0x64, 0x76, 0x60, 0x5b, |
| 466 |
// FLAGS |
473 |
0x8f, 0xe4, 0xae, 0xb9, 0xa2, 0x86, 0x32, 0xc7, |
| 467 |
EXPECT_EQ(69, authData[pos]); |
474 |
0x99, 0x5c, 0xf3, 0xba, 0x83, 0x1d, 0x97, 0x63 |
| 468 |
pos++; |
475 |
}; |
| 469 |
|
476 |
EXPECT_FALSE(memcmp(authData.data() + pos, expectedRpIdHash, sizeof(expectedRpIdHash))); |
| 470 |
uint32_t counter = -1; |
477 |
pos += sizeof(expectedRpIdHash); |
| 471 |
memcpy(&counter, authData.data() + pos, sizeof(uint32_t)); |
478 |
|
| 472 |
EXPECT_EQ(0u, counter); |
479 |
// FLAGS |
| 473 |
pos += sizeof(uint32_t); |
480 |
EXPECT_EQ(69, authData[pos]); |
| 474 |
|
481 |
pos++; |
| 475 |
uint8_t expectedAAGUID[] = { |
482 |
|
| 476 |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
483 |
uint32_t counter = -1; |
| 477 |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
484 |
memcpy(&counter, authData.data() + pos, sizeof(uint32_t)); |
| 478 |
}; |
485 |
EXPECT_EQ(0u, counter); |
| 479 |
EXPECT_FALSE(memcmp(authData.data() + pos, expectedAAGUID, sizeof(expectedAAGUID))); |
486 |
pos += sizeof(uint32_t); |
| 480 |
pos += sizeof(expectedAAGUID); |
487 |
|
| 481 |
|
488 |
uint8_t expectedAAGUID[] = { |
| 482 |
uint16_t l = -1; |
489 |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 483 |
memcpy(&l, authData.data() + pos, sizeof(uint16_t)); |
490 |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
| 484 |
EXPECT_EQ(20u, l); |
491 |
}; |
| 485 |
pos += sizeof(uint16_t); |
492 |
EXPECT_FALSE(memcmp(authData.data() + pos, expectedAAGUID, sizeof(expectedAAGUID))); |
| 486 |
|
493 |
pos += sizeof(expectedAAGUID); |
| 487 |
EXPECT_FALSE(memcmp(authData.data() + pos, credentialId.data(), l)); |
494 |
|
| 488 |
pos += l; |
495 |
uint16_t l = -1; |
| 489 |
|
496 |
memcpy(&l, authData.data() + pos, sizeof(uint16_t)); |
| 490 |
// Credential Public Key |
497 |
EXPECT_EQ(20u, l); |
| 491 |
// FIXME(183536): The CBOR reader doesn't support negative integer as map key. Thus we couldn't utilzie it. |
498 |
pos += sizeof(uint16_t); |
| 492 |
EXPECT_STREQ("pQECAyYgASFYIDj/zxSkzKgaBuS3cdWDF558of8AaIpgFpsjF/Qm1749IlggVBJPgqUIwfhWHJ91nb7UPH76c0+WFOzZKslPyyFse4g=", WTF::base64Encode(authData.data() + pos, authData.size() - pos).ascii().data()); |
499 |
|
| 493 |
|
500 |
EXPECT_FALSE(memcmp(authData.data() + pos, credentialId.data(), l)); |
| 494 |
// Check Self Attestation |
501 |
pos += l; |
| 495 |
EXPECT_STREQ("Apple", attestationObjectMap->getMap().find(cbor::CBORValue("fmt"))->second.getString().ascii().data()); |
502 |
|
| 496 |
|
503 |
// Credential Public Key |
| 497 |
auto& attStmt = attestationObjectMap->getMap().find(cbor::CBORValue("attStmt"))->second.getMap(); |
504 |
// FIXME(183536): The CBOR reader doesn't support negative integer as map key. Thus we couldn't utilzie it. |
| 498 |
EXPECT_EQ(COSE::ES256, attStmt.find(cbor::CBORValue("alg"))->second.getNegative()); |
505 |
EXPECT_STREQ("pQECAyYgASFYIDj/zxSkzKgaBuS3cdWDF558of8AaIpgFpsjF/Qm1749IlggVBJPgqUIwfhWHJ91nb7UPH76c0+WFOzZKslPyyFse4g=", WTF::base64Encode(authData.data() + pos, authData.size() - pos).ascii().data()); |
| 499 |
|
506 |
|
| 500 |
auto& sig = attStmt.find(cbor::CBORValue("sig"))->second.getByteString(); |
507 |
// Check Self Attestation |
| 501 |
auto privateKey = getTestKey(); |
508 |
EXPECT_STREQ("Apple", attestationObjectMap->getMap().find(cbor::CBORValue("fmt"))->second.getString().ascii().data()); |
| 502 |
EXPECT_TRUE(SecKeyVerifySignature(SecKeyCopyPublicKey(privateKey.get()), kSecKeyAlgorithmECDSASignatureMessageX962SHA256, (__bridge CFDataRef)[NSData dataWithBytes:authData.data() length:authData.size()], (__bridge CFDataRef)[NSData dataWithBytes:sig.data() length:sig.size()], NULL)); |
509 |
|
| 503 |
|
510 |
auto& attStmt = attestationObjectMap->getMap().find(cbor::CBORValue("attStmt"))->second.getMap(); |
| 504 |
// Check certificates |
511 |
EXPECT_EQ(COSE::ES256, attStmt.find(cbor::CBORValue("alg"))->second.getNegative()); |
| 505 |
auto& x5c = attStmt.find(cbor::CBORValue("x5c"))->second.getArray(); |
512 |
|
| 506 |
auto& attestationCertificateData = x5c[0].getByteString(); |
513 |
auto& sig = attStmt.find(cbor::CBORValue("sig"))->second.getByteString(); |
| 507 |
auto attestationCertificate = adoptCF(SecCertificateCreateWithData(NULL, (__bridge CFDataRef)[NSData dataWithBytes:attestationCertificateData.data() length:attestationCertificateData.size()])); |
514 |
auto privateKey = getTestKey(); |
| 508 |
CFStringRef commonName = nullptr; |
515 |
EXPECT_TRUE(SecKeyVerifySignature(SecKeyCopyPublicKey(privateKey.get()), kSecKeyAlgorithmECDSASignatureMessageX962SHA256, (__bridge CFDataRef)[NSData dataWithBytes:authData.data() length:authData.size()], (__bridge CFDataRef)[NSData dataWithBytes:sig.data() length:sig.size()], NULL)); |
| 509 |
status = SecCertificateCopyCommonName(attestationCertificate.get(), &commonName); |
516 |
|
| 510 |
auto retainCommonName = adoptCF(commonName); |
517 |
// Check certificates |
| 511 |
ASSERT(!status); |
518 |
auto& x5c = attStmt.find(cbor::CBORValue("x5c"))->second.getArray(); |
| 512 |
EXPECT_STREQ("00008010-000A49A230A0213A", [(NSString *)commonName cStringUsingEncoding: NSASCIIStringEncoding]); |
519 |
auto& attestationCertificateData = x5c[0].getByteString(); |
| 513 |
|
520 |
auto attestationCertificate = adoptCF(SecCertificateCreateWithData(NULL, (__bridge CFDataRef)[NSData dataWithBytes:attestationCertificateData.data() length:attestationCertificateData.size()])); |
| 514 |
auto& attestationIssuingCACertificateData = x5c[1].getByteString(); |
521 |
CFStringRef commonName = nullptr; |
| 515 |
auto attestationIssuingCACertificate = adoptCF(SecCertificateCreateWithData(NULL, (__bridge CFDataRef)[NSData dataWithBytes:attestationIssuingCACertificateData.data() length:attestationIssuingCACertificateData.size()])); |
522 |
status = SecCertificateCopyCommonName(attestationCertificate.get(), &commonName); |
| 516 |
commonName = nullptr; |
523 |
auto retainCommonName = adoptCF(commonName); |
| 517 |
status = SecCertificateCopyCommonName(attestationIssuingCACertificate.get(), &commonName); |
524 |
ASSERT(!status); |
| 518 |
retainCommonName = adoptCF(commonName); |
525 |
EXPECT_STREQ("00008010-000A49A230A0213A", [(NSString *)commonName cStringUsingEncoding: NSASCIIStringEncoding]); |
| 519 |
ASSERT(!status); |
526 |
|
| 520 |
EXPECT_STREQ("Basic Attestation User Sub CA1", [(NSString *)commonName cStringUsingEncoding: NSASCIIStringEncoding]); |
527 |
auto& attestationIssuingCACertificateData = x5c[1].getByteString(); |
| 521 |
|
528 |
auto attestationIssuingCACertificate = adoptCF(SecCertificateCreateWithData(NULL, (__bridge CFDataRef)[NSData dataWithBytes:attestationIssuingCACertificateData.data() length:attestationIssuingCACertificateData.size()])); |
| 522 |
cleanUpKeychain(); |
529 |
commonName = nullptr; |
| 523 |
done = true; |
530 |
status = SecCertificateCopyCommonName(attestationIssuingCACertificate.get(), &commonName); |
| 524 |
}; |
531 |
retainCommonName = adoptCF(commonName); |
| 525 |
auto exceptionCallback = [&done] (const WebCore::ExceptionData&) mutable { |
532 |
ASSERT(!status); |
| 526 |
EXPECT_FALSE(true); |
533 |
EXPECT_STREQ("Basic Attestation User Sub CA1", [(NSString *)commonName cStringUsingEncoding: NSASCIIStringEncoding]); |
| 527 |
cleanUpKeychain(); |
534 |
|
| 528 |
done = true; |
535 |
cleanUpKeychain(); |
|
|
536 |
done = true; |
| 537 |
}, [&](const WebCore::ExceptionData& exception) { |
| 538 |
EXPECT_FALSE(true); |
| 539 |
cleanUpKeychain(); |
| 540 |
done = true; |
| 541 |
}); |
| 529 |
}; |
542 |
}; |
| 530 |
Vector<uint8_t> hash(32); |
543 |
Vector<uint8_t> hash(32); |
| 531 |
authenticator->makeCredential(hash, creationOptions, WTFMove(callback), WTFMove(exceptionCallback)); |
544 |
authenticator->makeCredential(hash, creationOptions, WTFMove(callback)); |
| 532 |
|
545 |
|
| 533 |
TestWebKitAPI::Util::run(&done); |
546 |
TestWebKitAPI::Util::run(&done); |
| 534 |
} |
547 |
} |
|
Lines 544-559
TEST(LocalAuthenticator, GetAssertionAllowCredentialsMismatch1)
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec9
|
| 544 |
|
557 |
|
| 545 |
bool done = false; |
558 |
bool done = false; |
| 546 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
559 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
| 547 |
auto callback = [&done] (const Vector<uint8_t>&, const Vector<uint8_t>&, const Vector<uint8_t>&, const Vector<uint8_t>&) { |
560 |
auto callback = [&done] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { |
| 548 |
EXPECT_FALSE(true); |
561 |
WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData&) { |
| 549 |
done = true; |
562 |
EXPECT_FALSE(true); |
| 550 |
}; |
563 |
done = true; |
| 551 |
auto exceptionCallback = [&done] (const WebCore::ExceptionData& exception) mutable { |
564 |
}, [&](const WebCore::ExceptionData& exception) { |
| 552 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
565 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
| 553 |
EXPECT_STREQ("No matched credentials are found in the platform attached authenticator.", exception.message.ascii().data()); |
566 |
EXPECT_STREQ("No matched credentials are found in the platform attached authenticator.", exception.message.ascii().data()); |
| 554 |
done = true; |
567 |
done = true; |
|
|
568 |
}); |
| 555 |
}; |
569 |
}; |
| 556 |
authenticator->getAssertion({ }, requestOptions, WTFMove(callback), WTFMove(exceptionCallback)); |
570 |
authenticator->getAssertion({ }, requestOptions, WTFMove(callback)); |
| 557 |
|
571 |
|
| 558 |
TestWebKitAPI::Util::run(&done); |
572 |
TestWebKitAPI::Util::run(&done); |
| 559 |
} |
573 |
} |
|
Lines 566-581
TEST(LocalAuthenticator, GetAssertionAllowCredentialsMismatch2)
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec10
|
| 566 |
|
580 |
|
| 567 |
bool done = false; |
581 |
bool done = false; |
| 568 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
582 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
| 569 |
auto callback = [&done] (const Vector<uint8_t>&, const Vector<uint8_t>&, const Vector<uint8_t>&, const Vector<uint8_t>&) { |
583 |
auto callback = [&done] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { |
| 570 |
EXPECT_FALSE(true); |
584 |
WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData&) { |
| 571 |
done = true; |
585 |
EXPECT_FALSE(true); |
| 572 |
}; |
586 |
done = true; |
| 573 |
auto exceptionCallback = [&done] (const WebCore::ExceptionData& exception) mutable { |
587 |
}, [&](const WebCore::ExceptionData& exception) { |
| 574 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
588 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
| 575 |
EXPECT_STREQ("No matched credentials are found in the platform attached authenticator.", exception.message.ascii().data()); |
589 |
EXPECT_STREQ("No matched credentials are found in the platform attached authenticator.", exception.message.ascii().data()); |
| 576 |
done = true; |
590 |
done = true; |
|
|
591 |
}); |
| 577 |
}; |
592 |
}; |
| 578 |
authenticator->getAssertion({ }, requestOptions, WTFMove(callback), WTFMove(exceptionCallback)); |
593 |
authenticator->getAssertion({ }, requestOptions, WTFMove(callback)); |
| 579 |
|
594 |
|
| 580 |
TestWebKitAPI::Util::run(&done); |
595 |
TestWebKitAPI::Util::run(&done); |
| 581 |
} |
596 |
} |
|
Lines 595-612
TEST(LocalAuthenticator, GetAssertionAllowCredentialsMismatch3)
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec11
|
| 595 |
|
610 |
|
| 596 |
bool done = false; |
611 |
bool done = false; |
| 597 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
612 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
| 598 |
auto callback = [&done] (const Vector<uint8_t>&, const Vector<uint8_t>&, const Vector<uint8_t>&, const Vector<uint8_t>&) { |
613 |
auto callback = [&done] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { |
| 599 |
EXPECT_FALSE(true); |
614 |
WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData&) { |
| 600 |
cleanUpKeychain(); |
615 |
EXPECT_FALSE(true); |
| 601 |
done = true; |
616 |
cleanUpKeychain(); |
| 602 |
}; |
617 |
done = true; |
| 603 |
auto exceptionCallback = [&done] (const WebCore::ExceptionData& exception) mutable { |
618 |
}, [&](const WebCore::ExceptionData& exception) { |
| 604 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
619 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
| 605 |
EXPECT_STREQ("No matched credentials are found in the platform attached authenticator.", exception.message.ascii().data()); |
620 |
EXPECT_STREQ("No matched credentials are found in the platform attached authenticator.", exception.message.ascii().data()); |
| 606 |
cleanUpKeychain(); |
621 |
cleanUpKeychain(); |
| 607 |
done = true; |
622 |
done = true; |
|
|
623 |
}); |
| 608 |
}; |
624 |
}; |
| 609 |
authenticator->getAssertion({ }, requestOptions, WTFMove(callback), WTFMove(exceptionCallback)); |
625 |
authenticator->getAssertion({ }, requestOptions, WTFMove(callback)); |
| 610 |
|
626 |
|
| 611 |
TestWebKitAPI::Util::run(&done); |
627 |
TestWebKitAPI::Util::run(&done); |
| 612 |
} |
628 |
} |
|
Lines 622-639
TEST(LocalAuthenticator, GetAssertionBiometricsNotEnrolled)
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec12
|
| 622 |
|
638 |
|
| 623 |
bool done = false; |
639 |
bool done = false; |
| 624 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
640 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
| 625 |
auto callback = [&done] (const Vector<uint8_t>&, const Vector<uint8_t>&, const Vector<uint8_t>&, const Vector<uint8_t>&) { |
641 |
auto callback = [&done] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { |
| 626 |
EXPECT_FALSE(true); |
642 |
WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData&) { |
| 627 |
cleanUpKeychain(); |
643 |
EXPECT_FALSE(true); |
| 628 |
done = true; |
644 |
cleanUpKeychain(); |
| 629 |
}; |
645 |
done = true; |
| 630 |
auto exceptionCallback = [&done] (const WebCore::ExceptionData& exception) mutable { |
646 |
}, [&](const WebCore::ExceptionData& exception) { |
| 631 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
647 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
| 632 |
EXPECT_STREQ("No avaliable authenticators.", exception.message.ascii().data()); |
648 |
EXPECT_STREQ("No avaliable authenticators.", exception.message.ascii().data()); |
| 633 |
cleanUpKeychain(); |
649 |
cleanUpKeychain(); |
| 634 |
done = true; |
650 |
done = true; |
|
|
651 |
}); |
| 635 |
}; |
652 |
}; |
| 636 |
authenticator->getAssertion({ }, requestOptions, WTFMove(callback), WTFMove(exceptionCallback)); |
653 |
authenticator->getAssertion({ }, requestOptions, WTFMove(callback)); |
| 637 |
|
654 |
|
| 638 |
TestWebKitAPI::Util::run(&done); |
655 |
TestWebKitAPI::Util::run(&done); |
| 639 |
} |
656 |
} |
|
Lines 650-667
TEST(LocalAuthenticator, GetAssertionBiometricsNotAuthenticated)
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec13
|
| 650 |
|
667 |
|
| 651 |
bool done = false; |
668 |
bool done = false; |
| 652 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
669 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
| 653 |
auto callback = [&done] (const Vector<uint8_t>&, const Vector<uint8_t>&, const Vector<uint8_t>&, const Vector<uint8_t>&) { |
670 |
auto callback = [&done] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { |
| 654 |
EXPECT_FALSE(true); |
671 |
WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData&) { |
| 655 |
cleanUpKeychain(); |
672 |
EXPECT_FALSE(true); |
| 656 |
done = true; |
673 |
cleanUpKeychain(); |
| 657 |
}; |
674 |
done = true; |
| 658 |
auto exceptionCallback = [&done] (const WebCore::ExceptionData& exception) mutable { |
675 |
}, [&](const WebCore::ExceptionData& exception) { |
| 659 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
676 |
EXPECT_EQ(WebCore::NotAllowedError, exception.code); |
| 660 |
EXPECT_STREQ("Couldn't get user consent.", exception.message.ascii().data()); |
677 |
EXPECT_STREQ("Couldn't get user consent.", exception.message.ascii().data()); |
| 661 |
cleanUpKeychain(); |
678 |
cleanUpKeychain(); |
| 662 |
done = true; |
679 |
done = true; |
|
|
680 |
}); |
| 663 |
}; |
681 |
}; |
| 664 |
authenticator->getAssertion({ }, requestOptions, WTFMove(callback), WTFMove(exceptionCallback)); |
682 |
authenticator->getAssertion({ }, requestOptions, WTFMove(callback)); |
| 665 |
|
683 |
|
| 666 |
TestWebKitAPI::Util::run(&done); |
684 |
TestWebKitAPI::Util::run(&done); |
| 667 |
} |
685 |
} |
|
Lines 680-727
TEST(LocalAuthenticator, GetAssertionPassed)
a/Tools/TestWebKitAPI/Tests/ios/LocalAuthenticator.mm_sec14
|
| 680 |
|
698 |
|
| 681 |
bool done = false; |
699 |
bool done = false; |
| 682 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
700 |
std::unique_ptr<TestLocalAuthenticator> authenticator = std::make_unique<TestLocalAuthenticator>(); |
| 683 |
auto callback = [&done, hash] (const Vector<uint8_t>& credentialId, const Vector<uint8_t>& authData, const Vector<uint8_t>& signature, const Vector<uint8_t>& userhandle) { |
701 |
auto callback = [&done, hash] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { |
| 684 |
// Check Credential ID |
702 |
WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData& data) { |
| 685 |
EXPECT_TRUE(WTF::base64Encode(credentialId.data(), credentialId.size()) == testCredentialIdBase64); |
703 |
Vector<uint8_t> credentialId; |
| 686 |
|
704 |
credentialId.append(reinterpret_cast<uint8_t*>(data.rawId->data()), data.rawId->byteLength()); |
| 687 |
// Check Authenticator Data. |
705 |
Vector<uint8_t> authData; |
| 688 |
size_t pos = 0; |
706 |
authData.append(reinterpret_cast<uint8_t*>(data.authenticatorData->data()), data.authenticatorData->byteLength()); |
| 689 |
uint8_t expectedRpIdHash[] = { |
707 |
Vector<uint8_t> signature; |
| 690 |
0x49, 0x96, 0x0d, 0xe5, 0x88, 0x0e, 0x8c, 0x68, |
708 |
signature.append(reinterpret_cast<uint8_t*>(data.signature->data()), data.signature->byteLength()); |
| 691 |
0x74, 0x34, 0x17, 0x0f, 0x64, 0x76, 0x60, 0x5b, |
709 |
Vector<uint8_t> userhandle; |
| 692 |
0x8f, 0xe4, 0xae, 0xb9, 0xa2, 0x86, 0x32, 0xc7, |
710 |
userhandle.append(reinterpret_cast<uint8_t*>(data.userHandle->data()), data.userHandle->byteLength()); |
| 693 |
0x99, 0x5c, 0xf3, 0xba, 0x83, 0x1d, 0x97, 0x63 |
711 |
|
| 694 |
}; |
712 |
// Check Credential ID |
| 695 |
EXPECT_FALSE(memcmp(authData.data() + pos, expectedRpIdHash, sizeof(expectedRpIdHash))); |
713 |
EXPECT_TRUE(WTF::base64Encode(credentialId.data(), credentialId.size()) == testCredentialIdBase64); |
| 696 |
pos += sizeof(expectedRpIdHash); |
714 |
|
| 697 |
|
715 |
// Check Authenticator Data. |
| 698 |
// FLAGS |
716 |
size_t pos = 0; |
| 699 |
EXPECT_EQ(5, authData[pos]); |
717 |
uint8_t expectedRpIdHash[] = { |
| 700 |
pos++; |
718 |
0x49, 0x96, 0x0d, 0xe5, 0x88, 0x0e, 0x8c, 0x68, |
| 701 |
|
719 |
0x74, 0x34, 0x17, 0x0f, 0x64, 0x76, 0x60, 0x5b, |
| 702 |
uint32_t counter = -1; |
720 |
0x8f, 0xe4, 0xae, 0xb9, 0xa2, 0x86, 0x32, 0xc7, |
| 703 |
memcpy(&counter, authData.data() + pos, sizeof(uint32_t)); |
721 |
0x99, 0x5c, 0xf3, 0xba, 0x83, 0x1d, 0x97, 0x63 |
| 704 |
EXPECT_EQ(0u, counter); |
722 |
}; |
| 705 |
|
723 |
EXPECT_FALSE(memcmp(authData.data() + pos, expectedRpIdHash, sizeof(expectedRpIdHash))); |
| 706 |
// Check signature |
724 |
pos += sizeof(expectedRpIdHash); |
| 707 |
auto privateKey = getTestKey(); |
725 |
|
| 708 |
Vector<uint8_t> dataToSign(authData); |
726 |
// FLAGS |
| 709 |
dataToSign.appendVector(hash); |
727 |
EXPECT_EQ(5, authData[pos]); |
| 710 |
EXPECT_TRUE(SecKeyVerifySignature(SecKeyCopyPublicKey(privateKey.get()), kSecKeyAlgorithmECDSASignatureMessageX962SHA256, (__bridge CFDataRef)[NSData dataWithBytes:dataToSign.data() length:dataToSign.size()], (__bridge CFDataRef)[NSData dataWithBytes:signature.data() length:signature.size()], NULL)); |
728 |
pos++; |
| 711 |
|
729 |
|
| 712 |
// Check User Handle |
730 |
uint32_t counter = -1; |
| 713 |
EXPECT_EQ(userhandle.size(), sizeof(testUserhandle)); |
731 |
memcpy(&counter, authData.data() + pos, sizeof(uint32_t)); |
| 714 |
EXPECT_FALSE(memcmp(userhandle.data(), testUserhandle, sizeof(testUserhandle))); |
732 |
EXPECT_EQ(0u, counter); |
| 715 |
|
733 |
|
| 716 |
cleanUpKeychain(); |
734 |
// Check signature |
| 717 |
done = true; |
735 |
auto privateKey = getTestKey(); |
| 718 |
}; |
736 |
Vector<uint8_t> dataToSign(authData); |
| 719 |
auto exceptionCallback = [&done] (const WebCore::ExceptionData& exception) mutable { |
737 |
dataToSign.appendVector(hash); |
| 720 |
EXPECT_FALSE(true); |
738 |
EXPECT_TRUE(SecKeyVerifySignature(SecKeyCopyPublicKey(privateKey.get()), kSecKeyAlgorithmECDSASignatureMessageX962SHA256, (__bridge CFDataRef)[NSData dataWithBytes:dataToSign.data() length:dataToSign.size()], (__bridge CFDataRef)[NSData dataWithBytes:signature.data() length:signature.size()], NULL)); |
| 721 |
cleanUpKeychain(); |
739 |
|
| 722 |
done = true; |
740 |
// Check User Handle |
|
|
741 |
EXPECT_EQ(userhandle.size(), sizeof(testUserhandle)); |
| 742 |
EXPECT_FALSE(memcmp(userhandle.data(), testUserhandle, sizeof(testUserhandle))); |
| 743 |
|
| 744 |
cleanUpKeychain(); |
| 745 |
done = true; |
| 746 |
}, [&](const WebCore::ExceptionData& exception) { |
| 747 |
EXPECT_FALSE(true); |
| 748 |
cleanUpKeychain(); |
| 749 |
done = true; |
| 750 |
}); |
| 723 |
}; |
751 |
}; |
| 724 |
authenticator->getAssertion(hash, requestOptions, WTFMove(callback), WTFMove(exceptionCallback)); |
752 |
authenticator->getAssertion(hash, requestOptions, WTFMove(callback)); |
| 725 |
|
753 |
|
| 726 |
TestWebKitAPI::Util::run(&done); |
754 |
TestWebKitAPI::Util::run(&done); |
| 727 |
} |
755 |
} |