haikuwebkit/Source/WebCore/crypto/CryptoKeyFormat.h

42 lines
1.5 KiB
C
Raw Permalink Normal View History

[WebIDL] Remove the need for JSSubtleCryptoCustom.cpp https://bugs.webkit.org/show_bug.cgi?id=175526 Patch by Sam Weinig <sam@webkit.org> on 2017-08-16 Reviewed by Chris Dumez. Source/WebCore: - Generates bindings for all of SubtleCrypto except AlgorithmIdentifier normalization, which is defined in the WebCrypto spec to happen after normal IDL operations. - Adds initial support for IDL object types in unions (some, unneeded at the moment, edge cases remain). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSSubtleCryptoCustom.cpp: Removed. Remove JSSubtleCryptoCustom.cpp, added CryptoKeyFormat.h * bindings/js/JSDOMConvertObject.h: Add needed, when included in generated code, #include of StrongInlines.h * bindings/js/JSDOMConvertUnion.h: Add initial support for object (needed for AlgorithmIdentifier which is (object or DOMString)). Remaining support will be handled by https://webkit.org/b/175616 Also add remaining spec comments while in the area. * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::DeferredPromise::reject): Add support for the special ExistingExceptionError error code. Capturing the current exception and using it as the rejection value. * crypto/SubtleCrypto.cpp: (WebCore::SubtleCrypto::~SubtleCrypto): (WebCore::toHashIdentifier): (WebCore::normalizeCryptoAlgorithmParameters): (WebCore::toCryptoKeyUsageBitmap): (WebCore::rejectWithException): (WebCore::normalizeJsonWebKey): (WebCore::toKeyData): (WebCore::copyToVector): (WebCore::isSupportedExportKey): (WebCore::SubtleCrypto::encrypt): (WebCore::SubtleCrypto::decrypt): (WebCore::SubtleCrypto::sign): (WebCore::SubtleCrypto::verify): (WebCore::SubtleCrypto::digest): (WebCore::SubtleCrypto::generateKey): (WebCore::SubtleCrypto::deriveKey): (WebCore::SubtleCrypto::deriveBits): (WebCore::SubtleCrypto::importKey): (WebCore::SubtleCrypto::exportKey): (WebCore::SubtleCrypto::wrapKey): (WebCore::SubtleCrypto::unwrapKey): * crypto/SubtleCrypto.h: * crypto/SubtleCrypto.idl: Moves implementation from JSSubtleCryptoCustom.cpp -> here. Important changes that come with that are: - All parameters are now converted / type checked for us. - Rather than throwing exceptions and expecting the bindings layer to convert them to promise rejections, all rejections are now explicitly made. - Algorithms are no longer checked for being supported twice, once in normalizeCryptoAlgorithmParameters and then again in the operation. We instead rely on normalizeCryptoAlgorithmParameters to return an Exception if its not supported. - Shaves 251 lines off the file. * crypto/CryptoKeyFormat.h: Added. Add new header for unified key format enum. (For bindings purposes, SubtleCrypto re aliases it to SubtleCrypto::KeyFormat). * bindings/js/JSWebKitSubtleCryptoCustom.cpp: * crypto/CryptoAlgorithm.cpp: * crypto/CryptoAlgorithm.h: * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp: * crypto/algorithms/CryptoAlgorithmAES_CBC.h: * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp: * crypto/algorithms/CryptoAlgorithmAES_CFB.h: * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp: * crypto/algorithms/CryptoAlgorithmAES_CTR.h: * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: * crypto/algorithms/CryptoAlgorithmAES_GCM.h: * crypto/algorithms/CryptoAlgorithmAES_KW.cpp: * crypto/algorithms/CryptoAlgorithmAES_KW.h: * crypto/algorithms/CryptoAlgorithmECDH.cpp: * crypto/algorithms/CryptoAlgorithmECDH.h: * crypto/algorithms/CryptoAlgorithmECDSA.cpp: * crypto/algorithms/CryptoAlgorithmECDSA.h: * crypto/algorithms/CryptoAlgorithmHKDF.cpp: * crypto/algorithms/CryptoAlgorithmHKDF.h: * crypto/algorithms/CryptoAlgorithmHMAC.cpp: * crypto/algorithms/CryptoAlgorithmHMAC.h: * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp: * crypto/algorithms/CryptoAlgorithmPBKDF2.h: * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp: * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h: * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h: * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp: * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h: * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp: * crypto/algorithms/CryptoAlgorithmRSA_PSS.h: Use CryptoKeyFormat enum directly, rather than SubtleCrypto::KeyFormat, to allow not including SubtleCrypto.h. * crypto/parameters/CryptoAlgorithmEcdsaParams.h: * crypto/parameters/CryptoAlgorithmHkdfParams.h: * crypto/parameters/CryptoAlgorithmHmacKeyParams.h: * crypto/parameters/CryptoAlgorithmPbkdf2Params.h: * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h: * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h: * crypto/parameters/EcdsaParams.idl: * crypto/parameters/HkdfParams.idl: * crypto/parameters/HmacKeyParams.idl: * crypto/parameters/Pbkdf2Params.idl: * crypto/parameters/RsaHashedImportParams.idl: * crypto/parameters/RsaHashedKeyGenParams.idl: Update IDLs and implementations to use the correct definition of HashAlgorithmIdentifier, which is (object or DOMString), now that it is supported. LayoutTests: * crypto/subtle/encrypt-malformed-parameters-expected.txt: * crypto/subtle/export-key-malformed-parameters-expected.txt: * crypto/subtle/generate-key-malformed-parameters-expected.txt: * crypto/subtle/hkdf-derive-bits-malformed-parametrs-expected.txt: * crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt: * crypto/subtle/import-key-malformed-parameters-expected.txt: * crypto/subtle/pbkdf2-derive-bits-malformed-parametrs-expected.txt: * crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt: * platform/mac-highsierra/crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt: Update expectations with improved error messages. Canonical link: https://commits.webkit.org/192310@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-08-16 22:11:18 +00:00
/*
* Copyright (C) 2017 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
Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO https://bugs.webkit.org/show_bug.cgi?id=192197 Reviewed by Jiewen Tan. .: * Source/cmake/OptionsGTK.cmake: * Source/cmake/OptionsWPE.cmake: * Source/cmake/OptionsWin.cmake: * Source/cmake/WebKitFeatures.cmake: Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: Source/WebCore: No new tests. No change in behavior. * Configurations/FeatureDefines.xcconfig: * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneDeserializer::readTerminal): * crypto/CommonCryptoUtilities.cpp: * crypto/CommonCryptoUtilities.h: * crypto/CryptoAlgorithm.cpp: * crypto/CryptoAlgorithm.h: * crypto/CryptoAlgorithmIdentifier.h: * crypto/CryptoAlgorithmParameters.h: * crypto/CryptoAlgorithmParameters.idl: * crypto/CryptoAlgorithmRegistry.cpp: * crypto/CryptoAlgorithmRegistry.h: * crypto/CryptoKey.cpp: * crypto/CryptoKey.h: * crypto/CryptoKey.idl: * crypto/CryptoKeyFormat.h: * crypto/CryptoKeyPair.h: * crypto/CryptoKeyPair.idl: * crypto/CryptoKeyType.h: * crypto/CryptoKeyUsage.h: * crypto/CryptoKeyUsage.idl: * crypto/JsonWebKey.h: * crypto/JsonWebKey.idl: * crypto/RsaOtherPrimesInfo.h: * crypto/RsaOtherPrimesInfo.idl: * crypto/SerializedCryptoKeyWrap.h: * crypto/SubtleCrypto.cpp: * crypto/SubtleCrypto.h: * crypto/SubtleCrypto.idl: * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp: * crypto/algorithms/CryptoAlgorithmAES_CBC.h: * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp: * crypto/algorithms/CryptoAlgorithmAES_CFB.h: * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp: * crypto/algorithms/CryptoAlgorithmAES_CTR.h: * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: * crypto/algorithms/CryptoAlgorithmAES_GCM.h: * crypto/algorithms/CryptoAlgorithmAES_KW.cpp: * crypto/algorithms/CryptoAlgorithmAES_KW.h: * crypto/algorithms/CryptoAlgorithmECDH.cpp: * crypto/algorithms/CryptoAlgorithmECDH.h: * crypto/algorithms/CryptoAlgorithmECDSA.cpp: * crypto/algorithms/CryptoAlgorithmECDSA.h: * crypto/algorithms/CryptoAlgorithmHKDF.cpp: * crypto/algorithms/CryptoAlgorithmHKDF.h: * crypto/algorithms/CryptoAlgorithmHMAC.cpp: * crypto/algorithms/CryptoAlgorithmHMAC.h: * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp: * crypto/algorithms/CryptoAlgorithmPBKDF2.h: * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp: * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h: * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h: * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp: * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h: * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp: * crypto/algorithms/CryptoAlgorithmRSA_PSS.h: * crypto/algorithms/CryptoAlgorithmSHA1.cpp: * crypto/algorithms/CryptoAlgorithmSHA1.h: * crypto/algorithms/CryptoAlgorithmSHA224.cpp: * crypto/algorithms/CryptoAlgorithmSHA224.h: * crypto/algorithms/CryptoAlgorithmSHA256.cpp: * crypto/algorithms/CryptoAlgorithmSHA256.h: * crypto/algorithms/CryptoAlgorithmSHA384.cpp: * crypto/algorithms/CryptoAlgorithmSHA384.h: * crypto/algorithms/CryptoAlgorithmSHA512.cpp: * crypto/algorithms/CryptoAlgorithmSHA512.h: * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: * crypto/gcrypt/CryptoKeyECGCrypt.cpp: * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: * crypto/keys/CryptoAesKeyAlgorithm.idl: * crypto/keys/CryptoEcKeyAlgorithm.idl: * crypto/keys/CryptoHmacKeyAlgorithm.idl: * crypto/keys/CryptoKeyAES.cpp: * crypto/keys/CryptoKeyAES.h: * crypto/keys/CryptoKeyAlgorithm.idl: * crypto/keys/CryptoKeyEC.cpp: * crypto/keys/CryptoKeyEC.h: * crypto/keys/CryptoKeyHMAC.cpp: * crypto/keys/CryptoKeyHMAC.h: * crypto/keys/CryptoKeyRSA.cpp: * crypto/keys/CryptoKeyRSA.h: * crypto/keys/CryptoKeyRSAComponents.cpp: * crypto/keys/CryptoKeyRSAComponents.h: * crypto/keys/CryptoKeyRaw.cpp: * crypto/keys/CryptoKeyRaw.h: * crypto/keys/CryptoRsaHashedKeyAlgorithm.idl: * crypto/keys/CryptoRsaKeyAlgorithm.idl: * crypto/mac/CommonCryptoDERUtilities.cpp: * crypto/mac/CommonCryptoDERUtilities.h: * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp: * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp: * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: * crypto/mac/CryptoAlgorithmAES_KWMac.cpp: * crypto/mac/CryptoAlgorithmECDHMac.cpp: * crypto/mac/CryptoAlgorithmECDSAMac.cpp: * crypto/mac/CryptoAlgorithmHKDFMac.cpp: * crypto/mac/CryptoAlgorithmHMACMac.cpp: * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp: * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp: * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp: * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp: * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp: * crypto/mac/CryptoAlgorithmRegistryMac.cpp: * crypto/mac/CryptoDigestAlgorithm.h: * crypto/mac/CryptoKeyECMac.cpp: * crypto/mac/CryptoKeyMac.cpp: * crypto/mac/CryptoKeyRSAMac.cpp: * crypto/mac/SerializedCryptoKeyWrapMac.mm: * crypto/parameters/AesCbcCfbParams.idl: * crypto/parameters/AesCtrParams.idl: * crypto/parameters/AesGcmParams.idl: * crypto/parameters/AesKeyParams.idl: * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h: * crypto/parameters/CryptoAlgorithmAesCtrParams.h: * crypto/parameters/CryptoAlgorithmAesGcmParams.h: * crypto/parameters/CryptoAlgorithmAesKeyParams.h: * crypto/parameters/CryptoAlgorithmEcKeyParams.h: * crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h: * crypto/parameters/CryptoAlgorithmEcdsaParams.h: * crypto/parameters/CryptoAlgorithmHkdfParams.h: * crypto/parameters/CryptoAlgorithmHmacKeyParams.h: * crypto/parameters/CryptoAlgorithmPbkdf2Params.h: * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h: * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h: * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: * crypto/parameters/CryptoAlgorithmRsaOaepParams.h: * crypto/parameters/CryptoAlgorithmRsaPssParams.h: * crypto/parameters/EcKeyParams.idl: * crypto/parameters/EcdhKeyDeriveParams.idl: * crypto/parameters/EcdsaParams.idl: * crypto/parameters/HkdfParams.idl: * crypto/parameters/HmacKeyParams.idl: * crypto/parameters/Pbkdf2Params.idl: * crypto/parameters/RsaHashedImportParams.idl: * crypto/parameters/RsaHashedKeyGenParams.idl: * crypto/parameters/RsaKeyGenParams.idl: * crypto/parameters/RsaOaepParams.idl: * crypto/parameters/RsaPssParams.idl: * dom/Document.cpp: * dom/Document.h: * dom/ScriptExecutionContext.h: * page/ChromeClient.h: * page/Crypto.cpp: (WebCore::Crypto::Crypto): * page/Crypto.h: * page/Crypto.idl: * platform/GCrypt.cmake: * platform/LocalizedStrings.cpp: * platform/LocalizedStrings.h: * workers/WorkerGlobalScope.cpp: * workers/WorkerGlobalScope.h: * worklets/WorkletGlobalScope.h: Source/WebCore/PAL: * Configurations/FeatureDefines.xcconfig: * pal/PlatformGTK.cmake: * pal/PlatformWPE.cmake: Source/WebKit: * Configurations/FeatureDefines.xcconfig: * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebChromeClient.h: Source/WebKitLegacy/mac: * Configurations/FeatureDefines.xcconfig: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: Tools: * Scripts/webkitperl/FeatureList.pm: * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Canonical link: https://commits.webkit.org/206898@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-30 22:23:17 +00:00
#if ENABLE(WEB_CRYPTO)
[WebIDL] Remove the need for JSSubtleCryptoCustom.cpp https://bugs.webkit.org/show_bug.cgi?id=175526 Patch by Sam Weinig <sam@webkit.org> on 2017-08-16 Reviewed by Chris Dumez. Source/WebCore: - Generates bindings for all of SubtleCrypto except AlgorithmIdentifier normalization, which is defined in the WebCrypto spec to happen after normal IDL operations. - Adds initial support for IDL object types in unions (some, unneeded at the moment, edge cases remain). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSSubtleCryptoCustom.cpp: Removed. Remove JSSubtleCryptoCustom.cpp, added CryptoKeyFormat.h * bindings/js/JSDOMConvertObject.h: Add needed, when included in generated code, #include of StrongInlines.h * bindings/js/JSDOMConvertUnion.h: Add initial support for object (needed for AlgorithmIdentifier which is (object or DOMString)). Remaining support will be handled by https://webkit.org/b/175616 Also add remaining spec comments while in the area. * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::DeferredPromise::reject): Add support for the special ExistingExceptionError error code. Capturing the current exception and using it as the rejection value. * crypto/SubtleCrypto.cpp: (WebCore::SubtleCrypto::~SubtleCrypto): (WebCore::toHashIdentifier): (WebCore::normalizeCryptoAlgorithmParameters): (WebCore::toCryptoKeyUsageBitmap): (WebCore::rejectWithException): (WebCore::normalizeJsonWebKey): (WebCore::toKeyData): (WebCore::copyToVector): (WebCore::isSupportedExportKey): (WebCore::SubtleCrypto::encrypt): (WebCore::SubtleCrypto::decrypt): (WebCore::SubtleCrypto::sign): (WebCore::SubtleCrypto::verify): (WebCore::SubtleCrypto::digest): (WebCore::SubtleCrypto::generateKey): (WebCore::SubtleCrypto::deriveKey): (WebCore::SubtleCrypto::deriveBits): (WebCore::SubtleCrypto::importKey): (WebCore::SubtleCrypto::exportKey): (WebCore::SubtleCrypto::wrapKey): (WebCore::SubtleCrypto::unwrapKey): * crypto/SubtleCrypto.h: * crypto/SubtleCrypto.idl: Moves implementation from JSSubtleCryptoCustom.cpp -> here. Important changes that come with that are: - All parameters are now converted / type checked for us. - Rather than throwing exceptions and expecting the bindings layer to convert them to promise rejections, all rejections are now explicitly made. - Algorithms are no longer checked for being supported twice, once in normalizeCryptoAlgorithmParameters and then again in the operation. We instead rely on normalizeCryptoAlgorithmParameters to return an Exception if its not supported. - Shaves 251 lines off the file. * crypto/CryptoKeyFormat.h: Added. Add new header for unified key format enum. (For bindings purposes, SubtleCrypto re aliases it to SubtleCrypto::KeyFormat). * bindings/js/JSWebKitSubtleCryptoCustom.cpp: * crypto/CryptoAlgorithm.cpp: * crypto/CryptoAlgorithm.h: * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp: * crypto/algorithms/CryptoAlgorithmAES_CBC.h: * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp: * crypto/algorithms/CryptoAlgorithmAES_CFB.h: * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp: * crypto/algorithms/CryptoAlgorithmAES_CTR.h: * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: * crypto/algorithms/CryptoAlgorithmAES_GCM.h: * crypto/algorithms/CryptoAlgorithmAES_KW.cpp: * crypto/algorithms/CryptoAlgorithmAES_KW.h: * crypto/algorithms/CryptoAlgorithmECDH.cpp: * crypto/algorithms/CryptoAlgorithmECDH.h: * crypto/algorithms/CryptoAlgorithmECDSA.cpp: * crypto/algorithms/CryptoAlgorithmECDSA.h: * crypto/algorithms/CryptoAlgorithmHKDF.cpp: * crypto/algorithms/CryptoAlgorithmHKDF.h: * crypto/algorithms/CryptoAlgorithmHMAC.cpp: * crypto/algorithms/CryptoAlgorithmHMAC.h: * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp: * crypto/algorithms/CryptoAlgorithmPBKDF2.h: * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp: * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h: * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h: * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp: * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h: * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp: * crypto/algorithms/CryptoAlgorithmRSA_PSS.h: Use CryptoKeyFormat enum directly, rather than SubtleCrypto::KeyFormat, to allow not including SubtleCrypto.h. * crypto/parameters/CryptoAlgorithmEcdsaParams.h: * crypto/parameters/CryptoAlgorithmHkdfParams.h: * crypto/parameters/CryptoAlgorithmHmacKeyParams.h: * crypto/parameters/CryptoAlgorithmPbkdf2Params.h: * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h: * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h: * crypto/parameters/EcdsaParams.idl: * crypto/parameters/HkdfParams.idl: * crypto/parameters/HmacKeyParams.idl: * crypto/parameters/Pbkdf2Params.idl: * crypto/parameters/RsaHashedImportParams.idl: * crypto/parameters/RsaHashedKeyGenParams.idl: Update IDLs and implementations to use the correct definition of HashAlgorithmIdentifier, which is (object or DOMString), now that it is supported. LayoutTests: * crypto/subtle/encrypt-malformed-parameters-expected.txt: * crypto/subtle/export-key-malformed-parameters-expected.txt: * crypto/subtle/generate-key-malformed-parameters-expected.txt: * crypto/subtle/hkdf-derive-bits-malformed-parametrs-expected.txt: * crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt: * crypto/subtle/import-key-malformed-parameters-expected.txt: * crypto/subtle/pbkdf2-derive-bits-malformed-parametrs-expected.txt: * crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt: * platform/mac-highsierra/crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt: Update expectations with improved error messages. Canonical link: https://commits.webkit.org/192310@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-08-16 22:11:18 +00:00
namespace WebCore {
enum class CryptoKeyFormat {
Raw,
Spki,
Pkcs8,
Jwk
};
}
#endif