Diff
Modified: trunk/Source/WebKit2/ChangeLog (135203 => 135204)
--- trunk/Source/WebKit2/ChangeLog 2012-11-19 23:08:38 UTC (rev 135203)
+++ trunk/Source/WebKit2/ChangeLog 2012-11-19 23:38:58 UTC (rev 135204)
@@ -1,3 +1,23 @@
+2012-11-19 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r135201.
+ http://trac.webkit.org/changeset/135201
+ https://bugs.webkit.org/show_bug.cgi?id=102725
+
+ Broke all non-Mac WK2 builds. (Requested by rakuco on
+ #webkit).
+
+ * Shared/mac/PlatformCertificateInfo.h:
+ * Shared/mac/PlatformCertificateInfo.mm:
+ (WebKit):
+ * WebKit2.xcodeproj/project.pbxproj:
+ * WebProcess/Authentication/AuthenticationManager.cpp:
+ * WebProcess/Authentication/AuthenticationManager.h:
+ (AuthenticationManager):
+ * WebProcess/Authentication/mac/AuthenticationManager.mac.mm: Copied from Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm.
+ (WebKit):
+ (WebKit::AuthenticationManager::tryUsePlatformCertificateInfoForChallenge):
+
2012-11-19 Brady Eidson <[email protected]>
Move tryUsePlatformCertificateInfoForChallenge from AuthenticationManager to PlatformCertificateInfo.
Modified: trunk/Source/WebKit2/Shared/mac/PlatformCertificateInfo.h (135203 => 135204)
--- trunk/Source/WebKit2/Shared/mac/PlatformCertificateInfo.h 2012-11-19 23:08:38 UTC (rev 135203)
+++ trunk/Source/WebKit2/Shared/mac/PlatformCertificateInfo.h 2012-11-19 23:38:58 UTC (rev 135204)
@@ -34,10 +34,6 @@
class ArgumentEncoder;
}
-namespace WebCore {
- class AuthenticationChallenge;
-}
-
namespace WebKit {
class PlatformCertificateInfo {
@@ -59,8 +55,6 @@
RetainPtr<CFArrayRef> m_certificateChain;
};
-bool tryUsePlatformCertificateInfoForChallenge(const WebCore::AuthenticationChallenge&, const PlatformCertificateInfo&);
-
} // namespace WebKit
#endif // PlatformCertificateInfo_h
Modified: trunk/Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm (135203 => 135204)
--- trunk/Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm 2012-11-19 23:08:38 UTC (rev 135203)
+++ trunk/Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm 2012-11-19 23:38:58 UTC (rev 135204)
@@ -29,7 +29,6 @@
#import "ArgumentCodersCF.h"
#import "ArgumentDecoder.h"
#import "ArgumentEncoder.h"
-#import <WebCore/AuthenticationChallenge.h>
#import <WebKitSystemInterface.h>
using namespace WebCore;
@@ -90,32 +89,4 @@
}
#endif
-bool tryUsePlatformCertificateInfoForChallenge(const AuthenticationChallenge& challenge, const PlatformCertificateInfo& certificateInfo)
-{
- CFArrayRef chain = certificateInfo.certificateChain();
- if (!chain)
- return false;
-
- ASSERT(CFArrayGetCount(chain));
-
- // The passed-in certificate chain includes the identity certificate at index 0, and additional certificates starting at index 1.
- SecIdentityRef identity;
- OSStatus result = SecIdentityCreateWithCertificate(NULL, (SecCertificateRef)CFArrayGetValueAtIndex(chain, 0), &identity);
- if (result != errSecSuccess) {
- LOG_ERROR("Unable to create SecIdentityRef with certificate - %i", result);
- [challenge.sender() cancelAuthenticationChallenge:challenge.nsURLAuthenticationChallenge()];
- return true;
- }
-
- CFIndex chainCount = CFArrayGetCount(chain);
- NSArray *nsChain = chainCount > 1 ? [(NSArray *)chain subarrayWithRange:NSMakeRange(1, chainCount - 1)] : nil;
-
- NSURLCredential *credential = [NSURLCredential credentialWithIdentity:identity
- certificates:nsChain
- persistence:NSURLCredentialPersistenceNone];
-
- [challenge.sender() useCredential:credential forAuthenticationChallenge:challenge.nsURLAuthenticationChallenge()];
- return true;
-}
-
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (135203 => 135204)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2012-11-19 23:08:38 UTC (rev 135203)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2012-11-19 23:38:58 UTC (rev 135204)
@@ -509,6 +509,7 @@
51B15A8513843A3900321AD8 /* EnvironmentUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */; };
51B3005012529D0E000B5CA0 /* WebBackForwardListCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B3004E12529D0E000B5CA0 /* WebBackForwardListCF.cpp */; };
51B3005112529D0E000B5CA0 /* WebPageProxyCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B3004F12529D0E000B5CA0 /* WebPageProxyCF.cpp */; };
+ 51C4032C136749D800DC972D /* AuthenticationManager.mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51C4032B136749D800DC972D /* AuthenticationManager.mac.mm */; };
51CBBA0F165219B6005BE8FD /* NetworkResourceLoadParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51CBBA0D165219B6005BE8FD /* NetworkResourceLoadParameters.cpp */; };
51CBBA10165219B6005BE8FD /* NetworkResourceLoadParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CBBA0E165219B6005BE8FD /* NetworkResourceLoadParameters.h */; };
51D02F64132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D02F63132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp */; };
@@ -1754,6 +1755,7 @@
51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EnvironmentUtilities.h; path = unix/EnvironmentUtilities.h; sourceTree = "<group>"; };
51B3004E12529D0E000B5CA0 /* WebBackForwardListCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebBackForwardListCF.cpp; path = cf/WebBackForwardListCF.cpp; sourceTree = "<group>"; };
51B3004F12529D0E000B5CA0 /* WebPageProxyCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPageProxyCF.cpp; path = cf/WebPageProxyCF.cpp; sourceTree = "<group>"; };
+ 51C4032B136749D800DC972D /* AuthenticationManager.mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AuthenticationManager.mac.mm; path = mac/AuthenticationManager.mac.mm; sourceTree = "<group>"; };
51CBBA0D165219B6005BE8FD /* NetworkResourceLoadParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkResourceLoadParameters.cpp; path = Network/NetworkResourceLoadParameters.cpp; sourceTree = "<group>"; };
51CBBA0E165219B6005BE8FD /* NetworkResourceLoadParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkResourceLoadParameters.h; path = Network/NetworkResourceLoadParameters.h; sourceTree = "<group>"; };
51D02F63132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIconDatabaseMessageReceiver.cpp; sourceTree = "<group>"; };
@@ -3207,6 +3209,7 @@
512F588612A8834700629530 /* Authentication */ = {
isa = PBXGroup;
children = (
+ 51C4032A136749C400DC972D /* mac */,
512F588712A8836600629530 /* AuthenticationManager.cpp */,
512F588812A8836600629530 /* AuthenticationManager.h */,
512F588912A8836600629530 /* AuthenticationManager.messages.in */,
@@ -3278,6 +3281,14 @@
name = cf;
sourceTree = "<group>";
};
+ 51C4032A136749C400DC972D /* mac */ = {
+ isa = PBXGroup;
+ children = (
+ 51C4032B136749D800DC972D /* AuthenticationManager.mac.mm */,
+ );
+ name = mac;
+ sourceTree = "<group>";
+ };
51FBB9C1132E079200F327B4 /* IconDatabase */ = {
isa = PBXGroup;
children = (
@@ -5450,6 +5461,7 @@
512F589612A8838800629530 /* AuthenticationChallengeProxy.cpp in Sources */,
512F589812A8838800629530 /* AuthenticationDecisionListener.cpp in Sources */,
512F588A12A8836600629530 /* AuthenticationManager.cpp in Sources */,
+ 51C4032C136749D800DC972D /* AuthenticationManager.mac.mm in Sources */,
512F58A212A883AD00629530 /* AuthenticationManagerMessageReceiver.cpp in Sources */,
1A64256912DE42EC00CAAE2C /* BackingStore.cpp in Sources */,
1A64292D12DE5F9800CAAE2C /* BackingStoreMac.mm in Sources */,
Modified: trunk/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp (135203 => 135204)
--- trunk/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp 2012-11-19 23:08:38 UTC (rev 135203)
+++ trunk/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp 2012-11-19 23:38:58 UTC (rev 135204)
@@ -30,7 +30,6 @@
#include "Download.h"
#include "DownloadProxyMessages.h"
#include "MessageID.h"
-#include "PlatformCertificateInfo.h"
#include "WebCoreArgumentCoders.h"
#include "WebFrame.h"
#include "WebPage.h"
Modified: trunk/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h (135203 => 135204)
--- trunk/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h 2012-11-19 23:08:38 UTC (rev 135203)
+++ trunk/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.h 2012-11-19 23:38:58 UTC (rev 135204)
@@ -65,6 +65,8 @@
// CoreIPC::MessageReceiver
virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
void didReceiveAuthenticationManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+
+ bool tryUsePlatformCertificateInfoForChallenge(const WebCore::AuthenticationChallenge&, const PlatformCertificateInfo&);
typedef HashMap<uint64_t, WebCore::AuthenticationChallenge> AuthenticationChallengeMap;
AuthenticationChallengeMap m_challenges;
Added: trunk/Source/WebKit2/WebProcess/Authentication/mac/AuthenticationManager.mac.mm (0 => 135204)
--- trunk/Source/WebKit2/WebProcess/Authentication/mac/AuthenticationManager.mac.mm (rev 0)
+++ trunk/Source/WebKit2/WebProcess/Authentication/mac/AuthenticationManager.mac.mm 2012-11-19 23:38:58 UTC (rev 135204)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2011 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 "config.h"
+#include "AuthenticationManager.h"
+
+#if USE(SECURITY_FRAMEWORK)
+
+#include "PlatformCertificateInfo.h"
+#include <Security/SecIdentity.h>
+#include <WebCore/AuthenticationChallenge.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+bool AuthenticationManager::tryUsePlatformCertificateInfoForChallenge(const AuthenticationChallenge& challenge, const PlatformCertificateInfo& certificateInfo)
+{
+ // FIXME (NetworkProcess): This occurs in the WebProcess and therefore won't work.
+ // We need this to happen in the NetworkProcess.
+
+ CFArrayRef chain = certificateInfo.certificateChain();
+ if (!chain)
+ return false;
+
+ ASSERT(CFArrayGetCount(chain));
+
+ // The passed-in certificate chain includes the identity certificate at index 0, and additional certificates starting at index 1.
+ SecIdentityRef identity;
+ OSStatus result = SecIdentityCreateWithCertificate(NULL, (SecCertificateRef)CFArrayGetValueAtIndex(chain, 0), &identity);
+ if (result != errSecSuccess) {
+ LOG_ERROR("Unable to create SecIdentityRef with certificate - %i", result);
+ [challenge.sender() cancelAuthenticationChallenge:challenge.nsURLAuthenticationChallenge()];
+ return true;
+ }
+
+ CFIndex chainCount = CFArrayGetCount(chain);
+ NSArray *nsChain = chainCount > 1 ? [(NSArray *)chain subarrayWithRange:NSMakeRange(1, chainCount - 1)] : nil;
+
+ NSURLCredential *credential = [NSURLCredential credentialWithIdentity:identity
+ certificates:nsChain
+ persistence:NSURLCredentialPersistenceNone];
+
+ [challenge.sender() useCredential:credential forAuthenticationChallenge:challenge.nsURLAuthenticationChallenge()];
+ return true;
+}
+
+} // namespace WebKit
+
+#endif // USE(SECURITY_FRAMEWORK)