WebKit Bugzilla
Attachment 359706 Details for
Bug 193607
: C strings in ClientCertificateAuthenticationXPCConstants.h are duplicated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v4 (for landing)
bug-193607-20190121123215.patch (text/plain), 14.82 KB, created by
David Kilzer (:ddkilzer)
on 2019-01-21 12:32:16 PST
(
hide
)
Description:
Patch v4 (for landing)
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2019-01-21 12:32:16 PST
Size:
14.82 KB
patch
obsolete
>Subversion Revision: 240239 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index b74267bd4d44f9814be47fbb592655d35ecc5e8f..b7d2dc8ce737dbe7a2559876fddc8a8cfd7bfed7 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,27 @@ >+2019-01-19 David Kilzer <ddkilzer@apple.com> >+ >+ C strings in ClientCertificateAuthenticationXPCConstants.h are duplicated >+ <https://webkit.org/b/193607> >+ <rdar://problem/47334613> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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-15 Darin Adler <darin@apple.com> > > Use references rather than pointers for register/unregister functions, and more >diff --git a/Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm b/Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm >index e33f508906203c0179bfc390db092bf0b8164dd8..1dadd447e83533c2e6a0c4c2f127759a3d7330ed 100644 >--- a/Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm >+++ b/Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm >@@ -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 @@ void AuthenticationManager::initializeConnection(IPC::Connection* connection) > 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 @@ void AuthenticationManager::initializeConnection(IPC::Connection* connection) > 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 @@ void AuthenticationManager::initializeConnection(IPC::Connection* connection) > } > } > >- 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; > >diff --git a/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp b/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..8dc7b826b504046d6f7334e4c394503c73bc2a34 >--- /dev/null >+++ b/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp >@@ -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 >diff --git a/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h b/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h >index c843946d32defe28fefde0fa566348b893b0a4a5..f8edff812f3f0a750ee1cb557fc265359b560c7f 100644 >--- a/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h >+++ b/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h >@@ -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,12 +29,16 @@ > > 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 > >diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt >index 16e88f0ab1ff0bc7d57b137182e697d864f19391..a6fe03a8f6a427bc659bb026353dd280f9ab9c7e 100644 >--- a/Source/WebKit/SourcesCocoa.txt >+++ b/Source/WebKit/SourcesCocoa.txt >@@ -123,6 +123,7 @@ Shared/cf/CookieStorageUtilsCF.mm > Shared/cg/ShareableBitmapCG.cpp > > Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm >+Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp > > Shared/Cocoa/APIDataCocoa.mm > Shared/Cocoa/APIObject.mm >diff --git a/Source/WebKit/UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm b/Source/WebKit/UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm >index 49ba1bdb9d13d93ada94cf1d5524435f5022d48b..af0a762681da73d4f9c5a8cc11e6bf3c7a3a96d3 100644 >--- a/Source/WebKit/UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm >+++ b/Source/WebKit/UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm >@@ -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 @@ void AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc(IPC::C > 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 = adoptCF(SecCertificateCopyData((SecCertificateRef)certificate)); > 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()); > } >diff --git a/Source/WebKit/UnifiedSources-input.xcfilelist b/Source/WebKit/UnifiedSources-input.xcfilelist >index e6c7a0c7a2660e18a82e3c1525c892d706886f57..15b8099e69dbfcd2837789d6db0c1b9ef336e235 100644 >--- a/Source/WebKit/UnifiedSources-input.xcfilelist >+++ b/Source/WebKit/UnifiedSources-input.xcfilelist >@@ -170,6 +170,7 @@ $(SRCROOT)/Shared/AssistedNodeInformation.cpp > $(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 >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index be53325a35d47b101e92d82a3686bbaca7b24468..1ab110b32ad16b3e857508d856c73c89fdec4d62 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -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;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193607
:
359585
|
359588
|
359612
| 359706