Changeset 242985 in webkit
- Timestamp:
- Mar 14, 2019 7:24:23 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r242983 r242985 1 2019-03-14 Shawn Roberts <sroberts@apple.com> 2 3 Unreviewed, rolling out r242981. 4 5 Causing internal build failures on watch/tv OS 6 7 Reverted changeset: 8 9 "Move CoreCrypto SPI declarations to an appropriate PAL/spi 10 header" 11 https://bugs.webkit.org/show_bug.cgi?id=195754 12 https://trac.webkit.org/changeset/242981 13 1 14 2019-03-14 Sihui Liu <sihui_liu@apple.com> 2 15 -
trunk/Source/WebCore/PAL/ChangeLog
r242981 r242985 1 2019-03-14 Shawn Roberts <sroberts@apple.com> 2 3 Unreviewed, rolling out r242981. 4 5 Causing internal build failures on watch/tv OS 6 7 Reverted changeset: 8 9 "Move CoreCrypto SPI declarations to an appropriate PAL/spi 10 header" 11 https://bugs.webkit.org/show_bug.cgi?id=195754 12 https://trac.webkit.org/changeset/242981 13 1 14 2019-03-14 Brent Fulgham <bfulgham@apple.com> 2 15 -
trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
r242981 r242985 99 99 0C7785A11F45130F00F4EBB6 /* TelephonyUtilitiesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C7785881F45130F00F4EBB6 /* TelephonyUtilitiesSPI.h */; }; 100 100 0CF99CA41F736375007EE793 /* MediaTimeAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C00CFD11F68CE4600AAC26D /* MediaTimeAVFoundation.cpp */; }; 101 7A36D0F9223AD9AB00B0522E /* CommonCryptoSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */; };102 101 0CF99CA81F738437007EE793 /* CoreMediaSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0CF99CA61F738436007EE793 /* CoreMediaSoftLink.cpp */; }; 103 102 0CF99CA91F738437007EE793 /* CoreMediaSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CF99CA71F738437007EE793 /* CoreMediaSoftLink.h */; }; … … 183 182 0C2DA0691F33CA8400DBC317 /* CFNetworkSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFNetworkSPI.h; sourceTree = "<group>"; }; 184 183 0C2DA06A1F33CA8400DBC317 /* CFUtilitiesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFUtilitiesSPI.h; sourceTree = "<group>"; }; 185 7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonCryptoSPI.h; sourceTree = "<group>"; };186 184 0C2DA06B1F33CA8400DBC317 /* CoreAudioSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAudioSPI.h; sourceTree = "<group>"; }; 187 185 0C2DA06C1F33CA8400DBC317 /* CoreMediaSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreMediaSPI.h; sourceTree = "<group>"; }; … … 389 387 0C2DA1221F3BEB4900DBC317 /* AVKitSPI.h */, 390 388 0C2DA1231F3BEB4900DBC317 /* CFNSURLConnectionSPI.h */, 391 7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */,392 389 0C2DA1241F3BEB4900DBC317 /* CoreTextSPI.h */, 393 390 0C2DA1251F3BEB4900DBC317 /* DataDetectorsCoreSPI.h */, … … 683 680 0C5FFF0C1F78D990009EFF1A /* Clock.h in Headers */, 684 681 0C5FFF101F78D9DA009EFF1A /* ClockCM.h in Headers */, 685 7A36D0F9223AD9AB00B0522E /* CommonCryptoSPI.h in Headers */,686 682 1C09D0581E31C57E00725F18 /* config.h in Headers */, 687 683 0C2DA0711F33CA8400DBC317 /* CoreAudioSPI.h in Headers */, -
trunk/Source/WebCore/crypto/CommonCryptoUtilities.h
r242981 r242985 26 26 #pragma once 27 27 28 #if (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) 29 #define HAVE_CCRSAGetCRTComponents 1 30 #endif 31 28 32 #if ENABLE(WEB_CRYPTO) 29 33 … … 31 35 #include <CommonCrypto/CommonCryptor.h> 32 36 #include <CommonCrypto/CommonRandom.h> 33 #include <pal/spi/cocoa/CommonCryptoSPI.h>34 37 #include <wtf/Vector.h> 38 39 #if USE(APPLE_INTERNAL_SDK) 40 #include <CommonCrypto/CommonCryptorSPI.h> 41 #include <CommonCrypto/CommonECCryptor.h> 42 // FIXME: <rdar://problem/31508959> 43 // #include <CommonCrypto/CommonKeyDerivationSPI.h> 44 #include <CommonCrypto/CommonRSACryptor.h> 45 #endif 46 47 #if USE(APPLE_INTERNAL_SDK) && HAVE(CCRSAGetCRTComponents) 48 #include <CommonCrypto/CommonRSACryptorSPI.h> 49 #endif 50 51 #ifndef _CC_RSACRYPTOR_H_ 52 enum { 53 kCCDigestNone = 0, 54 kCCDigestSHA1 = 8, 55 kCCDigestSHA224 = 9, 56 kCCDigestSHA256 = 10, 57 kCCDigestSHA384 = 11, 58 kCCDigestSHA512 = 12, 59 }; 60 typedef uint32_t CCDigestAlgorithm; 61 62 enum { 63 ccRSAKeyPublic = 0, 64 ccRSAKeyPrivate = 1 65 }; 66 typedef uint32_t CCRSAKeyType; 67 68 enum { 69 ccPKCS1Padding = 1001, 70 ccOAEPPadding = 1002, 71 ccRSAPSSPadding = 1005 72 }; 73 typedef uint32_t CCAsymmetricPadding; 74 #endif 75 76 typedef struct _CCBigNumRef *CCBigNumRef; 77 78 typedef struct _CCRSACryptor *CCRSACryptorRef; 79 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); 80 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); 81 extern "C" CCCryptorStatus CCRSACryptorSign(CCRSACryptorRef privateKey, CCAsymmetricPadding padding, const void *hashToSign, size_t hashSignLen, CCDigestAlgorithm digestType, size_t saltLen, void *signedData, size_t *signedDataLen); 82 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); 83 extern "C" CCCryptorStatus CCRSACryptorGeneratePair(size_t keysize, uint32_t e, CCRSACryptorRef *publicKey, CCRSACryptorRef *privateKey); 84 extern "C" CCRSACryptorRef CCRSACryptorGetPublicKeyFromPrivateKey(CCRSACryptorRef privkey); 85 extern "C" void CCRSACryptorRelease(CCRSACryptorRef key); 86 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); 87 extern "C" CCRSAKeyType CCRSAGetKeyType(CCRSACryptorRef key); 88 extern "C" CCCryptorStatus CCRSACryptorImport(const void *keyPackage, size_t keyPackageLen, CCRSACryptorRef *key); 89 extern "C" CCCryptorStatus CCRSACryptorExport(CCRSACryptorRef key, void *out, size_t *outLen); 90 91 #if HAVE(CCRSAGetCRTComponents) 92 extern "C" CCCryptorStatus CCRSAGetCRTComponentsSizes(CCRSACryptorRef rsaKey, size_t *dpSize, size_t *dqSize, size_t *qinvSize); 93 extern "C" CCCryptorStatus CCRSAGetCRTComponents(CCRSACryptorRef rsaKey, void *dp, size_t dpSize, void *dq, size_t dqSize, void *qinv, size_t qinvSize); 94 #endif 95 96 #ifndef _CC_ECCRYPTOR_H_ 97 enum { 98 ccECKeyPublic = 0, 99 ccECKeyPrivate = 1, 100 }; 101 typedef uint32_t CCECKeyType; 102 103 enum { 104 kCCImportKeyBinary = 0, 105 }; 106 typedef uint32_t CCECKeyExternalFormat; 107 #endif 108 109 typedef struct _CCECCryptor *CCECCryptorRef; 110 extern "C" CCCryptorStatus CCECCryptorGeneratePair(size_t keysize, CCECCryptorRef *publicKey, CCECCryptorRef *privateKey); 111 extern "C" void CCECCryptorRelease(CCECCryptorRef key); 112 extern "C" CCCryptorStatus CCECCryptorImportKey(CCECKeyExternalFormat format, void *keyPackage, size_t keyPackageLen, CCECKeyType keyType, CCECCryptorRef *key); 113 extern "C" CCCryptorStatus CCECCryptorExportKey(CCECKeyExternalFormat format, void *keyPackage, size_t *keyPackageLen, CCECKeyType keyType, CCECCryptorRef key); 114 extern "C" int CCECGetKeySize(CCECCryptorRef key); 115 extern "C" CCCryptorStatus CCECCryptorCreateFromData(size_t keySize, uint8_t *qX, size_t qXLength, uint8_t *qY, size_t qYLength, CCECCryptorRef *ref); 116 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); 117 extern "C" CCCryptorStatus CCECCryptorComputeSharedSecret(CCECCryptorRef privateKey, CCECCryptorRef publicKey, void *out, size_t *outLen); 118 extern "C" CCCryptorStatus CCECCryptorSignHash(CCECCryptorRef privateKey, const void *hashToSign, size_t hashSignLen, void *signedData, size_t *signedDataLen); 119 extern "C" CCCryptorStatus CCECCryptorVerifyHash(CCECCryptorRef publicKey, const void *hash, size_t hashLen, const void *signedData, size_t signedDataLen, uint32_t *valid); 120 121 #ifndef CommonCrypto_CommonNistKeyDerivation_h 122 enum { 123 kCCKDFAlgorithmHKDF = 6 124 }; 125 typedef uint32_t CCKDFAlgorithm; 126 #endif 127 128 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); 129 130 #if !USE(APPLE_INTERNAL_SDK) 131 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); 132 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); 133 #endif 35 134 36 135 namespace WebCore { 37 136 38 137 #if !HAVE(CCRSAGetCRTComponents) 39 40 typedef struct _CCBigNumRef *CCBigNumRef;41 138 42 139 // Only need CCBigNum for the code used when we don't have CCRSAGetCRTComponents. -
trunk/Source/WebCore/crypto/mac/CryptoAlgorithmHKDFMac.cpp
r242981 r242985 41 41 getCommonCryptoDigestAlgorithm(parameters.hashIdentifier, digestAlgorithm); 42 42 43 #pragma clang diagnostic push44 #pragma clang diagnostic ignored "-Wdeprecated-declarations"45 43 // <rdar://problem/32439455> Currently, when key data is empty, CCKeyDerivationHMac will bail out. 46 44 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())) 47 45 return Exception { OperationError }; 48 #pragma clang diagnostic pop49 46 return WTFMove(result); 50 47 }
Note: See TracChangeset
for help on using the changeset viewer.