Title: [242539] releases/WebKitGTK/webkit-2.24/Source/WebCore
Revision
242539
Author
[email protected]
Date
2019-03-06 05:30:12 -0800 (Wed, 06 Mar 2019)

Log Message

Merge r242328 - [SOUP] Cleanups in SoupNetworkSession
https://bugs.webkit.org/show_bug.cgi?id=195247

Reviewed by Daniel Bates.

This renames clientCertificates to allowedCertificates, since they are not client
certificates at all, but server certificates. It also adds a using statement to avoid
repeating the long type of the map, and avoids an unnecessary copy.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::allowedCertificates):
(WebCore::SoupNetworkSession::checkTLSErrors):
(WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
(WebCore::clientCertificates): Deleted.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog (242538 => 242539)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-03-06 13:30:09 UTC (rev 242538)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-03-06 13:30:12 UTC (rev 242539)
@@ -1,5 +1,22 @@
 2019-03-03  Michael Catanzaro  <[email protected]>
 
+        [SOUP] Cleanups in SoupNetworkSession
+        https://bugs.webkit.org/show_bug.cgi?id=195247
+
+        Reviewed by Daniel Bates.
+
+        This renames clientCertificates to allowedCertificates, since they are not client
+        certificates at all, but server certificates. It also adds a using statement to avoid
+        repeating the long type of the map, and avoids an unnecessary copy.
+
+        * platform/network/soup/SoupNetworkSession.cpp:
+        (WebCore::allowedCertificates):
+        (WebCore::SoupNetworkSession::checkTLSErrors):
+        (WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
+        (WebCore::clientCertificates): Deleted.
+
+2019-03-03  Michael Catanzaro  <[email protected]>
+
         -Wformat error in SharedBuffer::tryCreateArrayBuffer
         https://bugs.webkit.org/show_bug.cgi?id=195004
 

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp (242538 => 242539)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp	2019-03-06 13:30:09 UTC (rev 242538)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp	2019-03-06 13:30:12 UTC (rev 242539)
@@ -98,9 +98,11 @@
     HashSet<String> m_certificates;
 };
 
-static HashMap<String, HostTLSCertificateSet, ASCIICaseInsensitiveHash>& clientCertificates()
+using AllowedCertificatesMap = HashMap<String, HostTLSCertificateSet, ASCIICaseInsensitiveHash>;
+
+static AllowedCertificatesMap& allowedCertificates()
 {
-    static NeverDestroyed<HashMap<String, HostTLSCertificateSet, ASCIICaseInsensitiveHash>> certificates;
+    static NeverDestroyed<AllowedCertificatesMap> certificates;
     return certificates;
 }
 
@@ -284,8 +286,8 @@
     if (!tlsErrors)
         return WTF::nullopt;
 
-    auto it = clientCertificates().find(requestURL.host().toString());
-    if (it != clientCertificates().end() && it->value.contains(certificate))
+    auto it = allowedCertificates().find(requestURL.host().toStringWithoutCopying());
+    if (it != allowedCertificates().end() && it->value.contains(certificate))
         return WTF::nullopt;
 
     return ResourceError::tlsError(requestURL, tlsErrors, certificate);
@@ -293,7 +295,7 @@
 
 void SoupNetworkSession::allowSpecificHTTPSCertificateForHost(const CertificateInfo& certificateInfo, const String& host)
 {
-    clientCertificates().add(host, HostTLSCertificateSet()).iterator->value.add(certificateInfo.certificate());
+    allowedCertificates().add(host, HostTLSCertificateSet()).iterator->value.add(certificateInfo.certificate());
 }
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to