[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

weinig at apple.com weinig at apple.com
Wed Dec 22 13:44:09 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit cf65b8037f035473b133f1bf696de293765247b7
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 24 16:10:54 2010 +0000

    Add Windows implementation of PlatformCertificateInfo
    Part of < rdar://problem/8350189>
    https://bugs.webkit.org/show_bug.cgi?id=46450
    
    Reviewed by Adam Roben.
    
    * Shared/win/PlatformCertificateInfo.cpp: Added.
    (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
    (WebKit::PlatformCertificateInfo::~PlatformCertificateInfo):
    (WebKit::PlatformCertificateInfo::encode):
    (WebKit::PlatformCertificateInfo::decode):
    (WebKit::organizationNameForCertificate):
    * Shared/win/PlatformCertificateInfo.h:
    (WebKit::PlatformCertificateInfo::certificateContext):
    * UIProcess/API/C/win/WKCertificateInfoWin.cpp: Added.
    (WKCertificateInfoGetCertificateContext):
    * UIProcess/API/C/win/WKCertificateInfoWin.h: Added.
    * win/WebKit2.vcproj:
    * win/WebKit2Generated.make:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68260 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 3d1b809..6b6a9b3 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,25 @@
+2010-09-23  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Adam Roben.
+
+        Add Windows implementation of PlatformCertificateInfo
+        Part of < rdar://problem/8350189>
+        https://bugs.webkit.org/show_bug.cgi?id=46450
+
+        * Shared/win/PlatformCertificateInfo.cpp: Added.
+        (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
+        (WebKit::PlatformCertificateInfo::~PlatformCertificateInfo):
+        (WebKit::PlatformCertificateInfo::encode):
+        (WebKit::PlatformCertificateInfo::decode):
+        (WebKit::organizationNameForCertificate):
+        * Shared/win/PlatformCertificateInfo.h:
+        (WebKit::PlatformCertificateInfo::certificateContext):
+        * UIProcess/API/C/win/WKCertificateInfoWin.cpp: Added.
+        (WKCertificateInfoGetCertificateContext):
+        * UIProcess/API/C/win/WKCertificateInfoWin.h: Added.
+        * win/WebKit2.vcproj:
+        * win/WebKit2Generated.make:
+
 2010-09-23  Kenneth Rohde Christiansen  <kenneth.christiansen at openbossa.org>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit2/Shared/win/PlatformCertificateInfo.cpp b/WebKit2/Shared/win/PlatformCertificateInfo.cpp
new file mode 100644
index 0000000..6f26655
--- /dev/null
+++ b/WebKit2/Shared/win/PlatformCertificateInfo.cpp
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "PlatformCertificateInfo.h"
+
+#include "ArgumentDecoder.h"
+#include "ArgumentEncoder.h"
+#include <WebCore/ResourceResponse.h>
+#include <WebKitSystemInterface/WebKitSystemInterface.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PlatformCertificateInfo::PlatformCertificateInfo()
+    : m_certificateContext(0)
+{
+}
+
+PlatformCertificateInfo::PlatformCertificateInfo(const ResourceResponse& response)
+    : m_certificateContext(0)
+{
+    CFURLResponseRef cfResponse = response.cfURLResponse();
+    if (!cfResponse)
+        return;
+
+    CFDictionaryRef certificateInfo = wkGetSSLCertificateInfo(cfResponse);
+    if (!certificateInfo)
+        return;
+
+    void* data = wkGetSSLPeerCertificateData(certificateInfo.get());
+    if (!data)
+        return;
+
+    m_certificateContext = ::CertDuplicateCertificateContext(static_cast<PCCERT_CONTEXT>(data));
+}
+
+PlatformCertificateInfo::~PlatformCertificateInfo()
+{
+    if (m_certificateContext)
+        ::CertFreeCertificateContext(m_certificateContext);
+}
+
+void PlatformCertificateInfo::encode(CoreIPC::ArgumentEncoder* encoder) const
+{
+    // FIXME: We should encode the no certificate context case in the
+    // number of the bytes.
+    if (!m_certificateContext) {
+        encoder->encodeBool(true);
+        return;
+    }
+
+    encoder->encodeBool(false);
+    encoder->encodeBytes(static_cast<uint8_t*>(m_certificateContext->pbCertEncoded), m_certificateContext->cbCertEncoded);
+}
+
+bool PlatformCertificateInfo::decode(CoreIPC::ArgumentDecoder* decoder, PlatformCertificateInfo& c)
+{
+    bool noCertificate;
+    if (!decoder->decode(noCertificate))
+        return false;
+
+    if (noCertificate)
+        return true;
+
+    Vector<uint8_t> bytes;
+    if (!decoder->decodeBytes(bytes))
+        return false;
+
+    PCCERT_CONTEXT certificateContext = ::CertCreateCertificateContext(PKCS_7_ASN_ENCODING | X509_ASN_ENCODING, bytes.data(), bytes.size());
+    if (!certificateContext)
+        return false;
+
+    c.m_certificateContext = certificateContext;
+    return true;
+}
+
+} // namespace WebKit
diff --git a/WebKit2/Shared/win/PlatformCertificateInfo.h b/WebKit2/Shared/win/PlatformCertificateInfo.h
index 32776f7..1537f57 100644
--- a/WebKit2/Shared/win/PlatformCertificateInfo.h
+++ b/WebKit2/Shared/win/PlatformCertificateInfo.h
@@ -26,30 +26,30 @@
 #ifndef PlatformCertificateInfo_h
 #define PlatformCertificateInfo_h
 
-#include "ArgumentDecoder.h"
-#include "ArgumentEncoder.h"
-#include <WebCore/ResourceResponse.h>
+namespace CoreIPC {
+    class ArgumentDecoder;
+    class ArgumentEncoder;
+}
+
+namespace WebCore {
+    class ResourceResponse;
+}
 
 namespace WebKit {
 
 class PlatformCertificateInfo {
 public:
-    PlatformCertificateInfo()
-    {
-    }
-
-    explicit PlatformCertificateInfo(const WebCore::ResourceResponse&)
-    {
-    }
-
-    void encode(CoreIPC::ArgumentEncoder*) const
-    {
-    }
-
-    static bool decode(CoreIPC::ArgumentDecoder*, PlatformCertificateInfo&)
-    {
-        return true;
-    }
+    PlatformCertificateInfo();
+    explicit PlatformCertificateInfo(const WebCore::ResourceResponse&);    
+    ~PlatformCertificateInfo();
+
+    PCCERT_CONTEXT certificateContext() const { return m_certificateContext; }
+
+    void encode(CoreIPC::ArgumentEncoder* encoder) const;
+    static bool decode(CoreIPC::ArgumentDecoder* decoder, PlatformCertificateInfo& t);
+
+private:
+    PCCERT_CONTEXT m_certificateContext;
 };
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/API/C/win/WKCertificateInfoWin.cpp b/WebKit2/UIProcess/API/C/win/WKCertificateInfoWin.cpp
new file mode 100644
index 0000000..104a962
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/win/WKCertificateInfoWin.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "WKCertificateInfoWin.h"
+
+#include "WKAPICast.h"
+#include "WebCertificateInfo.h"
+
+using namespace WebKit;
+
+PCCERT_CONTEXT WKCertificateInfoGetCertificateContext(WKCertificateInfoRef certificateInfoRef)
+{
+    return toWK(certificateInfoRef)->platformCertificateInfo().certificateContext();
+}
diff --git a/WebKit2/UIProcess/API/C/win/WKCertificateInfoWin.h b/WebKit2/UIProcess/API/C/win/WKCertificateInfoWin.h
new file mode 100644
index 0000000..1db425e
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/win/WKCertificateInfoWin.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKCertificateInfoWin_h
+#define WKCertificateInfoWin_h
+
+#include <WebKit2/WKBase.h>
+#include <Wincrypt.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT PCCERT_CONTEXT WKCertificateInfoGetCertificateContext(WKCertificateInfoRef certificateInfo);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKCertificateInfoWin_h */
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 111d0e6..3537c63 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -1832,7 +1832,6 @@
 			isa = PBXProject;
 			buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "WebKit2" */;
 			compatibilityVersion = "Xcode 3.1";
-			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				English,
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 4c1e689..bab67e7 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -556,6 +556,10 @@
 					>
 				</File>
 				<File
+					RelativePath="..\Shared\win\PlatformCertificateInfo.cpp"
+					>
+				</File>
+				<File
 					RelativePath="..\Shared\win\PlatformCertificateInfo.h"
 					>
 				</File>
@@ -1351,6 +1355,14 @@
 						>
 					</File>
 					<File
+						RelativePath="..\UIProcess\API\C\win\WKCertificateInfoWin.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\UIProcess\API\C\win\WKCertificateInfoWin.h"
+						>
+					</File>
+					<File
 						RelativePath="..\UIProcess\API\C\WKContext.cpp"
 						>
 					</File>
diff --git a/WebKit2/win/WebKit2Generated.make b/WebKit2/win/WebKit2Generated.make
index b47faf2..a08dcff 100644
--- a/WebKit2/win/WebKit2Generated.make
+++ b/WebKit2/win/WebKit2Generated.make
@@ -32,6 +32,7 @@ all:
     xcopy /y /d "..\UIProcess\API\C\cf\WKURLCF.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\cf\WKURLRequestCF.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\cf\WKURLResponseCF.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
+    xcopy /y /d "..\UIProcess\API\C\win\WKCertificateInfoWin.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\win\WKContextPrivateWin.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\cpp\WKRetainPtr.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\win\WKBaseWin.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list