[webkit-reviews] review granted: [Bug 197800] Add a unit test for client certificate authentication : [Attachment 369630] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 13 16:55:59 PDT 2019


youenn fablet <youennf at gmail.com> has granted Alex Christensen
<achristensen at apple.com>'s request for review:
Bug 197800: Add a unit test for client certificate authentication
https://bugs.webkit.org/show_bug.cgi?id=197800

Attachment 369630: Patch

https://bugs.webkit.org/attachment.cgi?id=369630&action=review




--- Comment #5 from youenn fablet <youennf at gmail.com> ---
Comment on attachment 369630
  --> https://bugs.webkit.org/attachment.cgi?id=369630
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=369630&action=review

> Tools/TestWebKitAPI/TCPServer.cpp:282
> +    EXPECT_TRUE(static_cast<size_t>(bytesRead) < sizeof(buffer));

These tests seem a bit strange since they are not test per-se but test infra.
It looks like it should be ASSERT(...)

> Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:43
> +    RetainPtr<SecCertificateRef> certificate =
adoptCF(SecCertificateCreateWithData(nullptr, (__bridge CFDataRef)[NSData
dataWithBytes:certificateBytes.data() length:certificateBytes.size()]));

auto

> Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:45
> +    Vector<uint8_t> privateKeyBytes =
TestWebKitAPI::TCPServer::testPrivateKey();

auto here and below.

> Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:58
> +    RetainPtr<SecIdentityRef> identity =
adoptCF(SecIdentityCreate(kCFAllocatorDefault, certificate.get(),
privateKey.get()));

auto

> Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:157
> +    EXPECT_EQ([delegate challengeCount], 2ull);

We could check that we first receive a server trust challenge and then a client
certificate challenge.

> Tools/TestWebKitAPI/Tests/WebKitCocoa/PDFLinkReferrer.mm:79
> +	   Vector<uint8_t> request = TCPServer::read(socket);

auto

> Tools/TestWebKitAPI/Tests/WebKitCocoa/PDFLinkReferrer.mm:82
> +	   const char* currentLine = reinterpret_cast<char*>(request.data());

auto


More information about the webkit-reviews mailing list