Changeset 240275 in webkit
- Timestamp:
- Jan 22, 2019 12:49:55 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r240272 r240275 1 2019-01-22 David Kilzer <ddkilzer@apple.com> 2 3 C strings in ClientCertificateAuthenticationXPCConstants.h are duplicated 4 <https://webkit.org/b/193607> 5 <rdar://problem/47334613> 6 7 Reviewed by Alex Christensen. 8 9 * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: 10 (WebKit::AuthenticationManager::initializeConnection): 11 * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm: 12 (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc): 13 - Update name of constants. 14 15 * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h. 16 * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h: 17 - Put constant values in a namespace, and move values to 18 ClientCertificateAuthenticationXPCConstants.cpp. 19 20 * SourcesCocoa.txt: 21 * UnifiedSources-input.xcfilelist: 22 * WebKit.xcodeproj/project.pbxproj: 23 - Add ClientCertificateAuthenticationXPCConstants.cpp. 24 1 25 2019-01-22 David Kilzer <ddkilzer@apple.com> 2 26 -
trunk/Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm
r236344 r240275 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 57 57 return; 58 58 59 if (type != XPC_TYPE_DICTIONARY || strcmp(xpc_dictionary_get_string(event, clientCertificateAuthenticationXPCMessageNameKey), clientCertificateAuthenticationXPCMessageNameValue)) {59 if (type != XPC_TYPE_DICTIONARY || strcmp(xpc_dictionary_get_string(event, ClientCertificateAuthentication::XPCMessageNameKey), ClientCertificateAuthentication::XPCMessageNameValue)) { 60 60 ASSERT_NOT_REACHED(); 61 61 return; 62 62 } 63 63 64 auto challengeID = xpc_dictionary_get_uint64(event, clientCertificateAuthenticationXPCChallengeIDKey);64 auto challengeID = xpc_dictionary_get_uint64(event, ClientCertificateAuthentication::XPCChallengeIDKey); 65 65 if (!challengeID) 66 66 return; 67 67 68 auto xpcEndPoint = xpc_dictionary_get_value(event, clientCertificateAuthenticationXPCSecKeyProxyEndpointKey);68 auto xpcEndPoint = xpc_dictionary_get_value(event, ClientCertificateAuthentication::XPCSecKeyProxyEndpointKey); 69 69 if (!xpcEndPoint || xpc_get_type(xpcEndPoint) != XPC_TYPE_ENDPOINT) 70 70 return; … … 78 78 } 79 79 80 auto certificateDataArray = xpc_dictionary_get_array(event, clientCertificateAuthenticationXPCCertificatesKey);80 auto certificateDataArray = xpc_dictionary_get_array(event, ClientCertificateAuthentication::XPCCertificatesKey); 81 81 if (!certificateDataArray) 82 82 return; … … 94 94 } 95 95 96 auto persistence = xpc_dictionary_get_uint64(event, clientCertificateAuthenticationXPCPersistenceKey);96 auto persistence = xpc_dictionary_get_uint64(event, ClientCertificateAuthentication::XPCPersistenceKey); 97 97 if (persistence > static_cast<uint64_t>(NSURLCredentialPersistenceSynchronizable)) 98 98 return; -
trunk/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp
r240273 r240275 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #pragma once 26 #include "config.h" 27 #include "ClientCertificateAuthenticationXPCConstants.h" 27 28 28 29 #if HAVE(SEC_KEY_PROXY) … … 30 31 namespace WebKit { 31 32 32 const char clientCertificateAuthenticationXPCMessageNameKey[] = "message-name"; 33 const char clientCertificateAuthenticationXPCMessageNameValue[] = "client-certificate-credential"; 34 const char clientCertificateAuthenticationXPCChallengeIDKey[] = "challenge-id"; 35 const char clientCertificateAuthenticationXPCSecKeyProxyEndpointKey[] = "sec-key-proxy-endpoint"; 36 const char clientCertificateAuthenticationXPCCertificatesKey[] = "certificates"; 37 const char clientCertificateAuthenticationXPCPersistenceKey[] = "persistence"; 33 namespace ClientCertificateAuthentication { 34 35 const char* const XPCCertificatesKey = "certificates"; 36 const char* const XPCChallengeIDKey = "challenge-id"; 37 const char* const XPCMessageNameKey = "message-name"; 38 const char* const XPCMessageNameValue = "client-certificate-credential"; 39 const char* const XPCPersistenceKey = "persistence"; 40 const char* const XPCSecKeyProxyEndpointKey = "sec-key-proxy-endpoint"; 41 42 } // namespace ClientCertificateAuthentication 38 43 39 44 } // namespace WebKit -
trunk/Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h
r232165 r240275 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 namespace WebKit { 31 31 32 const char clientCertificateAuthenticationXPCMessageNameKey[] = "message-name"; 33 const char clientCertificateAuthenticationXPCMessageNameValue[] = "client-certificate-credential"; 34 const char clientCertificateAuthenticationXPCChallengeIDKey[] = "challenge-id"; 35 const char clientCertificateAuthenticationXPCSecKeyProxyEndpointKey[] = "sec-key-proxy-endpoint"; 36 const char clientCertificateAuthenticationXPCCertificatesKey[] = "certificates"; 37 const char clientCertificateAuthenticationXPCPersistenceKey[] = "persistence"; 32 namespace ClientCertificateAuthentication { 33 34 extern const char* const XPCCertificatesKey; 35 extern const char* const XPCChallengeIDKey; 36 extern const char* const XPCMessageNameKey; 37 extern const char* const XPCMessageNameValue; 38 extern const char* const XPCPersistenceKey; 39 extern const char* const XPCSecKeyProxyEndpointKey; 40 41 } // namespace ClientCertificateAuthentication 38 42 39 43 } // namespace WebKit -
trunk/Source/WebKit/SourcesCocoa.txt
r240162 r240275 124 124 125 125 Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm 126 Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp 126 127 127 128 Shared/Cocoa/APIDataCocoa.mm -
trunk/Source/WebKit/UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm
r236153 r240275 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 42 42 43 43 auto message = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0)); 44 xpc_dictionary_set_string(message.get(), clientCertificateAuthenticationXPCMessageNameKey, clientCertificateAuthenticationXPCMessageNameValue);45 xpc_dictionary_set_uint64(message.get(), clientCertificateAuthenticationXPCChallengeIDKey, challengeID);46 xpc_dictionary_set_value(message.get(), clientCertificateAuthenticationXPCSecKeyProxyEndpointKey, secKeyProxyStore.get().endpoint._endpoint);44 xpc_dictionary_set_string(message.get(), ClientCertificateAuthentication::XPCMessageNameKey, ClientCertificateAuthentication::XPCMessageNameValue); 45 xpc_dictionary_set_uint64(message.get(), ClientCertificateAuthentication::XPCChallengeIDKey, challengeID); 46 xpc_dictionary_set_value(message.get(), ClientCertificateAuthentication::XPCSecKeyProxyEndpointKey, secKeyProxyStore.get().endpoint._endpoint); 47 47 auto certificateDataArray = adoptOSObject(xpc_array_create(nullptr, 0)); 48 48 for (id certificate in credential.nsCredential().certificates) { … … 50 50 xpc_array_append_value(certificateDataArray.get(), adoptOSObject(xpc_data_create(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get()))).get()); 51 51 } 52 xpc_dictionary_set_value(message.get(), clientCertificateAuthenticationXPCCertificatesKey, certificateDataArray.get());53 xpc_dictionary_set_uint64(message.get(), clientCertificateAuthenticationXPCPersistenceKey, static_cast<uint64_t>(credential.nsCredential().persistence));52 xpc_dictionary_set_value(message.get(), ClientCertificateAuthentication::XPCCertificatesKey, certificateDataArray.get()); 53 xpc_dictionary_set_uint64(message.get(), ClientCertificateAuthentication::XPCPersistenceKey, static_cast<uint64_t>(credential.nsCredential().persistence)); 54 54 55 55 xpc_connection_send_message(connection.xpcConnection(), message.get()); -
trunk/Source/WebKit/UnifiedSources-input.xcfilelist
r239747 r240275 171 171 $(SRCROOT)/Shared/Authentication/AuthenticationManager.cpp 172 172 $(SRCROOT)/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm 173 $(SRCROOT)/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp 173 174 $(SRCROOT)/Shared/BlobDataFileReferenceWithSandboxExtension.cpp 174 175 $(SRCROOT)/Shared/CacheModel.cpp -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r240202 r240275 3069 3069 41FBE824206DA79C000F0741 /* NetworkContentRuleListManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkContentRuleListManager.cpp; sourceTree = "<group>"; }; 3070 3070 4450AEBF1DC3FAE5009943F2 /* SharedMemoryCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedMemoryCocoa.cpp; sourceTree = "<group>"; }; 3071 44A481C621F2D27B00F2F919 /* ClientCertificateAuthenticationXPCConstants.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ClientCertificateAuthenticationXPCConstants.cpp; sourceTree = "<group>"; }; 3071 3072 460F488D1F996F6C00CF4B87 /* WebSWContextManagerConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSWContextManagerConnectionMessageReceiver.cpp; path = DerivedSources/WebKit2/WebSWContextManagerConnectionMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; 3072 3073 460F488E1F996F6C00CF4B87 /* WebSWContextManagerConnectionMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSWContextManagerConnectionMessages.h; path = DerivedSources/WebKit2/WebSWContextManagerConnectionMessages.h; sourceTree = BUILT_PRODUCTS_DIR; }; … … 6736 6737 children = ( 6737 6738 57B4B45D20B504AB00D4AD79 /* AuthenticationManagerCocoa.mm */, 6739 44A481C621F2D27B00F2F919 /* ClientCertificateAuthenticationXPCConstants.cpp */, 6738 6740 57B4B45E20B504AB00D4AD79 /* ClientCertificateAuthenticationXPCConstants.h */, 6739 6741 );
Note: See TracChangeset
for help on using the changeset viewer.