[Curl] Fix r222147
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Sep 2017 04:25:52 +0000 (04:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Sep 2017 04:25:52 +0000 (04:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177128

Patch by Daewoong Jang <daewoong.jang@naverlabs.com> on 2017-09-19
Reviewed by Alex Christensen.

* platform/network/curl/CurlSSLHandle.h:
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::certVerifyCallback):
* platform/network/curl/CurlSSLVerifier.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@222248 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/network/curl/CurlSSLHandle.h
Source/WebCore/platform/network/curl/CurlSSLVerifier.cpp
Source/WebCore/platform/network/curl/CurlSSLVerifier.h

index 0aba38b..59ff913 100644 (file)
@@ -1,3 +1,15 @@
+2017-09-19  Daewoong Jang  <daewoong.jang@naverlabs.com>
+
+        [Curl] Fix r222147
+        https://bugs.webkit.org/show_bug.cgi?id=177128
+
+        Reviewed by Alex Christensen.
+
+        * platform/network/curl/CurlSSLHandle.h:
+        * platform/network/curl/CurlSSLVerifier.cpp:
+        (WebCore::CurlSSLVerifier::certVerifyCallback):
+        * platform/network/curl/CurlSSLVerifier.h:
+
 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
 
         Image subclasses should support is<> and downcast<>
index 3a37651..6b3bf8d 100644 (file)
 
 #pragma once
 
-#if OS(WINDOWS)
-#include <winsock2.h>
-#endif
-
 #include <wtf/HashMap.h>
 #include <wtf/ListHashSet.h>
 #include <wtf/Noncopyable.h>
index f0a1d20..d38c920 100644 (file)
@@ -53,12 +53,12 @@ int CurlSSLVerifier::certVerifyCallback(int ok, X509_STORE_CTX* storeCtx)
     SSL* ssl = static_cast<SSL*>(X509_STORE_CTX_get_ex_data(storeCtx, SSL_get_ex_data_X509_STORE_CTX_idx()));
     SSL_CTX* sslCtx = SSL_get_SSL_CTX(ssl);
     CurlSSLVerifier* verifier = static_cast<CurlSSLVerifier*>(SSL_CTX_get_app_data(sslCtx));
-    if (verifier)
+    if (!verifier)
         return 0;
 
     verifier->m_sslErrors = static_cast<int>(verifier->convertToSSLCertificateFlags(certErrCd));
 
-#if OS(WINDOWS)
+#if PLATFORM(WIN)
     ok = CurlContext::singleton().sslHandle().isAllowedHTTPSCertificateHost(verifier->m_hostName);
 #else
     ListHashSet<String> certificates;
@@ -78,7 +78,7 @@ int CurlSSLVerifier::certVerifyCallback(int ok, X509_STORE_CTX* storeCtx)
     return ok;
 }
 
-#if !OS(WINDOWS)
+#if !PLATFORM(WIN)
 
 bool CurlSSLVerifier::getPemDataFromCtx(X509_STORE_CTX* ctx, ListHashSet<String>& certificates)
 {
index 58e2d2d..054b1b9 100644 (file)
 
 #pragma once
 
-#if OS(WINDOWS)
-#include <winsock2.h>
-#endif
-
+#include <wtf/ListHashSet.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/text/WTFString.h>
 
@@ -41,8 +38,7 @@ namespace WebCore {
 class CurlHandle;
 
 class CurlSSLVerifier {
-WTF_MAKE_NONCOPYABLE(CurlSSLVerifier);
-
+    WTF_MAKE_NONCOPYABLE(CurlSSLVerifier);
 public:
     enum class SSLCertificateFlags {
         SSL_CERTIFICATE_UNKNOWN_CA = (1 << 0), // The signing certificate authority is not known.
@@ -65,8 +61,8 @@ public:
 private:
     static int certVerifyCallback(int, X509_STORE_CTX*);
 
-#if !OS(WINDOWS)
-    bool getPemDataFromCtx(X509_STORE_CTX*, ListHashSet<String>&);
+#if !PLATFORM(WIN)
+    static bool getPemDataFromCtx(X509_STORE_CTX*, ListHashSet<String>&);
 #endif
 
     SSLCertificateFlags convertToSSLCertificateFlags(const unsigned&);