Diff
Modified: tags/Safari-607.1.12.1/Source/WTF/ChangeLog (237743 => 237744)
--- tags/Safari-607.1.12.1/Source/WTF/ChangeLog 2018-11-02 18:10:23 UTC (rev 237743)
+++ tags/Safari-607.1.12.1/Source/WTF/ChangeLog 2018-11-02 18:31:02 UTC (rev 237744)
@@ -1,3 +1,59 @@
+2018-11-02 Alan Coon <alanc...@apple.com>
+
+ Cherry-pick r237721. rdar://problem/45722391
+
+ Replace CommonRandom SPI with API
+ https://bugs.webkit.org/show_bug.cgi?id=191178
+ <rdar://problem/45722391>
+
+ Reviewed by Brent Fulgham.
+
+ Source/bmalloc:
+
+ * bmalloc/CryptoRandom.cpp:
+ (bmalloc::ARC4RandomNumberGenerator::stir):
+
+ Source/WebCore:
+
+ The API is available since macOS 10.10 and iOS 10, and therefore it is safe to replace
+ all SPI usages with API.
+
+ No change of behaviors.
+
+ * crypto/CommonCryptoUtilities.h:
+ * crypto/mac/CryptoKeyMac.cpp:
+ (WebCore::CryptoKey::randomData):
+ * crypto/mac/SerializedCryptoKeyWrapMac.mm:
+ (WebCore::createAndStoreMasterKey):
+ (WebCore::wrapSerializedCryptoKey):
+ * page/Crypto.cpp:
+ (WebCore::Crypto::getRandomValues):
+
+ Source/WTF:
+
+ * WTF.xcodeproj/project.pbxproj:
+ * wtf/CMakeLists.txt:
+ * wtf/RandomDevice.cpp:
+ (WTF::RandomDevice::cryptographicallyRandomValues):
+ * wtf/spi/darwin/CommonCryptoSPI.h: Removed.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237721 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-11-01 Jiewen Tan <jiewen_...@apple.com>
+
+ Replace CommonRandom SPI with API
+ https://bugs.webkit.org/show_bug.cgi?id=191178
+ <rdar://problem/45722391>
+
+ Reviewed by Brent Fulgham.
+
+ * WTF.xcodeproj/project.pbxproj:
+ * wtf/CMakeLists.txt:
+ * wtf/RandomDevice.cpp:
+ (WTF::RandomDevice::cryptographicallyRandomValues):
+ * wtf/spi/darwin/CommonCryptoSPI.h: Removed.
+
2018-10-30 Don Olmstead <don.olmst...@sony.com>
[PlayStation] Enable _javascript_Core
Modified: tags/Safari-607.1.12.1/Source/WTF/WTF.xcodeproj/project.pbxproj (237743 => 237744)
--- tags/Safari-607.1.12.1/Source/WTF/WTF.xcodeproj/project.pbxproj 2018-11-02 18:10:23 UTC (rev 237743)
+++ tags/Safari-607.1.12.1/Source/WTF/WTF.xcodeproj/project.pbxproj 2018-11-02 18:31:02 UTC (rev 237744)
@@ -620,7 +620,6 @@
DCEE21FC1CEA7551000C2396 /* BlockObjCExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockObjCExceptions.h; sourceTree = "<group>"; };
DCEE21FD1CEA7551000C2396 /* BlockObjCExceptions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BlockObjCExceptions.mm; sourceTree = "<group>"; };
DCEE22041CEB9869000C2396 /* BackwardsGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackwardsGraph.h; sourceTree = "<group>"; };
- DE5A09FB1BA36992003D4424 /* CommonCryptoSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonCryptoSPI.h; sourceTree = "<group>"; };
E15556F318A0CC18006F48FB /* CryptographicUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptographicUtilities.cpp; sourceTree = "<group>"; };
E15556F418A0CC18006F48FB /* CryptographicUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptographicUtilities.h; sourceTree = "<group>"; };
E300E521203D645F00DA79BE /* UniqueArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniqueArray.h; sourceTree = "<group>"; };
@@ -1304,7 +1303,6 @@
CE73E02319DCB7AB00580D5C /* darwin */ = {
isa = PBXGroup;
children = (
- DE5A09FB1BA36992003D4424 /* CommonCryptoSPI.h */,
E431CC4A21187ADB000C8A07 /* DispatchSPI.h */,
93DDE9311CDC052D00FD3491 /* dyldSPI.h */,
A5098AFF1C169E0700087797 /* SandboxSPI.h */,
Modified: tags/Safari-607.1.12.1/Source/WTF/wtf/CMakeLists.txt (237743 => 237744)
--- tags/Safari-607.1.12.1/Source/WTF/wtf/CMakeLists.txt 2018-11-02 18:10:23 UTC (rev 237743)
+++ tags/Safari-607.1.12.1/Source/WTF/wtf/CMakeLists.txt 2018-11-02 18:31:02 UTC (rev 237744)
@@ -465,15 +465,6 @@
${CMAKE_DL_LIBS}
)
-if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
- list(APPEND WTF_PUBLIC_HEADERS
- spi/darwin/CommonCryptoSPI.h
- )
-list(APPEND WTF_PRIVATE_INCLUDE_DIRECTORIES
- "${WTF_DIR}/wtf/spi/darwin"
- )
-endif ()
-
if (NOT USE_SYSTEM_MALLOC)
list(APPEND WTF_LIBRARIES bmalloc)
endif ()
Modified: tags/Safari-607.1.12.1/Source/WTF/wtf/RandomDevice.cpp (237743 => 237744)
--- tags/Safari-607.1.12.1/Source/WTF/wtf/RandomDevice.cpp 2018-11-02 18:10:23 UTC (rev 237743)
+++ tags/Safari-607.1.12.1/Source/WTF/wtf/RandomDevice.cpp 2018-11-02 18:31:02 UTC (rev 237744)
@@ -42,7 +42,8 @@
#endif
#if OS(DARWIN)
-#include <wtf/spi/darwin/CommonCryptoSPI.h>
+#include <CommonCrypto/CommonCryptoError.h>
+#include <CommonCrypto/CommonRandom.h>
#endif
#if OS(FUCHSIA)
@@ -88,7 +89,7 @@
void RandomDevice::cryptographicallyRandomValues(unsigned char* buffer, size_t length)
{
#if OS(DARWIN)
- RELEASE_ASSERT(!CCRandomCopyBytes(kCCRandomDefault, buffer, length));
+ RELEASE_ASSERT(!CCRandomGenerateBytes(buffer, length));
#elif OS(FUCHSIA)
zx_cprng_draw(buffer, length);
#elif OS(UNIX)
Deleted: tags/Safari-607.1.12.1/Source/WTF/wtf/spi/darwin/CommonCryptoSPI.h (237743 => 237744)
--- tags/Safari-607.1.12.1/Source/WTF/wtf/spi/darwin/CommonCryptoSPI.h 2018-11-02 18:10:23 UTC (rev 237743)
+++ tags/Safari-607.1.12.1/Source/WTF/wtf/spi/darwin/CommonCryptoSPI.h 2018-11-02 18:31:02 UTC (rev 237744)
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2015-2016 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. ``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
- * 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.
- */
-
-#pragma once
-
-#if OS(DARWIN)
-
-#if USE(APPLE_INTERNAL_SDK)
-#include <CommonCrypto/CommonRandomSPI.h>
-#endif
-
-typedef struct __CCRandom* CCRandomRef;
-
-WTF_EXTERN_C_BEGIN
-
-extern const CCRandomRef kCCRandomDefault;
-int CCRandomCopyBytes(CCRandomRef rnd, void *bytes, size_t count);
-
-WTF_EXTERN_C_END
-
-#endif // OS(DARWIN)
Modified: tags/Safari-607.1.12.1/Source/WebCore/ChangeLog (237743 => 237744)
--- tags/Safari-607.1.12.1/Source/WebCore/ChangeLog 2018-11-02 18:10:23 UTC (rev 237743)
+++ tags/Safari-607.1.12.1/Source/WebCore/ChangeLog 2018-11-02 18:31:02 UTC (rev 237744)
@@ -1,3 +1,67 @@
+2018-11-02 Alan Coon <alanc...@apple.com>
+
+ Cherry-pick r237721. rdar://problem/45722391
+
+ Replace CommonRandom SPI with API
+ https://bugs.webkit.org/show_bug.cgi?id=191178
+ <rdar://problem/45722391>
+
+ Reviewed by Brent Fulgham.
+
+ Source/bmalloc:
+
+ * bmalloc/CryptoRandom.cpp:
+ (bmalloc::ARC4RandomNumberGenerator::stir):
+
+ Source/WebCore:
+
+ The API is available since macOS 10.10 and iOS 10, and therefore it is safe to replace
+ all SPI usages with API.
+
+ No change of behaviors.
+
+ * crypto/CommonCryptoUtilities.h:
+ * crypto/mac/CryptoKeyMac.cpp:
+ (WebCore::CryptoKey::randomData):
+ * crypto/mac/SerializedCryptoKeyWrapMac.mm:
+ (WebCore::createAndStoreMasterKey):
+ (WebCore::wrapSerializedCryptoKey):
+ * page/Crypto.cpp:
+ (WebCore::Crypto::getRandomValues):
+
+ Source/WTF:
+
+ * WTF.xcodeproj/project.pbxproj:
+ * wtf/CMakeLists.txt:
+ * wtf/RandomDevice.cpp:
+ (WTF::RandomDevice::cryptographicallyRandomValues):
+ * wtf/spi/darwin/CommonCryptoSPI.h: Removed.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237721 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-11-01 Jiewen Tan <jiewen_...@apple.com>
+
+ Replace CommonRandom SPI with API
+ https://bugs.webkit.org/show_bug.cgi?id=191178
+ <rdar://problem/45722391>
+
+ Reviewed by Brent Fulgham.
+
+ The API is available since macOS 10.10 and iOS 10, and therefore it is safe to replace
+ all SPI usages with API.
+
+ No change of behaviors.
+
+ * crypto/CommonCryptoUtilities.h:
+ * crypto/mac/CryptoKeyMac.cpp:
+ (WebCore::CryptoKey::randomData):
+ * crypto/mac/SerializedCryptoKeyWrapMac.mm:
+ (WebCore::createAndStoreMasterKey):
+ (WebCore::wrapSerializedCryptoKey):
+ * page/Crypto.cpp:
+ (WebCore::Crypto::getRandomValues):
+
2018-10-30 Wenson Hsieh <wenson_hs...@apple.com>
[Cocoa] Attachment dropped from one web view to another is missing its file wrapper
Modified: tags/Safari-607.1.12.1/Source/WebCore/crypto/CommonCryptoUtilities.h (237743 => 237744)
--- tags/Safari-607.1.12.1/Source/WebCore/crypto/CommonCryptoUtilities.h 2018-11-02 18:10:23 UTC (rev 237743)
+++ tags/Safari-607.1.12.1/Source/WebCore/crypto/CommonCryptoUtilities.h 2018-11-02 18:31:02 UTC (rev 237744)
@@ -33,6 +33,7 @@
#include "CryptoAlgorithmIdentifier.h"
#include <CommonCrypto/CommonCryptor.h>
+#include <CommonCrypto/CommonRandom.h>
#include <wtf/Vector.h>
#if USE(APPLE_INTERNAL_SDK)
@@ -41,7 +42,6 @@
// FIXME: <rdar://problem/31508959>
// #include <CommonCrypto/CommonKeyDerivationSPI.h>
#include <CommonCrypto/CommonRSACryptor.h>
-#include <CommonCrypto/CommonRandomSPI.h>
#endif
#if USE(APPLE_INTERNAL_SDK) && HAVE(CCRSAGetCRTComponents)
@@ -79,10 +79,6 @@
typedef struct _CCBigNumRef *CCBigNumRef;
-typedef struct __CCRandom *CCRandomRef;
-extern const CCRandomRef kCCRandomDefault;
-extern "C" int CCRandomCopyBytes(CCRandomRef rnd, void *bytes, size_t count);
-
typedef struct _CCRSACryptor *CCRSACryptorRef;
extern "C" CCCryptorStatus CCRSACryptorEncrypt(CCRSACryptorRef publicKey, CCAsymmetricPadding padding, const void *plainText, size_t plainTextLen, void *cipherText, size_t *cipherTextLen, const void *tagData, size_t tagDataLen, CCDigestAlgorithm digestType);
extern "C" CCCryptorStatus CCRSACryptorDecrypt(CCRSACryptorRef privateKey, CCAsymmetricPadding padding, const void *cipherText, size_t cipherTextLen, void *plainText, size_t *plainTextLen, const void *tagData, size_t tagDataLen, CCDigestAlgorithm digestType);
Modified: tags/Safari-607.1.12.1/Source/WebCore/crypto/mac/CryptoKeyMac.cpp (237743 => 237744)
--- tags/Safari-607.1.12.1/Source/WebCore/crypto/mac/CryptoKeyMac.cpp 2018-11-02 18:10:23 UTC (rev 237743)
+++ tags/Safari-607.1.12.1/Source/WebCore/crypto/mac/CryptoKeyMac.cpp 2018-11-02 18:31:02 UTC (rev 237744)
@@ -35,7 +35,7 @@
Vector<uint8_t> CryptoKey::randomData(size_t size)
{
Vector<uint8_t> result(size);
- int rc = CCRandomCopyBytes(kCCRandomDefault, result.data(), result.size());
+ auto rc = CCRandomGenerateBytes(result.data(), result.size());
RELEASE_ASSERT(rc == kCCSuccess);
return result;
}
Modified: tags/Safari-607.1.12.1/Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm (237743 => 237744)
--- tags/Safari-607.1.12.1/Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm 2018-11-02 18:10:23 UTC (rev 237743)
+++ tags/Safari-607.1.12.1/Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm 2018-11-02 18:31:02 UTC (rev 237744)
@@ -84,7 +84,7 @@
RELEASE_ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessCredentials));
masterKeyData.resize(masterKeySizeInBytes);
- int rc = CCRandomCopyBytes(kCCRandomDefault, masterKeyData.data(), masterKeyData.size());
+ auto rc = CCRandomGenerateBytes(masterKeyData.data(), masterKeyData.size());
RELEASE_ASSERT(rc == kCCSuccess);
#if PLATFORM(IOS_FAMILY)
@@ -204,7 +204,7 @@
bool wrapSerializedCryptoKey(const Vector<uint8_t>& masterKey, const Vector<uint8_t>& key, Vector<uint8_t>& result)
{
Vector<uint8_t> kek(16);
- int rc = CCRandomCopyBytes(kCCRandomDefault, kek.data(), kek.size());
+ auto rc = CCRandomGenerateBytes(kek.data(), kek.size());
RELEASE_ASSERT(rc == kCCSuccess);
Vector<uint8_t> wrappedKEK(CCSymmetricWrappedSize(kCCWRAPAES, kek.size()));
Modified: tags/Safari-607.1.12.1/Source/WebCore/page/Crypto.cpp (237743 => 237744)
--- tags/Safari-607.1.12.1/Source/WebCore/page/Crypto.cpp 2018-11-02 18:10:23 UTC (rev 237743)
+++ tags/Safari-607.1.12.1/Source/WebCore/page/Crypto.cpp 2018-11-02 18:31:02 UTC (rev 237744)
@@ -59,7 +59,7 @@
if (array.byteLength() > 65536)
return Exception { QuotaExceededError };
#if OS(DARWIN)
- int rc = CCRandomCopyBytes(kCCRandomDefault, array.baseAddress(), array.byteLength());
+ auto rc = CCRandomGenerateBytes(array.baseAddress(), array.byteLength());
RELEASE_ASSERT(rc == kCCSuccess);
#else
cryptographicallyRandomValues(array.baseAddress(), array.byteLength());
Modified: tags/Safari-607.1.12.1/Source/bmalloc/ChangeLog (237743 => 237744)
--- tags/Safari-607.1.12.1/Source/bmalloc/ChangeLog 2018-11-02 18:10:23 UTC (rev 237743)
+++ tags/Safari-607.1.12.1/Source/bmalloc/ChangeLog 2018-11-02 18:31:02 UTC (rev 237744)
@@ -1,3 +1,56 @@
+2018-11-02 Alan Coon <alanc...@apple.com>
+
+ Cherry-pick r237721. rdar://problem/45722391
+
+ Replace CommonRandom SPI with API
+ https://bugs.webkit.org/show_bug.cgi?id=191178
+ <rdar://problem/45722391>
+
+ Reviewed by Brent Fulgham.
+
+ Source/bmalloc:
+
+ * bmalloc/CryptoRandom.cpp:
+ (bmalloc::ARC4RandomNumberGenerator::stir):
+
+ Source/WebCore:
+
+ The API is available since macOS 10.10 and iOS 10, and therefore it is safe to replace
+ all SPI usages with API.
+
+ No change of behaviors.
+
+ * crypto/CommonCryptoUtilities.h:
+ * crypto/mac/CryptoKeyMac.cpp:
+ (WebCore::CryptoKey::randomData):
+ * crypto/mac/SerializedCryptoKeyWrapMac.mm:
+ (WebCore::createAndStoreMasterKey):
+ (WebCore::wrapSerializedCryptoKey):
+ * page/Crypto.cpp:
+ (WebCore::Crypto::getRandomValues):
+
+ Source/WTF:
+
+ * WTF.xcodeproj/project.pbxproj:
+ * wtf/CMakeLists.txt:
+ * wtf/RandomDevice.cpp:
+ (WTF::RandomDevice::cryptographicallyRandomValues):
+ * wtf/spi/darwin/CommonCryptoSPI.h: Removed.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237721 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-11-01 Jiewen Tan <jiewen_...@apple.com>
+
+ Replace CommonRandom SPI with API
+ https://bugs.webkit.org/show_bug.cgi?id=191178
+ <rdar://problem/45722391>
+
+ Reviewed by Brent Fulgham.
+
+ * bmalloc/CryptoRandom.cpp:
+ (bmalloc::ARC4RandomNumberGenerator::stir):
+
2018-10-29 Mark Lam <mark....@apple.com>
Correctly detect string overflow when using the 'Function' constructor.
Modified: tags/Safari-607.1.12.1/Source/bmalloc/bmalloc/CryptoRandom.cpp (237743 => 237744)
--- tags/Safari-607.1.12.1/Source/bmalloc/bmalloc/CryptoRandom.cpp 2018-11-02 18:10:23 UTC (rev 237743)
+++ tags/Safari-607.1.12.1/Source/bmalloc/bmalloc/CryptoRandom.cpp 2018-11-02 18:31:02 UTC (rev 237744)
@@ -44,12 +44,8 @@
#endif
#if BOS(DARWIN)
-typedef struct __CCRandom* CCRandomRef;
-
-extern "C" {
-extern const CCRandomRef kCCRandomDefault;
-int CCRandomCopyBytes(CCRandomRef rnd, void *bytes, size_t count);
-}
+#include <CommonCrypto/CommonCryptoError.h>
+#include <CommonCrypto/CommonRandom.h>
#endif
namespace bmalloc {
@@ -113,7 +109,7 @@
size_t length = sizeof(randomness);
#if BOS(DARWIN)
- RELEASE_BASSERT(!CCRandomCopyBytes(kCCRandomDefault, randomness, length));
+ RELEASE_BASSERT(!CCRandomGenerateBytes(randomness, length));
#else
static std::once_flag onceFlag;
static int fd;