Diff
Modified: trunk/Source/WebKit/ChangeLog (240274 => 240275)
--- trunk/Source/WebKit/ChangeLog 2019-01-22 20:41:44 UTC (rev 240274)
+++ trunk/Source/WebKit/ChangeLog 2019-01-22 20:49:55 UTC (rev 240275)
@@ -1,5 +1,29 @@
2019-01-22 David Kilzer <[email protected]>
+ C strings in ClientCertificateAuthenticationXPCConstants.h are duplicated
+ <https://webkit.org/b/193607>
+ <rdar://problem/47334613>
+
+ Reviewed by Alex Christensen.
+
+ * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
+ (WebKit::AuthenticationManager::initializeConnection):
+ * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
+ (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc):
+ - Update name of constants.
+
+ * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
+ * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h:
+ - Put constant values in a namespace, and move values to
+ ClientCertificateAuthenticationXPCConstants.cpp.
+
+ * SourcesCocoa.txt:
+ * UnifiedSources-input.xcfilelist:
+ * WebKit.xcodeproj/project.pbxproj:
+ - Add ClientCertificateAuthenticationXPCConstants.cpp.
+
+2019-01-22 David Kilzer <[email protected]>
+
Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
<https://webkit.org/b/193654>
<rdar://problem/47430290>
Modified: trunk/Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm (240274 => 240275)
--- trunk/Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm 2019-01-22 20:41:44 UTC (rev 240274)
+++ trunk/Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm 2019-01-22 20:49:55 UTC (rev 240275)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -56,16 +56,16 @@
if (type == XPC_TYPE_ERROR || !weakThis)
return;
- if (type != XPC_TYPE_DICTIONARY || strcmp(xpc_dictionary_get_string(event, clientCertificateAuthenticationXPCMessageNameKey), clientCertificateAuthenticationXPCMessageNameValue)) {
+ if (type != XPC_TYPE_DICTIONARY || strcmp(xpc_dictionary_get_string(event, ClientCertificateAuthentication::XPCMessageNameKey), ClientCertificateAuthentication::XPCMessageNameValue)) {
ASSERT_NOT_REACHED();
return;
}
- auto challengeID = xpc_dictionary_get_uint64(event, clientCertificateAuthenticationXPCChallengeIDKey);
+ auto challengeID = xpc_dictionary_get_uint64(event, ClientCertificateAuthentication::XPCChallengeIDKey);
if (!challengeID)
return;
- auto xpcEndPoint = xpc_dictionary_get_value(event, clientCertificateAuthenticationXPCSecKeyProxyEndpointKey);
+ auto xpcEndPoint = xpc_dictionary_get_value(event, ClientCertificateAuthentication::XPCSecKeyProxyEndpointKey);
if (!xpcEndPoint || xpc_get_type(xpcEndPoint) != XPC_TYPE_ENDPOINT)
return;
auto endPoint = adoptNS([[NSXPCListenerEndpoint alloc] init]);
@@ -77,7 +77,7 @@
return;
}
- auto certificateDataArray = xpc_dictionary_get_array(event, clientCertificateAuthenticationXPCCertificatesKey);
+ auto certificateDataArray = xpc_dictionary_get_array(event, ClientCertificateAuthentication::XPCCertificatesKey);
if (!certificateDataArray)
return;
NSMutableArray *certificates = nil;
@@ -93,7 +93,7 @@
}
}
- auto persistence = xpc_dictionary_get_uint64(event, clientCertificateAuthenticationXPCPersistenceKey);
+ auto persistence = xpc_dictionary_get_uint64(event, ClientCertificateAuthentication::XPCPersistenceKey);
if (persistence > static_cast<uint64_t>(NSURLCredentialPersistenceSynchronizable))
return;
Copied: trunk/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp (from rev 240273, trunk/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h) (0 => 240275)
--- trunk/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp (rev 0)
+++ trunk/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp 2019-01-22 20:49:55 UTC (rev 240275)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2018-2019 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 "ClientCertificateAuthenticationXPCConstants.h"
+
+#if HAVE(SEC_KEY_PROXY)
+
+namespace WebKit {
+
+namespace ClientCertificateAuthentication {
+
+const char* const XPCCertificatesKey = "certificates";
+const char* const XPCChallengeIDKey = "challenge-id";
+const char* const XPCMessageNameKey = "message-name";
+const char* const XPCMessageNameValue = "client-certificate-credential";
+const char* const XPCPersistenceKey = "persistence";
+const char* const XPCSecKeyProxyEndpointKey = "sec-key-proxy-endpoint";
+
+} // namespace ClientCertificateAuthentication
+
+} // namespace WebKit
+
+#endif
Modified: trunk/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h (240274 => 240275)
--- trunk/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h 2019-01-22 20:41:44 UTC (rev 240274)
+++ trunk/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h 2019-01-22 20:49:55 UTC (rev 240275)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,13 +29,17 @@
namespace WebKit {
-const char clientCertificateAuthenticationXPCMessageNameKey[] = "message-name";
-const char clientCertificateAuthenticationXPCMessageNameValue[] = "client-certificate-credential";
-const char clientCertificateAuthenticationXPCChallengeIDKey[] = "challenge-id";
-const char clientCertificateAuthenticationXPCSecKeyProxyEndpointKey[] = "sec-key-proxy-endpoint";
-const char clientCertificateAuthenticationXPCCertificatesKey[] = "certificates";
-const char clientCertificateAuthenticationXPCPersistenceKey[] = "persistence";
+namespace ClientCertificateAuthentication {
+extern const char* const XPCCertificatesKey;
+extern const char* const XPCChallengeIDKey;
+extern const char* const XPCMessageNameKey;
+extern const char* const XPCMessageNameValue;
+extern const char* const XPCPersistenceKey;
+extern const char* const XPCSecKeyProxyEndpointKey;
+
+} // namespace ClientCertificateAuthentication
+
} // namespace WebKit
#endif
Modified: trunk/Source/WebKit/SourcesCocoa.txt (240274 => 240275)
--- trunk/Source/WebKit/SourcesCocoa.txt 2019-01-22 20:41:44 UTC (rev 240274)
+++ trunk/Source/WebKit/SourcesCocoa.txt 2019-01-22 20:49:55 UTC (rev 240275)
@@ -123,6 +123,7 @@
Shared/cg/ShareableBitmapCG.cpp
Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm
+Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp
Shared/Cocoa/APIDataCocoa.mm
Shared/Cocoa/APIObject.mm
Modified: trunk/Source/WebKit/UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm (240274 => 240275)
--- trunk/Source/WebKit/UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm 2019-01-22 20:41:44 UTC (rev 240274)
+++ trunk/Source/WebKit/UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm 2019-01-22 20:49:55 UTC (rev 240275)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -41,16 +41,16 @@
ASSERT(secKeyProxyStore.isInitialized());
auto message = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0));
- xpc_dictionary_set_string(message.get(), clientCertificateAuthenticationXPCMessageNameKey, clientCertificateAuthenticationXPCMessageNameValue);
- xpc_dictionary_set_uint64(message.get(), clientCertificateAuthenticationXPCChallengeIDKey, challengeID);
- xpc_dictionary_set_value(message.get(), clientCertificateAuthenticationXPCSecKeyProxyEndpointKey, secKeyProxyStore.get().endpoint._endpoint);
+ xpc_dictionary_set_string(message.get(), ClientCertificateAuthentication::XPCMessageNameKey, ClientCertificateAuthentication::XPCMessageNameValue);
+ xpc_dictionary_set_uint64(message.get(), ClientCertificateAuthentication::XPCChallengeIDKey, challengeID);
+ xpc_dictionary_set_value(message.get(), ClientCertificateAuthentication::XPCSecKeyProxyEndpointKey, secKeyProxyStore.get().endpoint._endpoint);
auto certificateDataArray = adoptOSObject(xpc_array_create(nullptr, 0));
for (id certificate in credential.nsCredential().certificates) {
auto data = ""
xpc_array_append_value(certificateDataArray.get(), adoptOSObject(xpc_data_create(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get()))).get());
}
- xpc_dictionary_set_value(message.get(), clientCertificateAuthenticationXPCCertificatesKey, certificateDataArray.get());
- xpc_dictionary_set_uint64(message.get(), clientCertificateAuthenticationXPCPersistenceKey, static_cast<uint64_t>(credential.nsCredential().persistence));
+ xpc_dictionary_set_value(message.get(), ClientCertificateAuthentication::XPCCertificatesKey, certificateDataArray.get());
+ xpc_dictionary_set_uint64(message.get(), ClientCertificateAuthentication::XPCPersistenceKey, static_cast<uint64_t>(credential.nsCredential().persistence));
xpc_connection_send_message(connection.xpcConnection(), message.get());
}
Modified: trunk/Source/WebKit/UnifiedSources-input.xcfilelist (240274 => 240275)
--- trunk/Source/WebKit/UnifiedSources-input.xcfilelist 2019-01-22 20:41:44 UTC (rev 240274)
+++ trunk/Source/WebKit/UnifiedSources-input.xcfilelist 2019-01-22 20:49:55 UTC (rev 240275)
@@ -170,6 +170,7 @@
$(SRCROOT)/Shared/AsyncRequest.cpp
$(SRCROOT)/Shared/Authentication/AuthenticationManager.cpp
$(SRCROOT)/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm
+$(SRCROOT)/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp
$(SRCROOT)/Shared/BlobDataFileReferenceWithSandboxExtension.cpp
$(SRCROOT)/Shared/CacheModel.cpp
$(SRCROOT)/Shared/ChildProcess.cpp
Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (240274 => 240275)
--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2019-01-22 20:41:44 UTC (rev 240274)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2019-01-22 20:49:55 UTC (rev 240275)
@@ -3068,6 +3068,7 @@
41FBE823206DA79C000F0741 /* NetworkContentRuleListManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NetworkContentRuleListManager.messages.in; sourceTree = "<group>"; };
41FBE824206DA79C000F0741 /* NetworkContentRuleListManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkContentRuleListManager.cpp; sourceTree = "<group>"; };
4450AEBF1DC3FAE5009943F2 /* SharedMemoryCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedMemoryCocoa.cpp; sourceTree = "<group>"; };
+ 44A481C621F2D27B00F2F919 /* ClientCertificateAuthenticationXPCConstants.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ClientCertificateAuthenticationXPCConstants.cpp; sourceTree = "<group>"; };
460F488D1F996F6C00CF4B87 /* WebSWContextManagerConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSWContextManagerConnectionMessageReceiver.cpp; path = DerivedSources/WebKit2/WebSWContextManagerConnectionMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
460F488E1F996F6C00CF4B87 /* WebSWContextManagerConnectionMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSWContextManagerConnectionMessages.h; path = DerivedSources/WebKit2/WebSWContextManagerConnectionMessages.h; sourceTree = BUILT_PRODUCTS_DIR; };
462107D71F38DBD300DD7810 /* PingLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PingLoad.cpp; sourceTree = "<group>"; };
@@ -6735,6 +6736,7 @@
isa = PBXGroup;
children = (
57B4B45D20B504AB00D4AD79 /* AuthenticationManagerCocoa.mm */,
+ 44A481C621F2D27B00F2F919 /* ClientCertificateAuthenticationXPCConstants.cpp */,
57B4B45E20B504AB00D4AD79 /* ClientCertificateAuthenticationXPCConstants.h */,
);
path = cocoa;