Title: [171060] trunk/Source/WebKit2
- Revision
- 171060
- Author
- [email protected]
- Date
- 2014-07-14 00:18:44 -0700 (Mon, 14 Jul 2014)
Log Message
NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
https://bugs.webkit.org/show_bug.cgi?id=134666
Reviewed by Tim Horton.
A SecItem may have an attribute whose value is a SecAccessControlRef, which is not supported
by ArgumentCodersCF. In debug builds, trying to encode a CFDictionary containing a value of
unsupprted type causes an assertion to fail, but in release builds encoding succeeds, and
only decoding fails, in this case silently, simply not delivering the
SecItemShim::secItemResponse message.
The fix is to teach ArgumentCodersCF about SecAccessControlRef.
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::typeFromCFTypeRef): Check for the SecAccessControlRef type.
(IPC::encode): Encode the SecAccessControl serialized into CFData.
(IPC::decode): Deserialize a SecAccessControl from the decoded CFData.
* Shared/cf/ArgumentCodersCF.h:
* config.h: Defined HAVE_SEC_ACCESS_CONTROL.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (171059 => 171060)
--- trunk/Source/WebKit2/ChangeLog 2014-07-13 21:51:16 UTC (rev 171059)
+++ trunk/Source/WebKit2/ChangeLog 2014-07-14 07:18:44 UTC (rev 171060)
@@ -1,3 +1,25 @@
+2014-07-14 Dan Bernstein <[email protected]>
+
+ NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
+ https://bugs.webkit.org/show_bug.cgi?id=134666
+
+ Reviewed by Tim Horton.
+
+ A SecItem may have an attribute whose value is a SecAccessControlRef, which is not supported
+ by ArgumentCodersCF. In debug builds, trying to encode a CFDictionary containing a value of
+ unsupprted type causes an assertion to fail, but in release builds encoding succeeds, and
+ only decoding fails, in this case silently, simply not delivering the
+ SecItemShim::secItemResponse message.
+
+ The fix is to teach ArgumentCodersCF about SecAccessControlRef.
+
+ * Shared/cf/ArgumentCodersCF.cpp:
+ (IPC::typeFromCFTypeRef): Check for the SecAccessControlRef type.
+ (IPC::encode): Encode the SecAccessControl serialized into CFData.
+ (IPC::decode): Deserialize a SecAccessControl from the decoded CFData.
+ * Shared/cf/ArgumentCodersCF.h:
+ * config.h: Defined HAVE_SEC_ACCESS_CONTROL.
+
2014-07-13 Dan Bernstein <[email protected]>
<rdar://problem/17295636> [Cocoa] Include element snapshot in _WKActivatedElementInfo
Modified: trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp (171059 => 171060)
--- trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp 2014-07-13 21:51:16 UTC (rev 171059)
+++ trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp 2014-07-14 07:18:44 UTC (rev 171060)
@@ -51,6 +51,15 @@
extern "C" OSStatus SecKeyFindWithPersistentRef(CFDataRef persistentRef, SecKeyRef* lookedUpData);
#endif
+#if HAVE(SEC_ACCESS_CONTROL)
+#if defined(__has_include) && __has_include(<Security/SecAccessControlPriv.h>)
+#include <Security/SecAccessControlPriv.h>
+#endif
+
+extern "C" SecAccessControlRef SecAccessControlCreateFromData(CFAllocatorRef allocator, CFDataRef data, CFErrorRef *error);
+extern "C" CFDataRef SecAccessControlCopyData(SecAccessControlRef access_control);
+#endif
+
using namespace WebCore;
namespace IPC {
@@ -78,6 +87,9 @@
#if HAVE(SEC_KEYCHAIN)
SecKeychainItem,
#endif
+#if HAVE(SEC_ACCESS_CONTROL)
+ SecAccessControl,
+#endif
Null,
Unknown,
};
@@ -118,6 +130,10 @@
if (typeID == SecKeychainItemGetTypeID())
return SecKeychainItem;
#endif
+#if HAVE(SEC_ACCESS_CONTROL)
+ if (typeID == SecAccessControlGetTypeID())
+ return SecAccessControl;
+#endif
ASSERT_NOT_REACHED();
return Unknown;
@@ -168,6 +184,11 @@
encode(encoder, (SecKeychainItemRef)typeRef);
return;
#endif
+#if HAVE(SEC_ACCESS_CONTROL)
+ case SecAccessControl:
+ encode(encoder, (SecAccessControlRef)typeRef);
+ return;
+#endif
case Null:
return;
case Unknown:
@@ -268,6 +289,15 @@
return true;
}
#endif
+#if HAVE(SEC_ACCESS_CONTROL)
+ case SecAccessControl: {
+ RetainPtr<SecAccessControlRef> accessControl;
+ if (!decode(decoder, accessControl))
+ return false;
+ result = adoptCF(accessControl.leakRef());
+ return true;
+ }
+#endif
case Null:
result = tokenNullTypeRef();
return true;
@@ -684,4 +714,27 @@
}
#endif
+#if HAVE(SEC_ACCESS_CONTROL)
+void encode(ArgumentEncoder& encoder, SecAccessControlRef accessControl)
+{
+ RetainPtr<CFDataRef> data = ""
+ if (data)
+ encode(encoder, data.get());
+}
+
+bool decode(ArgumentDecoder& decoder, RetainPtr<SecAccessControlRef>& result)
+{
+ RetainPtr<CFDataRef> data;
+ if (!decode(decoder, data))
+ return false;
+
+ result = adoptCF(SecAccessControlCreateFromData(kCFAllocatorDefault, data.get(), nullptr));
+ if (!result)
+ return false;
+
+ return true;
+}
+
+#endif
+
} // namespace IPC
Modified: trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.h (171059 => 171060)
--- trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.h 2014-07-13 21:51:16 UTC (rev 171059)
+++ trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.h 2014-07-14 07:18:44 UTC (rev 171060)
@@ -88,6 +88,12 @@
bool decode(ArgumentDecoder&, RetainPtr<SecKeychainItemRef>& result);
#endif
+#if HAVE(SEC_ACCESS_CONTROL)
+// SecAccessControlRef
+void encode(ArgumentEncoder&, SecAccessControlRef);
+bool decode(ArgumentDecoder&, RetainPtr<SecAccessControlRef>& result);
+#endif
+
#if PLATFORM(IOS)
void setAllowsDecodingSecKeyRef(bool);
#endif
Modified: trunk/Source/WebKit2/config.h (171059 => 171060)
--- trunk/Source/WebKit2/config.h 2014-07-13 21:51:16 UTC (rev 171059)
+++ trunk/Source/WebKit2/config.h 2014-07-14 07:18:44 UTC (rev 171060)
@@ -91,3 +91,9 @@
#define HAVE_VOUCHERS 1
#endif
#endif
+
+#ifndef HAVE_SEC_ACCESS_CONTROL
+#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000)
+#define HAVE_SEC_ACCESS_CONTROL 1
+#endif
+#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes