Changeset 244568 in webkit


Ignore:
Timestamp:
Apr 23, 2019, 2:46:46 PM (6 years ago)
Author:
achristensen@apple.com
Message:

Add unit tests for WKWebView.serverTrust
https://bugs.webkit.org/show_bug.cgi?id=197202

Source/ThirdParty/libwebrtc:

Reviewed by Youenn Fablet.

  • libwebrtc.xcodeproj/project.pbxproj:

Move boringssl files from libwebrtc target to boringssl target.
Also, add pkcs7 files to boringssl static library.

Tools:

Reviewed by Youenn Fablet

  • TestWebKitAPI/TCPServer.cpp:

(TestWebKitAPI::deleter<BIO>::operator()):
(TestWebKitAPI::deleter<SSL>::operator()):
(TestWebKitAPI::deleter<X509>::operator()):
(TestWebKitAPI::deleter<SSL_CTX>::operator()):
(TestWebKitAPI::deleter<EVP_PKEY>::operator()):
(TestWebKitAPI::TCPServer::TCPServer):
(TestWebKitAPI::TCPServer::listenForConnections):

  • TestWebKitAPI/TCPServer.h:
  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:

(TestWebKitAPI::TEST):
(verifyCertificateAndPublicKey):
(-[ServerTrustDelegate webView:didFinishNavigation:]):
(-[ServerTrustDelegate webView:didReceiveAuthenticationChallenge:completionHandler:]):

  • TestWebKitAPI/Tests/WebKitCocoa/Download.mm:

(TestWebKitAPI::downloadAtRate):

  • TestWebKitAPI/Tests/WebKitCocoa/PDFLinkReferrer.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/WKNavigationResponse.mm:

(TEST):

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/libwebrtc/ChangeLog

    r244050 r244568  
     12019-04-23  Alex Christensen  <achristensen@webkit.org>
     2
     3        Add unit tests for WKWebView.serverTrust
     4        https://bugs.webkit.org/show_bug.cgi?id=197202
     5
     6        Reviewed by Youenn Fablet.
     7
     8        * libwebrtc.xcodeproj/project.pbxproj:
     9        Move boringssl files from libwebrtc target to boringssl target.
     10        Also, add pkcs7 files to boringssl static library.
     11
    1122019-04-08  Justin Fan  <justin_fan@apple.com>
    213
  • trunk/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj

    r242623 r244568  
    989989                419C843E1FE250490040C30F /* ssladapter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 413A22251FE18DCD00373E99 /* ssladapter.cc */; };
    990990                419C843F1FE250B90040C30F /* opensslstreamadapter.cc in Sources */ = {isa = PBXBuildFile; fileRef = 413A218D1FE18D8300373E99 /* opensslstreamadapter.cc */; };
    991                 419C845D1FE255FA0040C30F /* tls13_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84401FE255EF0040C30F /* tls13_server.cc */; };
    992                 419C845E1FE255FA0040C30F /* ssl_aead_ctx.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84411FE255EF0040C30F /* ssl_aead_ctx.cc */; };
    993                 419C845F1FE255FA0040C30F /* ssl_session.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84421FE255EF0040C30F /* ssl_session.cc */; };
    994                 419C84601FE255FA0040C30F /* ssl_buffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84431FE255F00040C30F /* ssl_buffer.cc */; };
    995                 419C84611FE255FA0040C30F /* ssl_stat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84441FE255F00040C30F /* ssl_stat.cc */; };
    996                 419C84621FE255FA0040C30F /* ssl_transcript.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84451FE255F10040C30F /* ssl_transcript.cc */; };
    997                 419C84631FE255FA0040C30F /* tls13_enc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84461FE255F10040C30F /* tls13_enc.cc */; };
    998                 419C84641FE255FA0040C30F /* ssl_x509.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84471FE255F10040C30F /* ssl_x509.cc */; };
    999                 419C84651FE255FA0040C30F /* ssl_cipher.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84481FE255F10040C30F /* ssl_cipher.cc */; };
    1000                 419C84661FE255FA0040C30F /* tls_record.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84491FE255F20040C30F /* tls_record.cc */; };
    1001                 419C84671FE255FA0040C30F /* tls13_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C844A1FE255F20040C30F /* tls13_client.cc */; };
    1002                 419C84681FE255FA0040C30F /* tls13_both.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C844B1FE255F30040C30F /* tls13_both.cc */; };
    1003                 419C84691FE255FA0040C30F /* handshake.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C844C1FE255F30040C30F /* handshake.cc */; };
    1004                 419C846B1FE255FA0040C30F /* tls_method.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C844E1FE255F40040C30F /* tls_method.cc */; };
    1005                 419C846C1FE255FA0040C30F /* ssl_privkey.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C844F1FE255F40040C30F /* ssl_privkey.cc */; };
    1006                 419C846D1FE255FA0040C30F /* t1_enc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84501FE255F40040C30F /* t1_enc.cc */; };
    1007                 419C846E1FE255FA0040C30F /* ssl_versions.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84511FE255F50040C30F /* ssl_versions.cc */; };
    1008                 419C846F1FE255FA0040C30F /* bio_ssl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84521FE255F50040C30F /* bio_ssl.cc */; };
    1009                 419C84701FE255FA0040C30F /* s3_both.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84531FE255F50040C30F /* s3_both.cc */; };
    1010                 419C84721FE255FA0040C30F /* ssl_file.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84551FE255F60040C30F /* ssl_file.cc */; };
    1011                 419C84731FE255FA0040C30F /* s3_pkt.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84561FE255F70040C30F /* s3_pkt.cc */; };
    1012                 419C84741FE255FA0040C30F /* ssl_asn1.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84571FE255F70040C30F /* ssl_asn1.cc */; };
    1013                 419C84751FE255FA0040C30F /* ssl_cert.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84581FE255F70040C30F /* ssl_cert.cc */; };
    1014                 419C84761FE255FA0040C30F /* ssl_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84591FE255F80040C30F /* ssl_lib.cc */; };
    1015                 419C84771FE255FA0040C30F /* s3_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C845A1FE255F80040C30F /* s3_lib.cc */; };
    1016                 419C84781FE255FA0040C30F /* ssl_key_share.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C845B1FE255F90040C30F /* ssl_key_share.cc */; };
    1017                 419C84791FE255FA0040C30F /* t1_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C845C1FE255F90040C30F /* t1_lib.cc */; };
    1018                 419C84871FE2574D0040C30F /* d1_srtp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C847E1FE257490040C30F /* d1_srtp.cc */; };
    1019                 419C84881FE2574D0040C30F /* dtls_method.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C847F1FE257490040C30F /* dtls_method.cc */; };
    1020                 419C84891FE2574D0040C30F /* handshake_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84801FE2574A0040C30F /* handshake_client.cc */; };
    1021                 419C848A1FE2574D0040C30F /* dtls_record.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84811FE2574A0040C30F /* dtls_record.cc */; };
    1022                 419C848B1FE2574D0040C30F /* handshake_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84821FE2574A0040C30F /* handshake_server.cc */; };
    1023                 419C848C1FE2574D0040C30F /* d1_both.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84831FE2574B0040C30F /* d1_both.cc */; };
    1024                 419C848D1FE2574D0040C30F /* d1_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84841FE2574B0040C30F /* d1_lib.cc */; };
    1025                 419C848F1FE2574D0040C30F /* d1_pkt.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84861FE2574C0040C30F /* d1_pkt.cc */; };
    1026                 419C84921FE2591F0040C30F /* err_data.c in Sources */ = {isa = PBXBuildFile; fileRef = 419C84911FE2591E0040C30F /* err_data.c */; };
    1027991                419C84AA1FE303DE0040C30F /* h264.h in Headers */ = {isa = PBXBuildFile; fileRef = 419C84A81FE303DD0040C30F /* h264.h */; };
    1028992                419C84AB1FE303DE0040C30F /* h264_globals.h in Headers */ = {isa = PBXBuildFile; fileRef = 419C84A91FE303DE0040C30F /* h264_globals.h */; };
     
    33543318                5CDD90611E43D11200621E92 /* send_side_bandwidth_estimation.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5CDD905B1E43D11200621E92 /* send_side_bandwidth_estimation.cc */; };
    33553319                5CDD90621E43D11200621E92 /* send_side_bandwidth_estimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CDD905C1E43D11200621E92 /* send_side_bandwidth_estimation.h */; };
     3320                5CFACF33226E96BD0056C7D0 /* ssl_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84591FE255F80040C30F /* ssl_lib.cc */; };
     3321                5CFACF34226E96E60056C7D0 /* ssl_session.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84421FE255EF0040C30F /* ssl_session.cc */; };
     3322                5CFACF35226E96ED0056C7D0 /* bio_ssl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84521FE255F50040C30F /* bio_ssl.cc */; };
     3323                5CFACF36226E96F20056C7D0 /* d1_both.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84831FE2574B0040C30F /* d1_both.cc */; };
     3324                5CFACF37226E96F70056C7D0 /* d1_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84841FE2574B0040C30F /* d1_lib.cc */; };
     3325                5CFACF38226E96FB0056C7D0 /* d1_pkt.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84861FE2574C0040C30F /* d1_pkt.cc */; };
     3326                5CFACF39226E96FE0056C7D0 /* d1_srtp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C847E1FE257490040C30F /* d1_srtp.cc */; };
     3327                5CFACF3A226E97050056C7D0 /* dtls_method.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C847F1FE257490040C30F /* dtls_method.cc */; };
     3328                5CFACF3B226E97080056C7D0 /* dtls_record.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84811FE2574A0040C30F /* dtls_record.cc */; };
     3329                5CFACF3C226E970C0056C7D0 /* handshake.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C844C1FE255F30040C30F /* handshake.cc */; };
     3330                5CFACF3D226E970F0056C7D0 /* handshake_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84801FE2574A0040C30F /* handshake_client.cc */; };
     3331                5CFACF3E226E97120056C7D0 /* handshake_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84821FE2574A0040C30F /* handshake_server.cc */; };
     3332                5CFACF3F226E97180056C7D0 /* s3_both.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84531FE255F50040C30F /* s3_both.cc */; };
     3333                5CFACF40226E971C0056C7D0 /* s3_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C845A1FE255F80040C30F /* s3_lib.cc */; };
     3334                5CFACF41226E971F0056C7D0 /* s3_pkt.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84561FE255F70040C30F /* s3_pkt.cc */; };
     3335                5CFACF43226E97350056C7D0 /* ssl_aead_ctx.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84411FE255EF0040C30F /* ssl_aead_ctx.cc */; };
     3336                5CFACF44226E97390056C7D0 /* ssl_asn1.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84571FE255F70040C30F /* ssl_asn1.cc */; };
     3337                5CFACF45226E973C0056C7D0 /* ssl_buffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84431FE255F00040C30F /* ssl_buffer.cc */; };
     3338                5CFACF46226E97400056C7D0 /* ssl_cert.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84581FE255F70040C30F /* ssl_cert.cc */; };
     3339                5CFACF47226E975D0056C7D0 /* ssl_cipher.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84481FE255F10040C30F /* ssl_cipher.cc */; };
     3340                5CFACF48226E97610056C7D0 /* ssl_file.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84551FE255F60040C30F /* ssl_file.cc */; };
     3341                5CFACF49226E97650056C7D0 /* ssl_key_share.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C845B1FE255F90040C30F /* ssl_key_share.cc */; };
     3342                5CFACF4A226E976B0056C7D0 /* ssl_privkey.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C844F1FE255F40040C30F /* ssl_privkey.cc */; };
     3343                5CFACF4B226E97710056C7D0 /* ssl_stat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84441FE255F00040C30F /* ssl_stat.cc */; };
     3344                5CFACF4D226E97780056C7D0 /* ssl_transcript.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84451FE255F10040C30F /* ssl_transcript.cc */; };
     3345                5CFACF4E226E977D0056C7D0 /* ssl_versions.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84511FE255F50040C30F /* ssl_versions.cc */; };
     3346                5CFACF4F226E977F0056C7D0 /* ssl_x509.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84471FE255F10040C30F /* ssl_x509.cc */; };
     3347                5CFACF50226E97830056C7D0 /* t1_enc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84501FE255F40040C30F /* t1_enc.cc */; };
     3348                5CFACF51226E97860056C7D0 /* t1_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C845C1FE255F90040C30F /* t1_lib.cc */; };
     3349                5CFACF52226E978A0056C7D0 /* tls13_both.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C844B1FE255F30040C30F /* tls13_both.cc */; };
     3350                5CFACF53226E978D0056C7D0 /* tls13_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C844A1FE255F20040C30F /* tls13_client.cc */; };
     3351                5CFACF54226E97910056C7D0 /* tls13_enc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84461FE255F10040C30F /* tls13_enc.cc */; };
     3352                5CFACF55226E97950056C7D0 /* tls13_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84401FE255EF0040C30F /* tls13_server.cc */; };
     3353                5CFACF56226E97980056C7D0 /* tls_method.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C844E1FE255F40040C30F /* tls_method.cc */; };
     3354                5CFACF57226E979C0056C7D0 /* tls_record.cc in Sources */ = {isa = PBXBuildFile; fileRef = 419C84491FE255F20040C30F /* tls_record.cc */; };
     3355                5CFACF58226E97CD0056C7D0 /* err_data.c in Sources */ = {isa = PBXBuildFile; fileRef = 419C84911FE2591E0040C30F /* err_data.c */; };
     3356                5CFACF5E226E9A1E0056C7D0 /* pkcs7_x509.c in Sources */ = {isa = PBXBuildFile; fileRef = 5CFACF5A226E9A1A0056C7D0 /* pkcs7_x509.c */; };
     3357                5CFACF5F226E9A1E0056C7D0 /* pkcs7.c in Sources */ = {isa = PBXBuildFile; fileRef = 5CFACF5B226E9A1A0056C7D0 /* pkcs7.c */; };
    33563358                5CFD537C1E4BA4F500482908 /* audio_device_ios.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CFD53751E4BA4F500482908 /* audio_device_ios.h */; };
    33573359                5CFD53801E4BA4F500482908 /* audio_session_observer.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CFD53791E4BA4F500482908 /* audio_session_observer.h */; };
     
    72937295                5CDD90AC1E43D52900621E92 /* cipher.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cipher.c; path = cipher/cipher.c; sourceTree = "<group>"; };
    72947296                5CDD90AD1E43D52900621E92 /* null_cipher.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = null_cipher.c; path = cipher/null_cipher.c; sourceTree = "<group>"; };
     7297                5CFACF5A226E9A1A0056C7D0 /* pkcs7_x509.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pkcs7_x509.c; path = pkcs7/pkcs7_x509.c; sourceTree = "<group>"; };
     7298                5CFACF5B226E9A1A0056C7D0 /* pkcs7.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pkcs7.c; path = pkcs7/pkcs7.c; sourceTree = "<group>"; };
    72957299                5CFD53751E4BA4F500482908 /* audio_device_ios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audio_device_ios.h; sourceTree = "<group>"; };
    72967300                5CFD53761E4BA4F500482908 /* audio_device_ios.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = audio_device_ios.mm; sourceTree = "<group>"; };
     
    1152811532                                5C4B44571E42A645002651C8 /* obj */,
    1152911533                                5C4B44581E42A64B002651C8 /* pem */,
     11534                                5CFACF59226E99F20056C7D0 /* pkcs7 */,
    1153011535                                5C4B445A1E42A65A002651C8 /* pkcs8 */,
    1153111536                                5C4B445B1E42A664002651C8 /* poly1305 */,
     
    1351913524                        );
    1352013525                        name = math;
     13526                        sourceTree = "<group>";
     13527                };
     13528                5CFACF59226E99F20056C7D0 /* pkcs7 */ = {
     13529                        isa = PBXGroup;
     13530                        children = (
     13531                                5CFACF5B226E9A1A0056C7D0 /* pkcs7.c */,
     13532                                5CFACF5A226E9A1A0056C7D0 /* pkcs7_x509.c */,
     13533                        );
     13534                        name = pkcs7;
    1352113535                        sourceTree = "<group>";
    1352213536                };
     
    1600116015                                5C4B473B1E42AAEA002651C8 /* bio.c in Sources */,
    1600216016                                5C4B473A1E42AAEA002651C8 /* bio_mem.c in Sources */,
     16017                                5CFACF35226E96ED0056C7D0 /* bio_ssl.cc in Sources */,
    1600316018                                41A391841EFC447C00C4516A /* blinding.c in Sources */,
    1600416019                                41EA53FE1EFC2D1B002FF04C /* bn.c in Sources */,
     
    1602716042                                41EA54021EFC2D1B002FF04C /* ctx.c in Sources */,
    1602816043                                419C84CB1FE3252E0040C30F /* curve25519.c in Sources */,
     16044                                5CFACF36226E96F20056C7D0 /* d1_both.cc in Sources */,
     16045                                5CFACF37226E96F70056C7D0 /* d1_lib.cc in Sources */,
     16046                                5CFACF38226E96FB0056C7D0 /* d1_pkt.cc in Sources */,
     16047                                5CFACF39226E96FE0056C7D0 /* d1_srtp.cc in Sources */,
    1602916048                                41A391AA1EFC454F00C4516A /* derive_key.c in Sources */,
    1603016049                                41A391E81EFC490400C4516A /* des.c in Sources */,
     
    1603916058                                5C4B47041E42AAB4002651C8 /* dsa.c in Sources */,
    1604016059                                5C4B48471E42C0F6002651C8 /* dsa_asn1.c in Sources */,
     16060                                5CFACF3A226E97050056C7D0 /* dtls_method.cc in Sources */,
     16061                                5CFACF3B226E97080056C7D0 /* dtls_record.cc in Sources */,
    1604116062                                41A392201EFC5CF500C4516A /* e_aes.c in Sources */,
    1604216063                                41A391AB1EFC454F00C4516A /* e_aesctrhmac.c in Sources */,
     
    1605816079                                5C4B46F21E42AAA1002651C8 /* engine.c in Sources */,
    1605916080                                5C4B46F11E42AA9C002651C8 /* err.c in Sources */,
     16081                                5CFACF58226E97CD0056C7D0 /* err_data.c in Sources */,
    1606016082                                5C4B46E61E42AA97002651C8 /* evp.c in Sources */,
    1606116083                                5C4B46E41E42AA97002651C8 /* evp_asn1.c in Sources */,
     
    1607416096                                41A3917A1EFC447C00C4516A /* gcm.c in Sources */,
    1607516097                                41EA54061EFC2D1B002FF04C /* generic.c in Sources */,
     16098                                5CFACF3C226E970C0056C7D0 /* handshake.cc in Sources */,
     16099                                5CFACF3D226E970F0056C7D0 /* handshake_client.cc in Sources */,
     16100                                5CFACF3E226E97120056C7D0 /* handshake_server.cc in Sources */,
    1607616101                                5C4B47401E42AAEA002651C8 /* hexdump.c in Sources */,
    1607716102                                5C4B46E21E42AA92002651C8 /* hkdf.c in Sources */,
     
    1612216147                                5C4B46C71E42AA6B002651C8 /* pem_x509.c in Sources */,
    1612316148                                5C4B46C81E42AA6B002651C8 /* pem_xaux.c in Sources */,
     16149                                5CFACF5F226E9A1E0056C7D0 /* pkcs7.c in Sources */,
     16150                                5CFACF5E226E9A1E0056C7D0 /* pkcs7_x509.c in Sources */,
    1612416151                                5C4B46BF1E42AA66002651C8 /* pkcs8.c in Sources */,
    1612516152                                41A391BE1EFC460D00C4516A /* pkcs8_x509.c in Sources */,
     
    1614116168                                5C4B467A1E42AA3C002651C8 /* rsa_pss.c in Sources */,
    1614216169                                41EA540E1EFC2D1B002FF04C /* rsaz_exp.c in Sources */,
     16170                                5CFACF3F226E97180056C7D0 /* s3_both.cc in Sources */,
     16171                                5CFACF40226E971C0056C7D0 /* s3_lib.cc in Sources */,
     16172                                5CFACF41226E971F0056C7D0 /* s3_pkt.cc in Sources */,
    1614316173                                415449B121CAC3F5001C0A55 /* scalar.c in Sources */,
    1614416174                                41A391731EFC447C00C4516A /* sha1-altivec.c in Sources */,
     
    1615416184                                5C4B4D021E432185002651C8 /* spake25519.c in Sources */,
    1615516185                                41EA54111EFC2D1B002FF04C /* sqrt.c in Sources */,
     16186                                5CFACF43226E97350056C7D0 /* ssl_aead_ctx.cc in Sources */,
     16187                                5CFACF44226E97390056C7D0 /* ssl_asn1.cc in Sources */,
     16188                                5CFACF45226E973C0056C7D0 /* ssl_buffer.cc in Sources */,
     16189                                5CFACF46226E97400056C7D0 /* ssl_cert.cc in Sources */,
     16190                                5CFACF47226E975D0056C7D0 /* ssl_cipher.cc in Sources */,
     16191                                5CFACF48226E97610056C7D0 /* ssl_file.cc in Sources */,
     16192                                5CFACF49226E97650056C7D0 /* ssl_key_share.cc in Sources */,
     16193                                5CFACF33226E96BD0056C7D0 /* ssl_lib.cc in Sources */,
     16194                                5CFACF4A226E976B0056C7D0 /* ssl_privkey.cc in Sources */,
     16195                                5CFACF34226E96E60056C7D0 /* ssl_session.cc in Sources */,
     16196                                5CFACF4B226E97710056C7D0 /* ssl_stat.cc in Sources */,
     16197                                5CFACF4D226E97780056C7D0 /* ssl_transcript.cc in Sources */,
     16198                                5CFACF4E226E977D0056C7D0 /* ssl_versions.cc in Sources */,
     16199                                5CFACF4F226E977F0056C7D0 /* ssl_x509.cc in Sources */,
    1615616200                                5C4B46A51E42AA42002651C8 /* stack.c in Sources */,
     16201                                5CFACF50226E97830056C7D0 /* t1_enc.cc in Sources */,
     16202                                5CFACF51226E97860056C7D0 /* t1_lib.cc in Sources */,
    1615716203                                5C4B467B1E42AA3C002651C8 /* t_crl.c in Sources */,
    1615816204                                5C4B467C1E42AA3C002651C8 /* t_req.c in Sources */,
     
    1617016216                                5C4B46461E42AA2C002651C8 /* thread_win.c in Sources */,
    1617116217                                41A392031EFC495B00C4516A /* time_support.c in Sources */,
     16218                                5CFACF52226E978A0056C7D0 /* tls13_both.cc in Sources */,
     16219                                5CFACF53226E978D0056C7D0 /* tls13_client.cc in Sources */,
     16220                                5CFACF54226E97910056C7D0 /* tls13_enc.cc in Sources */,
     16221                                5CFACF55226E97950056C7D0 /* tls13_server.cc in Sources */,
    1617216222                                41A391B41EFC454F00C4516A /* tls_cbc.c in Sources */,
     16223                                5CFACF56226E97980056C7D0 /* tls_method.cc in Sources */,
     16224                                5CFACF57226E979C0056C7D0 /* tls_record.cc in Sources */,
    1617316225                                415449A221CAC34D001C0A55 /* unicode.c in Sources */,
    1617416226                                41A391831EFC447C00C4516A /* urandom.c in Sources */,
     
    1637616428                                419241C92127593F00634FCF /* bbr_factory.cc in Sources */,
    1637716429                                419241C72127593F00634FCF /* bbr_network_controller.cc in Sources */,
    16378                                 419C846F1FE255FA0040C30F /* bio_ssl.cc in Sources */,
    1637916430                                416D3BE0212731C200775F09 /* biquad_filter.cc in Sources */,
    1638016431                                413A233B1FE18E0700373E99 /* bitbuffer.cc in Sources */,
     
    1646516516                                41FCBB3121B1F8B700A5DF27 /* cryptooptions.cc in Sources */,
    1646616517                                413A23221FE18E0700373E99 /* cryptstring.cc in Sources */,
    16467                                 419C848C1FE2574D0040C30F /* d1_both.cc in Sources */,
    16468                                 419C848D1FE2574D0040C30F /* d1_lib.cc in Sources */,
    16469                                 419C848F1FE2574D0040C30F /* d1_pkt.cc in Sources */,
    16470                                 419C84871FE2574D0040C30F /* d1_srtp.cc in Sources */,
    1647116518                                419241E121275A3000634FCF /* data_rate.cc in Sources */,
    1647216519                                41E02CC02127356A00C27CD6 /* data_rate_limiter.cc in Sources */,
     
    1650716554                                4145E4D61EF8CC7600FCF6E6 /* downsampled_render_buffer.cc in Sources */,
    1650816555                                5CDD8A231E43BFB300621E92 /* dsp_helper.cc in Sources */,
    16509                                 419C84881FE2574D0040C30F /* dtls_method.cc in Sources */,
    16510                                 419C848A1FE2574D0040C30F /* dtls_record.cc in Sources */,
    1651116556                                419C82E41FE20E590040C30F /* dtlssrtptransport.cc in Sources */,
    1651216557                                419C83E11FE247F20040C30F /* dtlstransport.cc in Sources */,
     
    1654516590                                5CD285C21E6A63430094FDC8 /* erl_estimator.cc in Sources */,
    1654616591                                5CD285C41E6A63430094FDC8 /* erle_estimator.cc in Sources */,
    16547                                 419C84921FE2591F0040C30F /* err_data.c in Sources */,
    1654816592                                5C4B4CD21E4320A9002651C8 /* event.cc in Sources */,
    1654916593                                413A23B71FE18E0800373E99 /* event.cc in Sources */,
     
    1663916683                                5CD285EA1E6A639F0094FDC8 /* h264_sprop_parameter_sets.cc in Sources */,
    1664016684                                5CDD83D91E439A6F00621E92 /* h264_sps_pps_tracker.cc in Sources */,
    16641                                 419C84691FE255FA0040C30F /* handshake.cc in Sources */,
    16642                                 419C84891FE2574D0040C30F /* handshake_client.cc in Sources */,
    16643                                 419C848B1FE2574D0040C30F /* handshake_server.cc in Sources */,
    1664416685                                41FCBB7121B1FF7400A5DF27 /* hdr_metadata.cc in Sources */,
    1664516686                                413A236E1FE18E0700373E99 /* helpers.cc in Sources */,
     
    1705317094                                419241642127385B00634FCF /* rw_lock_posix.cc in Sources */,
    1705417095                                419241612127385B00634FCF /* rw_lock_wrapper.cc in Sources */,
    17055                                 419C84701FE255FA0040C30F /* s3_both.cc in Sources */,
    17056                                 419C84771FE255FA0040C30F /* s3_lib.cc in Sources */,
    17057                                 419C84731FE255FA0040C30F /* s3_pkt.cc in Sources */,
    1705817096                                41E02CD42127360700C27CD6 /* sample_counter.cc in Sources */,
    1705917097                                416D3BE9212731C200775F09 /* saturation_protector.cc in Sources */,
     
    1712117159                                5CDD86721E43B8B500621E92 /* sqrt_of_one_minus_x_squared.c in Sources */,
    1712217160                                419C82DF1FE20E590040C30F /* srtptransport.cc in Sources */,
    17123                                 419C845E1FE255FA0040C30F /* ssl_aead_ctx.cc in Sources */,
    17124                                 419C84741FE255FA0040C30F /* ssl_asn1.cc in Sources */,
    17125                                 419C84601FE255FA0040C30F /* ssl_buffer.cc in Sources */,
    17126                                 419C84751FE255FA0040C30F /* ssl_cert.cc in Sources */,
    17127                                 419C84651FE255FA0040C30F /* ssl_cipher.cc in Sources */,
    17128                                 419C84721FE255FA0040C30F /* ssl_file.cc in Sources */,
    17129                                 419C84781FE255FA0040C30F /* ssl_key_share.cc in Sources */,
    17130                                 419C84761FE255FA0040C30F /* ssl_lib.cc in Sources */,
    17131                                 419C846C1FE255FA0040C30F /* ssl_privkey.cc in Sources */,
    17132                                 419C845F1FE255FA0040C30F /* ssl_session.cc in Sources */,
    17133                                 419C84611FE255FA0040C30F /* ssl_stat.cc in Sources */,
    17134                                 419C84621FE255FA0040C30F /* ssl_transcript.cc in Sources */,
    17135                                 419C846E1FE255FA0040C30F /* ssl_versions.cc in Sources */,
    17136                                 419C84641FE255FA0040C30F /* ssl_x509.cc in Sources */,
    1713717161                                419C843E1FE250490040C30F /* ssladapter.cc in Sources */,
    1713817162                                41E02CBE2127356A00C27CD6 /* sslcertificate.cc in Sources */,
     
    1716717191                                5CDD8A541E43BFB300621E92 /* sync_buffer.cc in Sources */,
    1716817192                                5CD284BE1E6A5F9F0094FDC8 /* syncable.cc in Sources */,
    17169                                 419C846D1FE255FA0040C30F /* t1_enc.cc in Sources */,
    17170                                 419C84791FE255FA0040C30F /* t1_lib.cc in Sources */,
    1717117193                                5CDD89781E43BF3A00621E92 /* target_bitrate.cc in Sources */,
    1717217194                                413A23DE1FE18E0800373E99 /* task_queue_gcd.cc in Sources */,
     
    1719017212                                413A23C31FE18E0800373E99 /* timeutils.cc in Sources */,
    1719117213                                5CDD83FF1E439A6F00621E92 /* timing.cc in Sources */,
    17192                                 419C84681FE255FA0040C30F /* tls13_both.cc in Sources */,
    17193                                 419C84671FE255FA0040C30F /* tls13_client.cc in Sources */,
    17194                                 419C84631FE255FA0040C30F /* tls13_enc.cc in Sources */,
    17195                                 419C845D1FE255FA0040C30F /* tls13_server.cc in Sources */,
    17196                                 419C846B1FE255FA0040C30F /* tls_method.cc in Sources */,
    17197                                 419C84661FE255FA0040C30F /* tls_record.cc in Sources */,
    1719817214                                5CDD897A1E43BF3A00621E92 /* tmmb_item.cc in Sources */,
    1719917215                                5CDD897D1E43BF3A00621E92 /* tmmbn.cc in Sources */,
  • trunk/Tools/ChangeLog

    r244567 r244568  
     12019-04-23  Alex Christensen  <achristensen@webkit.org>
     2
     3        Add unit tests for WKWebView.serverTrust
     4        https://bugs.webkit.org/show_bug.cgi?id=197202
     5
     6        Reviewed by Youenn Fablet
     7
     8        * TestWebKitAPI/TCPServer.cpp:
     9        (TestWebKitAPI::deleter<BIO>::operator()):
     10        (TestWebKitAPI::deleter<SSL>::operator()):
     11        (TestWebKitAPI::deleter<X509>::operator()):
     12        (TestWebKitAPI::deleter<SSL_CTX>::operator()):
     13        (TestWebKitAPI::deleter<EVP_PKEY>::operator()):
     14        (TestWebKitAPI::TCPServer::TCPServer):
     15        (TestWebKitAPI::TCPServer::listenForConnections):
     16        * TestWebKitAPI/TCPServer.h:
     17        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     18        * TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
     19        (TestWebKitAPI::TEST):
     20        (verifyCertificateAndPublicKey):
     21        (-[ServerTrustDelegate webView:didFinishNavigation:]):
     22        (-[ServerTrustDelegate webView:didReceiveAuthenticationChallenge:completionHandler:]):
     23        * TestWebKitAPI/Tests/WebKitCocoa/Download.mm:
     24        (TestWebKitAPI::downloadAtRate):
     25        * TestWebKitAPI/Tests/WebKitCocoa/PDFLinkReferrer.mm:
     26        (TEST):
     27        * TestWebKitAPI/Tests/WebKitCocoa/WKNavigationResponse.mm:
     28        (TEST):
     29
    1302019-04-23  Commit Queue  <commit-queue@webkit.org>
    231
  • trunk/Tools/TestWebKitAPI/TCPServer.cpp

    r244521 r244568  
    3232#include <wtf/Optional.h>
    3333
     34extern "C" {
     35
     36struct BIO;
     37struct X509;
     38struct SSL_CTX;
     39struct EVP_PKEY;
     40struct SSL_METHOD;
     41struct pem_password_cb;
     42int BIO_free(BIO*);
     43int SSL_free(SSL*);
     44int X509_free(X509*);
     45int SSL_CTX_free(SSL_CTX*);
     46int EVP_PKEY_free(EVP_PKEY*);
     47int SSL_library_init();
     48const SSL_METHOD* SSLv23_server_method();
     49BIO* BIO_new_mem_buf(const void*, int);
     50X509* PEM_read_bio_X509(BIO*, X509**, pem_password_cb*, void*);
     51EVP_PKEY* PEM_read_bio_PrivateKey(BIO*, EVP_PKEY**, pem_password_cb*, void*);
     52SSL_CTX* SSL_CTX_new(const SSL_METHOD*);
     53const SSL_METHOD* SSLv23_server_method();
     54int SSL_CTX_use_certificate(SSL_CTX*, X509*);
     55int SSL_CTX_use_PrivateKey(SSL_CTX*, EVP_PKEY*);
     56SSL* SSL_new(SSL_CTX*);
     57int SSL_accept(SSL*);
     58int SSL_set_fd(SSL*, int);
     59
     60} // extern "C"
     61
    3462namespace TestWebKitAPI {
     63
     64template<typename> struct deleter;
     65template<> struct deleter<BIO> {
     66    void operator()(BIO* bio)
     67    {
     68        BIO_free(bio);
     69    }
     70};
     71template<> struct deleter<SSL> {
     72    void operator()(SSL* ssl)
     73    {
     74        SSL_free(ssl);
     75    }
     76};
     77template<> struct deleter<X509> {
     78    void operator()(X509* x509)
     79    {
     80        X509_free(x509);
     81    }
     82};
     83template<> struct deleter<SSL_CTX> {
     84    void operator()(SSL_CTX* ctx)
     85    {
     86        SSL_CTX_free(ctx);
     87    }
     88};
     89template<> struct deleter<EVP_PKEY> {
     90    void operator()(EVP_PKEY* key)
     91    {
     92        EVP_PKEY_free(key);
     93    }
     94};
    3595
    3696TCPServer::TCPServer(Function<void(Socket)>&& connectionHandler, size_t connections)
    3797    : m_connectionHandler(WTFMove(connectionHandler))
     98{
     99    listenForConnections(connections);
     100}
     101
     102TCPServer::TCPServer(Function<void(SSL*)>&& secureConnectionHandler)
     103    : m_connectionHandler([secureConnectionHandler = WTFMove(secureConnectionHandler)] (Socket socket) {
     104
     105        SSL_library_init();
     106
     107        std::unique_ptr<SSL_CTX, deleter<SSL_CTX>> ctx(SSL_CTX_new(SSLv23_server_method()));
     108
     109        // This is a test certificate from BoringSSL.
     110        char kCertPEM[] =
     111        "-----BEGIN CERTIFICATE-----\n"
     112        "MIICWDCCAcGgAwIBAgIJAPuwTC6rEJsMMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\n"
     113        "BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\n"
     114        "aWRnaXRzIFB0eSBMdGQwHhcNMTQwNDIzMjA1MDQwWhcNMTcwNDIyMjA1MDQwWjBF\n"
     115        "MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50\n"
     116        "ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n"
     117        "gQDYK8imMuRi/03z0K1Zi0WnvfFHvwlYeyK9Na6XJYaUoIDAtB92kWdGMdAQhLci\n"
     118        "HnAjkXLI6W15OoV3gA/ElRZ1xUpxTMhjP6PyY5wqT5r6y8FxbiiFKKAnHmUcrgfV\n"
     119        "W28tQ+0rkLGMryRtrukXOgXBv7gcrmU7G1jC2a7WqmeI8QIDAQABo1AwTjAdBgNV\n"
     120        "HQ4EFgQUi3XVrMsIvg4fZbf6Vr5sp3Xaha8wHwYDVR0jBBgwFoAUi3XVrMsIvg4f\n"
     121        "Zbf6Vr5sp3Xaha8wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQA76Hht\n"
     122        "ldY9avcTGSwbwoiuIqv0jTL1fHFnzy3RHMLDh+Lpvolc5DSrSJHCP5WuK0eeJXhr\n"
     123        "T5oQpHL9z/cCDLAKCKRa4uV0fhEdOWBqyR9p8y5jJtye72t6CuFUV5iqcpF4BH4f\n"
     124        "j2VNHwsSrJwkD4QUGlUtH7vwnQmyCFxZMmWAJg==\n"
     125        "-----END CERTIFICATE-----\n";
     126
     127        std::unique_ptr<BIO, deleter<BIO>> certBIO(BIO_new_mem_buf(kCertPEM, strlen(kCertPEM)));
     128        std::unique_ptr<X509, deleter<X509>> certX509(PEM_read_bio_X509(certBIO.get(), nullptr, nullptr, nullptr));
     129        ASSERT(certX509);
     130        SSL_CTX_use_certificate(ctx.get(), certX509.get());
     131
     132        // This is a test key from BoringSSL.
     133        char kKeyPEM[] =
     134        "-----BEGIN RSA PRIVATE KEY-----\n"
     135        "MIICXgIBAAKBgQDYK8imMuRi/03z0K1Zi0WnvfFHvwlYeyK9Na6XJYaUoIDAtB92\n"
     136        "kWdGMdAQhLciHnAjkXLI6W15OoV3gA/ElRZ1xUpxTMhjP6PyY5wqT5r6y8FxbiiF\n"
     137        "KKAnHmUcrgfVW28tQ+0rkLGMryRtrukXOgXBv7gcrmU7G1jC2a7WqmeI8QIDAQAB\n"
     138        "AoGBAIBy09Fd4DOq/Ijp8HeKuCMKTHqTW1xGHshLQ6jwVV2vWZIn9aIgmDsvkjCe\n"
     139        "i6ssZvnbjVcwzSoByhjN8ZCf/i15HECWDFFh6gt0P5z0MnChwzZmvatV/FXCT0j+\n"
     140        "WmGNB/gkehKjGXLLcjTb6dRYVJSCZhVuOLLcbWIV10gggJQBAkEA8S8sGe4ezyyZ\n"
     141        "m4e9r95g6s43kPqtj5rewTsUxt+2n4eVodD+ZUlCULWVNAFLkYRTBCASlSrm9Xhj\n"
     142        "QpmWAHJUkQJBAOVzQdFUaewLtdOJoPCtpYoY1zd22eae8TQEmpGOR11L6kbxLQsk\n"
     143        "aMly/DOnOaa82tqAGTdqDEZgSNmCeKKknmECQAvpnY8GUOVAubGR6c+W90iBuQLj\n"
     144        "LtFp/9ihd2w/PoDwrHZaoUYVcT4VSfJQog/k7kjE4MYXYWL8eEKg3WTWQNECQQDk\n"
     145        "104Wi91Umd1PzF0ijd2jXOERJU1wEKe6XLkYYNHWQAe5l4J4MWj9OdxFXAxIuuR/\n"
     146        "tfDwbqkta4xcux67//khAkEAvvRXLHTaa6VFzTaiiO8SaFsHV3lQyXOtMrBpB5jd\n"
     147        "moZWgjHvB2W9Ckn7sDqsPB+U2tyX0joDdQEyuiMECDY8oQ==\n"
     148        "-----END RSA PRIVATE KEY-----\n";
     149
     150        std::unique_ptr<BIO, deleter<BIO>> privateKeyBIO(BIO_new_mem_buf(kKeyPEM, strlen(kKeyPEM)));
     151        std::unique_ptr<EVP_PKEY, deleter<EVP_PKEY>> privateKey(PEM_read_bio_PrivateKey(privateKeyBIO.get(), nullptr, nullptr, nullptr));
     152        ASSERT(privateKey);
     153        SSL_CTX_use_PrivateKey(ctx.get(), privateKey.get());
     154
     155        std::unique_ptr<SSL, deleter<SSL>> ssl(SSL_new(ctx.get()));
     156        ASSERT(ssl);
     157        SSL_set_fd(ssl.get(), socket);
     158
     159        auto acceptResult = SSL_accept(ssl.get());
     160        ASSERT_UNUSED(acceptResult, acceptResult > 0);
     161       
     162        secureConnectionHandler(ssl.get());
     163    })
     164{
     165    listenForConnections(1);
     166}
     167
     168void TCPServer::listenForConnections(size_t connections)
    38169{
    39170    auto listeningSocket = socketBindListen(connections);
  • trunk/Tools/TestWebKitAPI/TCPServer.h

    r244521 r244568  
    3030#include <wtf/Vector.h>
    3131
     32extern "C" {
     33struct SSL;
     34int SSL_read(SSL*, void*, int);
     35int SSL_write(SSL*, const void*, int);
     36}
     37
    3238namespace TestWebKitAPI {
    3339
     
    3844    static constexpr Port InvalidPort = 0;
    3945   
    40     TCPServer(Function<void(Socket)>&&, size_t connections = 1);
     46    TCPServer(Function<void(Socket)>&&, size_t connections);
     47    TCPServer(Function<void(SSL*)>&&);
    4148    ~TCPServer();
    4249   
     
    4552private:
    4653    Optional<Socket> socketBindListen(size_t connections);
     54    void listenForConnections(size_t connections);
    4755
    4856    Port m_port { InvalidPort };
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r244567 r244568  
    347347                5CEAB5E11FA939F400A77FAA /* _WKInputDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CEAB5DF1FA937CB00A77FAA /* _WKInputDelegate.mm */; };
    348348                5CF540E92257E67C00E6BC0E /* DownloadThread.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CF540E82257E64B00E6BC0E /* DownloadThread.mm */; };
     349                5CFACF63226F73C60056C7D0 /* libboringssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CFACF62226F73C60056C7D0 /* libboringssl.a */; };
    349350                5E4B1D2E1D404C6100053621 /* WKScrollViewDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E4B1D2C1D404C6100053621 /* WKScrollViewDelegate.mm */; };
    350351                631EFFF61E7B5E8D00D2EBB8 /* Geolocation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 631EFFF51E7B5E8D00D2EBB8 /* Geolocation.mm */; };
     
    17631764                5CEAB5DF1FA937CB00A77FAA /* _WKInputDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKInputDelegate.mm; sourceTree = "<group>"; };
    17641765                5CF540E82257E64B00E6BC0E /* DownloadThread.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DownloadThread.mm; sourceTree = "<group>"; };
     1766                5CFACF62226F73C60056C7D0 /* libboringssl.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libboringssl.a; sourceTree = BUILT_PRODUCTS_DIR; };
    17651767                5E4B1D2C1D404C6100053621 /* WKScrollViewDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKScrollViewDelegate.mm; path = ../ios/WKScrollViewDelegate.mm; sourceTree = "<group>"; };
    17661768                631EFFF51E7B5E8D00D2EBB8 /* Geolocation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Geolocation.mm; sourceTree = "<group>"; };
     
    23892391                                634910E01E9D3FF300880309 /* CoreLocation.framework in Frameworks */,
    23902392                                CDA3159D1ED5643F009F60D3 /* IOKit.framework in Frameworks */,
     2393                                5CFACF63226F73C60056C7D0 /* libboringssl.a in Frameworks */,
    23912394                                7C83E03F1D0A61A000FEBCF3 /* libicucore.dylib in Frameworks */,
    23922395                                578CBD67204FB2C80083B9F2 /* LocalAuthentication.framework in Frameworks */,
     
    28462849                                0F4FFAA01ED3D0DE00F7111F /* ImageIO.framework */,
    28472850                                CDA3159C1ED5643F009F60D3 /* IOKit.framework */,
     2851                                5CFACF62226F73C60056C7D0 /* libboringssl.a */,
    28482852                                7C83E0331D0A5F2700FEBCF3 /* libicucore.dylib */,
    28492853                                A1798B7E22431D2B000764BD /* libWebCoreTestSupport.dylib */,
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm

    r244521 r244568  
    239239TEST(Challenge, SecIdentity)
    240240{
    241     TCPServer server(respondWithChallengeThenOK);
     241    TCPServer server(respondWithChallengeThenOK, 1);
    242242
    243243    auto webView = adoptNS([WKWebView new]);
     
    309309    Util::run(&removedCredential);
    310310}
     311
     312static void verifyCertificateAndPublicKey(SecTrustRef trust)
     313{
     314    EXPECT_NOT_NULL(trust);
     315
     316    auto compareData = [] (const RetainPtr<CFDataRef>& data, const Vector<uint8_t>& expected) {
     317        size_t length = CFDataGetLength(data.get());
     318        EXPECT_EQ(length, expected.size());
     319        const UInt8* bytes = CFDataGetBytePtr(data.get());
     320        for (size_t i = 0; i < length; ++i)
     321            EXPECT_EQ(expected[i], bytes[i]);
     322    };
     323
     324    auto publicKey = adoptCF(SecKeyCopyExternalRepresentation(adoptCF(SecTrustCopyPublicKey(trust)).get(), nullptr));
     325    compareData(publicKey, {
     326        0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xd8, 0x2b, 0xc8, 0xa6, 0x32, 0xe4, 0x62, 0xff, 0x4d,
     327        0xf3, 0xd0, 0xad, 0x59, 0x8b, 0x45, 0xa7, 0xbd, 0xf1, 0x47, 0xbf, 0x09, 0x58, 0x7b, 0x22, 0xbd,
     328        0x35, 0xae, 0x97, 0x25, 0x86, 0x94, 0xa0, 0x80, 0xc0, 0xb4, 0x1f, 0x76, 0x91, 0x67, 0x46, 0x31,
     329        0xd0, 0x10, 0x84, 0xb7, 0x22, 0x1e, 0x70, 0x23, 0x91, 0x72, 0xc8, 0xe9, 0x6d, 0x79, 0x3a, 0x85,
     330        0x77, 0x80, 0x0f, 0xc4, 0x95, 0x16, 0x75, 0xc5, 0x4a, 0x71, 0x4c, 0xc8, 0x63, 0x3f, 0xa3, 0xf2,
     331        0x63, 0x9c, 0x2a, 0x4f, 0x9a, 0xfa, 0xcb, 0xc1, 0x71, 0x6e, 0x28, 0x85, 0x28, 0xa0, 0x27, 0x1e,
     332        0x65, 0x1c, 0xae, 0x07, 0xd5, 0x5b, 0x6f, 0x2d, 0x43, 0xed, 0x2b, 0x90, 0xb1, 0x8c, 0xaf, 0x24,
     333        0x6d, 0xae, 0xe9, 0x17, 0x3a, 0x05, 0xc1, 0xbf, 0xb8, 0x1c, 0xae, 0x65, 0x3b, 0x1b, 0x58, 0xc2,
     334        0xd9, 0xae, 0xd6, 0xaa, 0x67, 0x88, 0xf1, 0x02, 0x03, 0x01, 0x00, 0x01
     335    });
     336   
     337    EXPECT_EQ(1, SecTrustGetCertificateCount(trust));
     338    auto certificate = adoptCF(SecCertificateCopyData(SecTrustGetCertificateAtIndex(trust, 0)));
     339    compareData(certificate, {
     340        0x30, 0x82, 0x02, 0x58, 0x30, 0x82, 0x01, 0xc1, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x09, 0x00,
     341        0xfb, 0xb0, 0x4c, 0x2e, 0xab, 0x10, 0x9b, 0x0c, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
     342        0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x45, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
     343        0x04, 0x06, 0x13, 0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c,
     344        0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x31, 0x21, 0x30, 0x1f, 0x06,
     345        0x03, 0x55, 0x04, 0x0a, 0x0c, 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57,
     346        0x69, 0x64, 0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x30, 0x1e,
     347        0x17, 0x0d, 0x31, 0x34, 0x30, 0x34, 0x32, 0x33, 0x32, 0x30, 0x35, 0x30, 0x34, 0x30, 0x5a, 0x17,
     348        0x0d, 0x31, 0x37, 0x30, 0x34, 0x32, 0x32, 0x32, 0x30, 0x35, 0x30, 0x34, 0x30, 0x5a, 0x30, 0x45,
     349        0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x41, 0x55, 0x31, 0x13, 0x30,
     350        0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61,
     351        0x74, 0x65, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x18, 0x49, 0x6e, 0x74,
     352        0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74,
     353        0x79, 0x20, 0x4c, 0x74, 0x64, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
     354        0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81,
     355        0x81, 0x00, 0xd8, 0x2b, 0xc8, 0xa6, 0x32, 0xe4, 0x62, 0xff, 0x4d, 0xf3, 0xd0, 0xad, 0x59, 0x8b,
     356        0x45, 0xa7, 0xbd, 0xf1, 0x47, 0xbf, 0x09, 0x58, 0x7b, 0x22, 0xbd, 0x35, 0xae, 0x97, 0x25, 0x86,
     357        0x94, 0xa0, 0x80, 0xc0, 0xb4, 0x1f, 0x76, 0x91, 0x67, 0x46, 0x31, 0xd0, 0x10, 0x84, 0xb7, 0x22,
     358        0x1e, 0x70, 0x23, 0x91, 0x72, 0xc8, 0xe9, 0x6d, 0x79, 0x3a, 0x85, 0x77, 0x80, 0x0f, 0xc4, 0x95,
     359        0x16, 0x75, 0xc5, 0x4a, 0x71, 0x4c, 0xc8, 0x63, 0x3f, 0xa3, 0xf2, 0x63, 0x9c, 0x2a, 0x4f, 0x9a,
     360        0xfa, 0xcb, 0xc1, 0x71, 0x6e, 0x28, 0x85, 0x28, 0xa0, 0x27, 0x1e, 0x65, 0x1c, 0xae, 0x07, 0xd5,
     361        0x5b, 0x6f, 0x2d, 0x43, 0xed, 0x2b, 0x90, 0xb1, 0x8c, 0xaf, 0x24, 0x6d, 0xae, 0xe9, 0x17, 0x3a,
     362        0x05, 0xc1, 0xbf, 0xb8, 0x1c, 0xae, 0x65, 0x3b, 0x1b, 0x58, 0xc2, 0xd9, 0xae, 0xd6, 0xaa, 0x67,
     363        0x88, 0xf1, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x50, 0x30, 0x4e, 0x30, 0x1d, 0x06, 0x03, 0x55,
     364        0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x8b, 0x75, 0xd5, 0xac, 0xcb, 0x08, 0xbe, 0x0e, 0x1f, 0x65,
     365        0xb7, 0xfa, 0x56, 0xbe, 0x6c, 0xa7, 0x75, 0xda, 0x85, 0xaf, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d,
     366        0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x8b, 0x75, 0xd5, 0xac, 0xcb, 0x08, 0xbe, 0x0e, 0x1f,
     367        0x65, 0xb7, 0xfa, 0x56, 0xbe, 0x6c, 0xa7, 0x75, 0xda, 0x85, 0xaf, 0x30, 0x0c, 0x06, 0x03, 0x55,
     368        0x1d, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48,
     369        0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x3b, 0xe8, 0x78, 0x6d,
     370        0x95, 0xd6, 0x3d, 0x6a, 0xf7, 0x13, 0x19, 0x2c, 0x1b, 0xc2, 0x88, 0xae, 0x22, 0xab, 0xf4, 0x8d,
     371        0x32, 0xf5, 0x7c, 0x71, 0x67, 0xcf, 0x2d, 0xd1, 0x1c, 0xc2, 0xc3, 0x87, 0xe2, 0xe9, 0xbe, 0x89,
     372        0x5c, 0xe4, 0x34, 0xab, 0x48, 0x91, 0xc2, 0x3f, 0x95, 0xae, 0x2b, 0x47, 0x9e, 0x25, 0x78, 0x6b,
     373        0x4f, 0x9a, 0x10, 0xa4, 0x72, 0xfd, 0xcf, 0xf7, 0x02, 0x0c, 0xb0, 0x0a, 0x08, 0xa4, 0x5a, 0xe2,
     374        0xe5, 0x74, 0x7e, 0x11, 0x1d, 0x39, 0x60, 0x6a, 0xc9, 0x1f, 0x69, 0xf3, 0x2e, 0x63, 0x26, 0xdc,
     375        0x9e, 0xef, 0x6b, 0x7a, 0x0a, 0xe1, 0x54, 0x57, 0x98, 0xaa, 0x72, 0x91, 0x78, 0x04, 0x7e, 0x1f,
     376        0x8f, 0x65, 0x4d, 0x1f, 0x0b, 0x12, 0xac, 0x9c, 0x24, 0x0f, 0x84, 0x14, 0x1a, 0x55, 0x2d, 0x1f,
     377        0xbb, 0xf0, 0x9d, 0x09, 0xb2, 0x08, 0x5c, 0x59, 0x32, 0x65, 0x80, 0x26
     378    });
     379}
     380
     381@interface ServerTrustDelegate : NSObject <WKNavigationDelegate>
     382@end
     383
     384@implementation ServerTrustDelegate
     385
     386- (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation
     387{
     388    navigationFinished = true;
     389}
     390
     391- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler
     392{
     393    SecTrustRef trust = challenge.protectionSpace.serverTrust;
     394    verifyCertificateAndPublicKey(trust);
     395    completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:trust]);
     396}
     397
     398@end
     399
     400namespace TestWebKitAPI {
     401
     402TEST(WebKit, ServerTrust)
     403{
     404    TCPServer server([] (SSL* ssl) {
     405        char requestBuffer[1000];
     406        auto readResult = SSL_read(ssl, requestBuffer, sizeof(requestBuffer));
     407        ASSERT_UNUSED(readResult, readResult > 0);
     408
     409        const char* reply = ""
     410        "HTTP/1.1 200 OK\r\n"
     411        "Content-Length: 13\r\n\r\n"
     412        "Hello, World!";
     413        auto writeResult = SSL_write(ssl, reply, strlen(reply));
     414        ASSERT_UNUSED(writeResult, writeResult == static_cast<int>(strlen(reply)));
     415    });
     416
     417    auto webView = adoptNS([WKWebView new]);
     418    auto delegate = adoptNS([ServerTrustDelegate new]);
     419    [webView setNavigationDelegate:delegate.get()];
     420
     421    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://localhost:%d/", server.port()]]]];
     422    TestWebKitAPI::Util::run(&navigationFinished);
     423
     424    verifyCertificateAndPublicKey([webView serverTrust]);
     425}
     426
     427} // namespace TestWebKitAPI
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Download.mm

    r243131 r244568  
    862862{
    863863    bool terminateServer = false;
    864     TCPServer server([&](auto socket) {
     864    TCPServer server([&](int socket) {
    865865        respondSlowly(socket, desiredKbps, terminateServer);
    866     });
     866    }, 1);
    867867   
    868868    auto webView = webViewWithDownloadMonitorSpeedMultiplier(speedMultiplier);
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PDFLinkReferrer.mm

    r244405 r244568  
    7373TEST(WebKit, PDFLinkReferrer)
    7474{
    75     TestWebKitAPI::TCPServer server([] (auto socket) {
     75    TestWebKitAPI::TCPServer server([] (int socket) {
    7676        char readBuffer[1000];
    7777        memset(readBuffer, 0, 1000);
     
    9393        "Content-Length: 0\r\n\r\n";
    9494        ::write(socket, responseHeader, strlen(responseHeader));
    95     });
     95    }, 1);
    9696
    9797    RetainPtr<TestWKWebView> webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKNavigationResponse.mm

    r244184 r244568  
    231231                "Hello!"
    232232            );
    233         });
     233        }, 1);
    234234        auto delegate = adoptNS([NavigationResponseTestDelegate new]);
    235235        auto webView = adoptNS([WKWebView new]);
Note: See TracChangeset for help on using the changeset viewer.