Changeset 242985 in webkit


Ignore:
Timestamp:
Mar 14, 2019 7:24:23 PM (5 years ago)
Author:
Shawn Roberts
Message:

Unreviewed, rolling out r242981.

Causing internal build failures on watch/tv OS

Reverted changeset:

"Move CoreCrypto SPI declarations to an appropriate PAL/spi
header"
https://bugs.webkit.org/show_bug.cgi?id=195754
https://trac.webkit.org/changeset/242981

Location:
trunk/Source/WebCore
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r242983 r242985  
     12019-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
    1142019-03-14  Sihui Liu  <sihui_liu@apple.com>
    215
  • trunk/Source/WebCore/PAL/ChangeLog

    r242981 r242985  
     12019-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
    1142019-03-14  Brent Fulgham  <bfulgham@apple.com>
    215
  • trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj

    r242981 r242985  
    9999                0C7785A11F45130F00F4EBB6 /* TelephonyUtilitiesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C7785881F45130F00F4EBB6 /* TelephonyUtilitiesSPI.h */; };
    100100                0CF99CA41F736375007EE793 /* MediaTimeAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C00CFD11F68CE4600AAC26D /* MediaTimeAVFoundation.cpp */; };
    101                 7A36D0F9223AD9AB00B0522E /* CommonCryptoSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */; };
    102101                0CF99CA81F738437007EE793 /* CoreMediaSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0CF99CA61F738436007EE793 /* CoreMediaSoftLink.cpp */; };
    103102                0CF99CA91F738437007EE793 /* CoreMediaSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CF99CA71F738437007EE793 /* CoreMediaSoftLink.h */; };
     
    183182                0C2DA0691F33CA8400DBC317 /* CFNetworkSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFNetworkSPI.h; sourceTree = "<group>"; };
    184183                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>"; };
    186184                0C2DA06B1F33CA8400DBC317 /* CoreAudioSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAudioSPI.h; sourceTree = "<group>"; };
    187185                0C2DA06C1F33CA8400DBC317 /* CoreMediaSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreMediaSPI.h; sourceTree = "<group>"; };
     
    389387                                0C2DA1221F3BEB4900DBC317 /* AVKitSPI.h */,
    390388                                0C2DA1231F3BEB4900DBC317 /* CFNSURLConnectionSPI.h */,
    391                                 7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */,
    392389                                0C2DA1241F3BEB4900DBC317 /* CoreTextSPI.h */,
    393390                                0C2DA1251F3BEB4900DBC317 /* DataDetectorsCoreSPI.h */,
     
    683680                                0C5FFF0C1F78D990009EFF1A /* Clock.h in Headers */,
    684681                                0C5FFF101F78D9DA009EFF1A /* ClockCM.h in Headers */,
    685                                 7A36D0F9223AD9AB00B0522E /* CommonCryptoSPI.h in Headers */,
    686682                                1C09D0581E31C57E00725F18 /* config.h in Headers */,
    687683                                0C2DA0711F33CA8400DBC317 /* CoreAudioSPI.h in Headers */,
  • trunk/Source/WebCore/crypto/CommonCryptoUtilities.h

    r242981 r242985  
    2626#pragma once
    2727
     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
    2832#if ENABLE(WEB_CRYPTO)
    2933
     
    3135#include <CommonCrypto/CommonCryptor.h>
    3236#include <CommonCrypto/CommonRandom.h>
    33 #include <pal/spi/cocoa/CommonCryptoSPI.h>
    3437#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_
     52enum {
     53    kCCDigestNone = 0,
     54    kCCDigestSHA1 = 8,
     55    kCCDigestSHA224 = 9,
     56    kCCDigestSHA256 = 10,
     57    kCCDigestSHA384 = 11,
     58    kCCDigestSHA512 = 12,
     59};
     60typedef uint32_t CCDigestAlgorithm;
     61
     62enum {
     63    ccRSAKeyPublic = 0,
     64    ccRSAKeyPrivate = 1
     65};
     66typedef uint32_t CCRSAKeyType;
     67
     68enum {
     69    ccPKCS1Padding = 1001,
     70    ccOAEPPadding = 1002,
     71    ccRSAPSSPadding = 1005
     72};
     73typedef uint32_t CCAsymmetricPadding;
     74#endif
     75
     76typedef struct _CCBigNumRef *CCBigNumRef;
     77
     78typedef struct _CCRSACryptor *CCRSACryptorRef;
     79extern "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);
     80extern "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);
     81extern "C" CCCryptorStatus CCRSACryptorSign(CCRSACryptorRef privateKey, CCAsymmetricPadding padding, const void *hashToSign, size_t hashSignLen, CCDigestAlgorithm digestType, size_t saltLen, void *signedData, size_t *signedDataLen);
     82extern "C" CCCryptorStatus CCRSACryptorVerify(CCRSACryptorRef publicKey, CCAsymmetricPadding padding, const void *hash, size_t hashLen, CCDigestAlgorithm digestType, size_t saltLen, const void *signedData, size_t signedDataLen);
     83extern "C" CCCryptorStatus CCRSACryptorGeneratePair(size_t keysize, uint32_t e, CCRSACryptorRef *publicKey, CCRSACryptorRef *privateKey);
     84extern "C" CCRSACryptorRef CCRSACryptorGetPublicKeyFromPrivateKey(CCRSACryptorRef privkey);
     85extern "C" void CCRSACryptorRelease(CCRSACryptorRef key);
     86extern "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);
     87extern "C" CCRSAKeyType CCRSAGetKeyType(CCRSACryptorRef key);
     88extern "C" CCCryptorStatus CCRSACryptorImport(const void *keyPackage, size_t keyPackageLen, CCRSACryptorRef *key);
     89extern "C" CCCryptorStatus CCRSACryptorExport(CCRSACryptorRef key, void *out, size_t *outLen);
     90
     91#if HAVE(CCRSAGetCRTComponents)
     92extern "C" CCCryptorStatus CCRSAGetCRTComponentsSizes(CCRSACryptorRef rsaKey, size_t *dpSize, size_t *dqSize, size_t *qinvSize);
     93extern "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_
     97enum {
     98    ccECKeyPublic = 0,
     99    ccECKeyPrivate = 1,
     100};
     101typedef uint32_t CCECKeyType;
     102
     103enum {
     104    kCCImportKeyBinary = 0,
     105};
     106typedef uint32_t CCECKeyExternalFormat;
     107#endif
     108
     109typedef struct _CCECCryptor *CCECCryptorRef;
     110extern "C" CCCryptorStatus CCECCryptorGeneratePair(size_t keysize, CCECCryptorRef *publicKey, CCECCryptorRef *privateKey);
     111extern "C" void CCECCryptorRelease(CCECCryptorRef key);
     112extern "C" CCCryptorStatus CCECCryptorImportKey(CCECKeyExternalFormat format, void *keyPackage, size_t keyPackageLen, CCECKeyType keyType, CCECCryptorRef *key);
     113extern "C" CCCryptorStatus CCECCryptorExportKey(CCECKeyExternalFormat format, void *keyPackage, size_t *keyPackageLen, CCECKeyType keyType, CCECCryptorRef key);
     114extern "C" int CCECGetKeySize(CCECCryptorRef key);
     115extern "C" CCCryptorStatus CCECCryptorCreateFromData(size_t keySize, uint8_t *qX, size_t qXLength, uint8_t *qY, size_t qYLength, CCECCryptorRef *ref);
     116extern "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);
     117extern "C" CCCryptorStatus CCECCryptorComputeSharedSecret(CCECCryptorRef privateKey, CCECCryptorRef publicKey, void *out, size_t *outLen);
     118extern "C" CCCryptorStatus CCECCryptorSignHash(CCECCryptorRef privateKey, const void *hashToSign, size_t hashSignLen, void *signedData, size_t *signedDataLen);
     119extern "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
     122enum {
     123    kCCKDFAlgorithmHKDF = 6
     124};
     125typedef uint32_t CCKDFAlgorithm;
     126#endif
     127
     128extern "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)
     131extern "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);
     132extern "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
    35134
    36135namespace WebCore {
    37136
    38137#if !HAVE(CCRSAGetCRTComponents)
    39 
    40 typedef struct _CCBigNumRef *CCBigNumRef;
    41138
    42139// Only need CCBigNum for the code used when we don't have CCRSAGetCRTComponents.
  • trunk/Source/WebCore/crypto/mac/CryptoAlgorithmHKDFMac.cpp

    r242981 r242985  
    4141    getCommonCryptoDigestAlgorithm(parameters.hashIdentifier, digestAlgorithm);
    4242
    43 #pragma clang diagnostic push
    44 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
    4543    // <rdar://problem/32439455> Currently, when key data is empty, CCKeyDerivationHMac will bail out.
    4644    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()))
    4745        return Exception { OperationError };
    48 #pragma clang diagnostic pop
    4946    return WTFMove(result);
    5047}
Note: See TracChangeset for help on using the changeset viewer.