Replace CommonRandom SPI with API
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Nov 2018 06:35:59 +0000 (06:35 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Nov 2018 06:35:59 +0000 (06:35 +0000)
commite12110ef4b526471d841022214a60c7335d0af09
treefb2f99ce10cb6fee76e8f33ca4a4dc2dbf6c165a
parent8fe9b1419f5990e0ce3ffd6f5703493ef15857aa
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
12 files changed:
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/RandomDevice.cpp
Source/WTF/wtf/spi/darwin/CommonCryptoSPI.h [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/crypto/CommonCryptoUtilities.h
Source/WebCore/crypto/mac/CryptoKeyMac.cpp
Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm
Source/WebCore/page/Crypto.cpp
Source/bmalloc/ChangeLog
Source/bmalloc/bmalloc/CryptoRandom.cpp