Move CommonCrypto SPI declarations to an appropriate PAL/spi header
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2019 20:56:18 +0000 (20:56 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2019 20:56:18 +0000 (20:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195754
<rdar://problem/48591957>

Reviewed by Jiewen Tan.

Move the forward declarations of various CommonCrypto SPI to an appropriate PAL/spi header.
Update the const correctness of one function call to match new SDK declaration.

No tests because there are no changes in behavior.

Source/WebCore:

* crypto/CommonCryptoUtilities.h:
* crypto/mac/CryptoAlgorithmHKDFMac.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/spi/cocoa/CommonCryptoSPI.h: Copied from Source/WebCore/crypto/CommonCryptoUtilities.h.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242963 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
Source/WebCore/PAL/pal/spi/cocoa/CommonCryptoSPI.h [new file with mode: 0644]
Source/WebCore/crypto/CommonCryptoUtilities.h
Source/WebCore/crypto/mac/CryptoAlgorithmHKDFMac.cpp

index 8bff583..72af018 100644 (file)
@@ -1,3 +1,20 @@
+2019-03-14  Brent Fulgham  <bfulgham@apple.com>
+
+        Move CommonCrypto SPI declarations to an appropriate PAL/spi header
+        https://bugs.webkit.org/show_bug.cgi?id=195754
+        <rdar://problem/48591957>
+
+        Reviewed by Jiewen Tan.
+
+        Move the forward declarations of various CommonCrypto SPI to an appropriate PAL/spi header.
+        Update the const correctness of one function call to match new SDK declaration.
+
+        No tests because there are no changes in behavior.
+
+        * crypto/CommonCryptoUtilities.h:
+        * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
+        (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
+
 2019-03-14  Chris Dumez  <cdumez@apple.com>
 
         Add WebsitePolicy for the client to specify the device orientation & motion access policy
index 3324880..14c2ff1 100644 (file)
@@ -1,3 +1,19 @@
+2019-03-14  Brent Fulgham  <bfulgham@apple.com>
+
+        Move CommonCrypto SPI declarations to an appropriate PAL/spi header
+        https://bugs.webkit.org/show_bug.cgi?id=195754
+        <rdar://problem/48591957>
+
+        Reviewed by Jiewen Tan.
+
+        Move the forward declarations of various CommonCrypto SPI to an appropriate PAL/spi header.
+        Update the const correctness of one function call to match new SDK declaration.
+
+        No tests because there are no changes in behavior.
+
+        * PAL.xcodeproj/project.pbxproj:
+        * pal/spi/cocoa/CommonCryptoSPI.h: Copied from Source/WebCore/crypto/CommonCryptoUtilities.h.
+
 2019-03-13  Keith Rollin  <krollin@apple.com>
 
         Add support for new StagedFrameworks layout
index 942810a..4884ed3 100644 (file)
@@ -98,6 +98,7 @@
                0C7785A01F45130F00F4EBB6 /* QuickLookMacSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C7785871F45130F00F4EBB6 /* QuickLookMacSPI.h */; };
                0C7785A11F45130F00F4EBB6 /* TelephonyUtilitiesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C7785881F45130F00F4EBB6 /* TelephonyUtilitiesSPI.h */; };
                0CF99CA41F736375007EE793 /* MediaTimeAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C00CFD11F68CE4600AAC26D /* MediaTimeAVFoundation.cpp */; };
+               7A36D0F9223AD9AB00B0522E /* CommonCryptoSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */; };
                0CF99CA81F738437007EE793 /* CoreMediaSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0CF99CA61F738436007EE793 /* CoreMediaSoftLink.cpp */; };
                0CF99CA91F738437007EE793 /* CoreMediaSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CF99CA71F738437007EE793 /* CoreMediaSoftLink.h */; };
                1C09D0531E31C44100725F18 /* CryptoDigest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C09D0521E31C44100725F18 /* CryptoDigest.h */; };
                0C2DA0681F33CA8400DBC317 /* CFNetworkConnectionCacheSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFNetworkConnectionCacheSPI.h; sourceTree = "<group>"; };
                0C2DA0691F33CA8400DBC317 /* CFNetworkSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFNetworkSPI.h; sourceTree = "<group>"; };
                0C2DA06A1F33CA8400DBC317 /* CFUtilitiesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFUtilitiesSPI.h; sourceTree = "<group>"; };
+               7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonCryptoSPI.h; sourceTree = "<group>"; };
                0C2DA06B1F33CA8400DBC317 /* CoreAudioSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAudioSPI.h; sourceTree = "<group>"; };
                0C2DA06C1F33CA8400DBC317 /* CoreMediaSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreMediaSPI.h; sourceTree = "<group>"; };
                0C2DA11C1F3BE9E000DBC317 /* CoreGraphicsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreGraphicsSPI.h; sourceTree = "<group>"; };
                                2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */,
                                0C2DA1221F3BEB4900DBC317 /* AVKitSPI.h */,
                                0C2DA1231F3BEB4900DBC317 /* CFNSURLConnectionSPI.h */,
+                               7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */,
                                0C2DA1241F3BEB4900DBC317 /* CoreTextSPI.h */,
                                0C2DA1251F3BEB4900DBC317 /* DataDetectorsCoreSPI.h */,
                                CE5673862151A7B9002F92D7 /* IOKitSPI.h */,
                                0C2DA0701F33CA8400DBC317 /* CFUtilitiesSPI.h in Headers */,
                                0C5FFF0C1F78D990009EFF1A /* Clock.h in Headers */,
                                0C5FFF101F78D9DA009EFF1A /* ClockCM.h in Headers */,
+                               7A36D0F9223AD9AB00B0522E /* CommonCryptoSPI.h in Headers */,
                                1C09D0581E31C57E00725F18 /* config.h in Headers */,
                                0C2DA0711F33CA8400DBC317 /* CoreAudioSPI.h in Headers */,
                                0C2DA11E1F3BE9E000DBC317 /* CoreGraphicsSPI.h in Headers */,
diff --git a/Source/WebCore/PAL/pal/spi/cocoa/CommonCryptoSPI.h b/Source/WebCore/PAL/pal/spi/cocoa/CommonCryptoSPI.h
new file mode 100644 (file)
index 0000000..6b45eb4
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2013-2019 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. AND ITS CONTRIBUTORS ``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 ITS 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 (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300)
+#define HAVE_CCRSAGetCRTComponents 1
+#endif
+
+#if USE(APPLE_INTERNAL_SDK)
+#include <CommonCrypto/CommonCryptorSPI.h>
+#include <CommonCrypto/CommonECCryptor.h>
+#include <CommonCrypto/CommonKeyDerivationSPI.h>
+#include <CommonCrypto/CommonRSACryptor.h>
+
+#if HAVE(CCRSAGetCRTComponents)
+#include <CommonCrypto/CommonRSACryptorSPI.h>
+#endif
+
+#else
+
+#ifndef _CC_RSACRYPTOR_H_
+enum {
+    kCCDigestNone = 0,
+    kCCDigestSHA1 = 8,
+    kCCDigestSHA224 = 9,
+    kCCDigestSHA256 = 10,
+    kCCDigestSHA384 = 11,
+    kCCDigestSHA512 = 12,
+};
+typedef uint32_t CCDigestAlgorithm;
+
+enum {
+    ccRSAKeyPublic = 0,
+    ccRSAKeyPrivate = 1
+};
+typedef uint32_t CCRSAKeyType;
+
+enum {
+    ccPKCS1Padding = 1001,
+    ccOAEPPadding = 1002,
+    ccRSAPSSPadding = 1005
+};
+typedef uint32_t CCAsymmetricPadding;
+#endif
+
+typedef struct _CCBigNumRef *CCBigNumRef;
+
+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);
+extern "C" CCCryptorStatus CCRSACryptorSign(CCRSACryptorRef privateKey, CCAsymmetricPadding padding, const void *hashToSign, size_t hashSignLen, CCDigestAlgorithm digestType, size_t saltLen, void *signedData, size_t *signedDataLen);
+extern "C" CCCryptorStatus CCRSACryptorVerify(CCRSACryptorRef publicKey, CCAsymmetricPadding padding, const void *hash, size_t hashLen, CCDigestAlgorithm digestType, size_t saltLen, const void *signedData, size_t signedDataLen);
+extern "C" CCCryptorStatus CCRSACryptorGeneratePair(size_t keysize, uint32_t e, CCRSACryptorRef *publicKey, CCRSACryptorRef *privateKey);
+extern "C" CCRSACryptorRef CCRSACryptorGetPublicKeyFromPrivateKey(CCRSACryptorRef privkey);
+extern "C" void CCRSACryptorRelease(CCRSACryptorRef key);
+extern "C" CCCryptorStatus CCRSAGetKeyComponents(CCRSACryptorRef rsaKey, uint8_t *modulus, size_t *modulusLength, uint8_t *exponent, size_t *exponentLength, uint8_t *p, size_t *pLength, uint8_t *q, size_t *qLength);
+extern "C" CCRSAKeyType CCRSAGetKeyType(CCRSACryptorRef key);
+extern "C" CCCryptorStatus CCRSACryptorImport(const void *keyPackage, size_t keyPackageLen, CCRSACryptorRef *key);
+extern "C" CCCryptorStatus CCRSACryptorExport(CCRSACryptorRef key, void *out, size_t *outLen);
+
+#if HAVE(CCRSAGetCRTComponents)
+extern "C" CCCryptorStatus CCRSAGetCRTComponentsSizes(CCRSACryptorRef rsaKey, size_t *dpSize, size_t *dqSize, size_t *qinvSize);
+extern "C" CCCryptorStatus CCRSAGetCRTComponents(CCRSACryptorRef rsaKey, void *dp, size_t dpSize, void *dq, size_t dqSize, void *qinv, size_t qinvSize);
+#endif
+
+#ifndef _CC_ECCRYPTOR_H_
+enum {
+    ccECKeyPublic = 0,
+    ccECKeyPrivate = 1,
+};
+typedef uint32_t CCECKeyType;
+
+enum {
+    kCCImportKeyBinary = 0,
+};
+typedef uint32_t CCECKeyExternalFormat;
+#endif
+
+typedef struct _CCECCryptor *CCECCryptorRef;
+extern "C" CCCryptorStatus CCECCryptorGeneratePair(size_t keysize, CCECCryptorRef *publicKey, CCECCryptorRef *privateKey);
+extern "C" void CCECCryptorRelease(CCECCryptorRef key);
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
+extern "C" CCCryptorStatus CCECCryptorImportKey(CCECKeyExternalFormat format, const void *keyPackage, size_t keyPackageLen, CCECKeyType keyType, CCECCryptorRef *key);
+#else
+extern "C" CCCryptorStatus CCECCryptorImportKey(CCECKeyExternalFormat format, void *keyPackage, size_t keyPackageLen, CCECKeyType keyType, CCECCryptorRef *key);
+#endif
+extern "C" CCCryptorStatus CCECCryptorExportKey(CCECKeyExternalFormat format, void *keyPackage, size_t *keyPackageLen, CCECKeyType keyType, CCECCryptorRef key);
+extern "C" int CCECGetKeySize(CCECCryptorRef key);
+extern "C" CCCryptorStatus CCECCryptorCreateFromData(size_t keySize, uint8_t *qX, size_t qXLength, uint8_t *qY, size_t qYLength, CCECCryptorRef *ref);
+extern "C" CCCryptorStatus CCECCryptorGetKeyComponents(CCECCryptorRef ecKey, size_t *keySize, uint8_t *qX, size_t *qXLength, uint8_t *qY, size_t *qYLength, uint8_t *d, size_t *dLength);
+extern "C" CCCryptorStatus CCECCryptorComputeSharedSecret(CCECCryptorRef privateKey, CCECCryptorRef publicKey, void *out, size_t *outLen);
+extern "C" CCCryptorStatus CCECCryptorSignHash(CCECCryptorRef privateKey, const void *hashToSign, size_t hashSignLen, void *signedData, size_t *signedDataLen);
+extern "C" CCCryptorStatus CCECCryptorVerifyHash(CCECCryptorRef publicKey, const void *hash, size_t hashLen, const void *signedData, size_t signedDataLen, uint32_t *valid);
+
+#ifndef CommonCrypto_CommonNistKeyDerivation_h
+enum {
+    kCCKDFAlgorithmHKDF = 6
+};
+typedef uint32_t CCKDFAlgorithm;
+#endif
+
+extern "C" CCStatus CCKeyDerivationHMac(CCKDFAlgorithm algorithm, CCDigestAlgorithm digest, unsigned rounds, const void *keyDerivationKey, size_t keyDerivationKeyLen, const void *label, size_t labelLen, const void *context, size_t contextLen, const void *iv, size_t ivLen, const void *salt, size_t saltLen, void *derivedKey, size_t derivedKeyLen);
+
+extern "C" CCCryptorStatus CCCryptorGCM(CCOperation op, CCAlgorithm alg, const void* key, size_t keyLength, const void* iv, size_t ivLen, const void* aData, size_t aDataLen, const void* dataIn, size_t dataInLength, void* dataOut, void* tag, size_t* tagLength);
+extern "C" CCCryptorStatus CCRSACryptorCreateFromData(CCRSAKeyType keyType, const uint8_t *modulus, size_t modulusLength, const uint8_t *exponent, size_t exponentLength, const uint8_t *p, size_t pLength, const uint8_t *q, size_t qLength, CCRSACryptorRef *ref);
+
+#endif // !USE(APPLE_INTERNAL_SDK)
index 5c00a68..a7bac9c 100644 (file)
 
 #pragma once
 
-#if (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300)
-#define HAVE_CCRSAGetCRTComponents 1
-#endif
-
 #if ENABLE(WEB_CRYPTO)
 
 #include "CryptoAlgorithmIdentifier.h"
 #include <CommonCrypto/CommonCryptor.h>
 #include <CommonCrypto/CommonRandom.h>
+#include <pal/spi/cocoa/CommonCryptoSPI.h>
 #include <wtf/Vector.h>
 
-#if USE(APPLE_INTERNAL_SDK)
-#include <CommonCrypto/CommonCryptorSPI.h>
-#include <CommonCrypto/CommonECCryptor.h>
-// FIXME: <rdar://problem/31508959>
-// #include <CommonCrypto/CommonKeyDerivationSPI.h>
-#include <CommonCrypto/CommonRSACryptor.h>
-#endif
-
-#if USE(APPLE_INTERNAL_SDK) && HAVE(CCRSAGetCRTComponents)
-#include <CommonCrypto/CommonRSACryptorSPI.h>
-#endif
-
-#ifndef _CC_RSACRYPTOR_H_
-enum {
-    kCCDigestNone = 0,
-    kCCDigestSHA1 = 8,
-    kCCDigestSHA224 = 9,
-    kCCDigestSHA256 = 10,
-    kCCDigestSHA384 = 11,
-    kCCDigestSHA512 = 12,
-};
-typedef uint32_t CCDigestAlgorithm;
-
-enum {
-    ccRSAKeyPublic = 0,
-    ccRSAKeyPrivate = 1
-};
-typedef uint32_t CCRSAKeyType;
-
-enum {
-    ccPKCS1Padding = 1001,
-    ccOAEPPadding = 1002,
-    ccRSAPSSPadding = 1005
-};
-typedef uint32_t CCAsymmetricPadding;
-#endif
-
-typedef struct _CCBigNumRef *CCBigNumRef;
-
-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);
-extern "C" CCCryptorStatus CCRSACryptorSign(CCRSACryptorRef privateKey, CCAsymmetricPadding padding, const void *hashToSign, size_t hashSignLen, CCDigestAlgorithm digestType, size_t saltLen, void *signedData, size_t *signedDataLen);
-extern "C" CCCryptorStatus CCRSACryptorVerify(CCRSACryptorRef publicKey, CCAsymmetricPadding padding, const void *hash, size_t hashLen, CCDigestAlgorithm digestType, size_t saltLen, const void *signedData, size_t signedDataLen);
-extern "C" CCCryptorStatus CCRSACryptorGeneratePair(size_t keysize, uint32_t e, CCRSACryptorRef *publicKey, CCRSACryptorRef *privateKey);
-extern "C" CCRSACryptorRef CCRSACryptorGetPublicKeyFromPrivateKey(CCRSACryptorRef privkey);
-extern "C" void CCRSACryptorRelease(CCRSACryptorRef key);
-extern "C" CCCryptorStatus CCRSAGetKeyComponents(CCRSACryptorRef rsaKey, uint8_t *modulus, size_t *modulusLength, uint8_t *exponent, size_t *exponentLength, uint8_t *p, size_t *pLength, uint8_t *q, size_t *qLength);
-extern "C" CCRSAKeyType CCRSAGetKeyType(CCRSACryptorRef key);
-extern "C" CCCryptorStatus CCRSACryptorImport(const void *keyPackage, size_t keyPackageLen, CCRSACryptorRef *key);
-extern "C" CCCryptorStatus CCRSACryptorExport(CCRSACryptorRef key, void *out, size_t *outLen);
-
-#if HAVE(CCRSAGetCRTComponents)
-extern "C" CCCryptorStatus CCRSAGetCRTComponentsSizes(CCRSACryptorRef rsaKey, size_t *dpSize, size_t *dqSize, size_t *qinvSize);
-extern "C" CCCryptorStatus CCRSAGetCRTComponents(CCRSACryptorRef rsaKey, void *dp, size_t dpSize, void *dq, size_t dqSize, void *qinv, size_t qinvSize);
-#endif
-
-#ifndef _CC_ECCRYPTOR_H_
-enum {
-    ccECKeyPublic = 0,
-    ccECKeyPrivate = 1,
-};
-typedef uint32_t CCECKeyType;
-
-enum {
-    kCCImportKeyBinary = 0,
-};
-typedef uint32_t CCECKeyExternalFormat;
-#endif
-
-typedef struct _CCECCryptor *CCECCryptorRef;
-extern "C" CCCryptorStatus CCECCryptorGeneratePair(size_t keysize, CCECCryptorRef *publicKey, CCECCryptorRef *privateKey);
-extern "C" void CCECCryptorRelease(CCECCryptorRef key);
-extern "C" CCCryptorStatus CCECCryptorImportKey(CCECKeyExternalFormat format, void *keyPackage, size_t keyPackageLen, CCECKeyType keyType, CCECCryptorRef *key);
-extern "C" CCCryptorStatus CCECCryptorExportKey(CCECKeyExternalFormat format, void *keyPackage, size_t *keyPackageLen, CCECKeyType keyType, CCECCryptorRef key);
-extern "C" int CCECGetKeySize(CCECCryptorRef key);
-extern "C" CCCryptorStatus CCECCryptorCreateFromData(size_t keySize, uint8_t *qX, size_t qXLength, uint8_t *qY, size_t qYLength, CCECCryptorRef *ref);
-extern "C" CCCryptorStatus CCECCryptorGetKeyComponents(CCECCryptorRef ecKey, size_t *keySize, uint8_t *qX, size_t *qXLength, uint8_t *qY, size_t *qYLength, uint8_t *d, size_t *dLength);
-extern "C" CCCryptorStatus CCECCryptorComputeSharedSecret(CCECCryptorRef privateKey, CCECCryptorRef publicKey, void *out, size_t *outLen);
-extern "C" CCCryptorStatus CCECCryptorSignHash(CCECCryptorRef privateKey, const void *hashToSign, size_t hashSignLen, void *signedData, size_t *signedDataLen);
-extern "C" CCCryptorStatus CCECCryptorVerifyHash(CCECCryptorRef publicKey, const void *hash, size_t hashLen, const void *signedData, size_t signedDataLen, uint32_t *valid);
-
-#ifndef CommonCrypto_CommonNistKeyDerivation_h
-enum {
-    kCCKDFAlgorithmHKDF = 6
-};
-typedef uint32_t CCKDFAlgorithm;
-#endif
-
-extern "C" CCStatus CCKeyDerivationHMac(CCKDFAlgorithm algorithm, CCDigestAlgorithm digest, unsigned rounds, const void *keyDerivationKey, size_t keyDerivationKeyLen, const void *label, size_t labelLen, const void *context, size_t contextLen, const void *iv, size_t ivLen, const void *salt, size_t saltLen, void *derivedKey, size_t derivedKeyLen);
-
-#if !USE(APPLE_INTERNAL_SDK)
-extern "C" CCCryptorStatus CCCryptorGCM(CCOperation op, CCAlgorithm alg, const void* key, size_t keyLength, const void* iv, size_t ivLen, const void* aData, size_t aDataLen, const void* dataIn, size_t dataInLength, void* dataOut, void* tag, size_t* tagLength);
-extern "C" CCCryptorStatus CCRSACryptorCreateFromData(CCRSAKeyType keyType, const uint8_t *modulus, size_t modulusLength, const uint8_t *exponent, size_t exponentLength, const uint8_t *p, size_t pLength, const uint8_t *q, size_t qLength, CCRSACryptorRef *ref);
-#endif
-
 namespace WebCore {
 
 #if !HAVE(CCRSAGetCRTComponents)
index 9e966cb..7b0d258 100644 (file)
@@ -40,9 +40,12 @@ ExceptionOr<Vector<uint8_t>> CryptoAlgorithmHKDF::platformDeriveBits(const Crypt
     CCDigestAlgorithm digestAlgorithm;
     getCommonCryptoDigestAlgorithm(parameters.hashIdentifier, digestAlgorithm);
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     // <rdar://problem/32439455> Currently, when key data is empty, CCKeyDerivationHMac will bail out.
     if (CCKeyDerivationHMac(kCCKDFAlgorithmHKDF, digestAlgorithm, 0, key.key().data(), key.key().size(), 0, 0, parameters.infoVector().data(), parameters.infoVector().size(), 0, 0, parameters.saltVector().data(), parameters.saltVector().size(), result.data(), result.size()))
         return Exception { OperationError };
+#pragma clang diagnostic pop
     return WTFMove(result);
 }