Changeset 171060 in webkit
- Timestamp:
- Jul 14, 2014, 12:18:44 AM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r171057 r171060 1 2014-07-14 Dan Bernstein <mitz@apple.com> 2 3 NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace 4 https://bugs.webkit.org/show_bug.cgi?id=134666 5 6 Reviewed by Tim Horton. 7 8 A SecItem may have an attribute whose value is a SecAccessControlRef, which is not supported 9 by ArgumentCodersCF. In debug builds, trying to encode a CFDictionary containing a value of 10 unsupprted type causes an assertion to fail, but in release builds encoding succeeds, and 11 only decoding fails, in this case silently, simply not delivering the 12 SecItemShim::secItemResponse message. 13 14 The fix is to teach ArgumentCodersCF about SecAccessControlRef. 15 16 * Shared/cf/ArgumentCodersCF.cpp: 17 (IPC::typeFromCFTypeRef): Check for the SecAccessControlRef type. 18 (IPC::encode): Encode the SecAccessControl serialized into CFData. 19 (IPC::decode): Deserialize a SecAccessControl from the decoded CFData. 20 * Shared/cf/ArgumentCodersCF.h: 21 * config.h: Defined HAVE_SEC_ACCESS_CONTROL. 22 1 23 2014-07-13 Dan Bernstein <mitz@apple.com> 2 24 -
trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp
r169938 r171060 52 52 #endif 53 53 54 #if HAVE(SEC_ACCESS_CONTROL) 55 #if defined(__has_include) && __has_include(<Security/SecAccessControlPriv.h>) 56 #include <Security/SecAccessControlPriv.h> 57 #endif 58 59 extern "C" SecAccessControlRef SecAccessControlCreateFromData(CFAllocatorRef allocator, CFDataRef data, CFErrorRef *error); 60 extern "C" CFDataRef SecAccessControlCopyData(SecAccessControlRef access_control); 61 #endif 62 54 63 using namespace WebCore; 55 64 … … 78 87 #if HAVE(SEC_KEYCHAIN) 79 88 SecKeychainItem, 89 #endif 90 #if HAVE(SEC_ACCESS_CONTROL) 91 SecAccessControl, 80 92 #endif 81 93 Null, … … 119 131 return SecKeychainItem; 120 132 #endif 133 #if HAVE(SEC_ACCESS_CONTROL) 134 if (typeID == SecAccessControlGetTypeID()) 135 return SecAccessControl; 136 #endif 121 137 122 138 ASSERT_NOT_REACHED(); … … 167 183 case SecKeychainItem: 168 184 encode(encoder, (SecKeychainItemRef)typeRef); 185 return; 186 #endif 187 #if HAVE(SEC_ACCESS_CONTROL) 188 case SecAccessControl: 189 encode(encoder, (SecAccessControlRef)typeRef); 169 190 return; 170 191 #endif … … 266 287 return false; 267 288 result = adoptCF(keychainItem.leakRef()); 289 return true; 290 } 291 #endif 292 #if HAVE(SEC_ACCESS_CONTROL) 293 case SecAccessControl: { 294 RetainPtr<SecAccessControlRef> accessControl; 295 if (!decode(decoder, accessControl)) 296 return false; 297 result = adoptCF(accessControl.leakRef()); 268 298 return true; 269 299 } … … 685 715 #endif 686 716 717 #if HAVE(SEC_ACCESS_CONTROL) 718 void encode(ArgumentEncoder& encoder, SecAccessControlRef accessControl) 719 { 720 RetainPtr<CFDataRef> data = adoptCF(SecAccessControlCopyData(accessControl)); 721 if (data) 722 encode(encoder, data.get()); 723 } 724 725 bool decode(ArgumentDecoder& decoder, RetainPtr<SecAccessControlRef>& result) 726 { 727 RetainPtr<CFDataRef> data; 728 if (!decode(decoder, data)) 729 return false; 730 731 result = adoptCF(SecAccessControlCreateFromData(kCFAllocatorDefault, data.get(), nullptr)); 732 if (!result) 733 return false; 734 735 return true; 736 } 737 738 #endif 739 687 740 } // namespace IPC -
trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.h
r169938 r171060 89 89 #endif 90 90 91 #if HAVE(SEC_ACCESS_CONTROL) 92 // SecAccessControlRef 93 void encode(ArgumentEncoder&, SecAccessControlRef); 94 bool decode(ArgumentDecoder&, RetainPtr<SecAccessControlRef>& result); 95 #endif 96 91 97 #if PLATFORM(IOS) 92 98 void setAllowsDecodingSecKeyRef(bool); -
trunk/Source/WebKit2/config.h
r169546 r171060 92 92 #endif 93 93 #endif 94 95 #ifndef HAVE_SEC_ACCESS_CONTROL 96 #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000) 97 #define HAVE_SEC_ACCESS_CONTROL 1 98 #endif 99 #endif
Note:
See TracChangeset
for help on using the changeset viewer.