Skip to content

Commit

Permalink
Remove ENABLE_WEB_CRYPTO directive
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=266968

Reviewed by Michael Catanzaro.

Also address a couple tiny nits, in particular enum class type
declarations and namespace closing comments.

* Source/WTF/wtf/PlatformEnableCocoa.h:
* Source/WebCore/PAL/pal/PlatformGTK.cmake:
* Source/WebCore/PAL/pal/PlatformWPE.cmake:
* Source/WebCore/bindings/js/SerializedScriptValue.cpp:
(WebCore::isTypeExposedToGlobalObject):
(WebCore::unwrapCryptoKey):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneSerializer::write):
(WebCore::CloneDeserializer::readCryptoKey):
(WebCore::CloneDeserializer::readTerminal):
* Source/WebCore/crypto/CommonCryptoUtilities.cpp:
* Source/WebCore/crypto/CommonCryptoUtilities.h:
* Source/WebCore/crypto/CryptoAlgorithm.cpp:
* Source/WebCore/crypto/CryptoAlgorithm.h:
* Source/WebCore/crypto/CryptoAlgorithmIdentifier.h:
* Source/WebCore/crypto/CryptoAlgorithmParameters.h:
* Source/WebCore/crypto/CryptoAlgorithmParameters.idl:
* Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp:
* Source/WebCore/crypto/CryptoAlgorithmRegistry.h:
* Source/WebCore/crypto/CryptoKey.cpp:
* Source/WebCore/crypto/CryptoKey.h:
* Source/WebCore/crypto/CryptoKey.idl:
* Source/WebCore/crypto/CryptoKeyFormat.h:
* Source/WebCore/crypto/CryptoKeyPair.h:
* Source/WebCore/crypto/CryptoKeyPair.idl:
* Source/WebCore/crypto/CryptoKeyType.h:
* Source/WebCore/crypto/CryptoKeyUsage.h:
* Source/WebCore/crypto/CryptoKeyUsage.idl:
* Source/WebCore/crypto/JsonWebKey.h:
* Source/WebCore/crypto/JsonWebKey.idl:
* Source/WebCore/crypto/RsaOtherPrimesInfo.h:
* Source/WebCore/crypto/RsaOtherPrimesInfo.idl:
* Source/WebCore/crypto/SerializedCryptoKeyWrap.h:
* Source/WebCore/crypto/SubtleCrypto.cpp:
* Source/WebCore/crypto/SubtleCrypto.h:
* Source/WebCore/crypto/SubtleCrypto.idl:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CFB.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CTR.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_GCM.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmECDH.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmECDSA.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmECDSA.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmEd25519.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmEd25519.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmHKDF.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmHKDF.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmPBKDF2.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.h:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmX25519.cpp:
* Source/WebCore/crypto/algorithms/CryptoAlgorithmX25519.h:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmEd25519GCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoAlgorithmX25519GCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoKeyOKPGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
* Source/WebCore/crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp:
* Source/WebCore/crypto/keys/CryptoAesKeyAlgorithm.idl:
* Source/WebCore/crypto/keys/CryptoEcKeyAlgorithm.idl:
* Source/WebCore/crypto/keys/CryptoHmacKeyAlgorithm.idl:
* Source/WebCore/crypto/keys/CryptoKeyAES.cpp:
* Source/WebCore/crypto/keys/CryptoKeyAES.h:
* Source/WebCore/crypto/keys/CryptoKeyAlgorithm.idl:
* Source/WebCore/crypto/keys/CryptoKeyEC.cpp:
* Source/WebCore/crypto/keys/CryptoKeyEC.h:
* Source/WebCore/crypto/keys/CryptoKeyHMAC.cpp:
* Source/WebCore/crypto/keys/CryptoKeyHMAC.h:
* Source/WebCore/crypto/keys/CryptoKeyOKP.cpp:
* Source/WebCore/crypto/keys/CryptoKeyOKP.h:
* Source/WebCore/crypto/keys/CryptoKeyRSA.cpp:
* Source/WebCore/crypto/keys/CryptoKeyRSA.h:
* Source/WebCore/crypto/keys/CryptoKeyRSAComponents.cpp:
* Source/WebCore/crypto/keys/CryptoKeyRSAComponents.h:
* Source/WebCore/crypto/keys/CryptoKeyRaw.cpp:
* Source/WebCore/crypto/keys/CryptoKeyRaw.h:
* Source/WebCore/crypto/keys/CryptoRsaHashedKeyAlgorithm.idl:
* Source/WebCore/crypto/keys/CryptoRsaKeyAlgorithm.idl:
* Source/WebCore/crypto/mac/CommonCryptoDERUtilities.cpp:
* Source/WebCore/crypto/mac/CommonCryptoDERUtilities.h:
* Source/WebCore/crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmECDHMac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmECDSAMac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmEd25519Cocoa.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmHKDFMac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmHMACMac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmRegistryMac.cpp:
* Source/WebCore/crypto/mac/CryptoAlgorithmX25519Cocoa.cpp:
* Source/WebCore/crypto/mac/CryptoDigestAlgorithm.h:
* Source/WebCore/crypto/mac/CryptoKeyECMac.cpp:
* Source/WebCore/crypto/mac/CryptoKeyMac.cpp:
* Source/WebCore/crypto/mac/CryptoKeyOKPCocoa.cpp:
* Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp:
* Source/WebCore/crypto/mac/CryptoUtilitiesCocoa.cpp:
* Source/WebCore/crypto/mac/CryptoUtilitiesCocoa.h:
* Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm:
* Source/WebCore/crypto/openssl/CryptoAlgorithmAES_CBCOpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmAES_CFBOpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmAES_CTROpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmAES_GCMOpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmAES_KWOpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmECDHOpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmECDSAOpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmHKDFOpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmHMACOpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmPBKDF2OpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmRSAES_PKCS1_v1_5OpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmRSASSA_PKCS1_v1_5OpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmRSA_OAEPOpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmRSA_PSSOpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoKeyECOpenSSL.cpp:
* Source/WebCore/crypto/openssl/CryptoKeyRSAOpenSSL.cpp:
* Source/WebCore/crypto/openssl/OpenSSLUtilities.cpp:
* Source/WebCore/crypto/openssl/OpenSSLUtilities.h:
* Source/WebCore/crypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp:
* Source/WebCore/crypto/parameters/AesCbcCfbParams.idl:
* Source/WebCore/crypto/parameters/AesCtrParams.idl:
* Source/WebCore/crypto/parameters/AesGcmParams.idl:
* Source/WebCore/crypto/parameters/AesKeyParams.idl:
* Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmAesCtrParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmAesGcmParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmAesKeyParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmEcKeyParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmEcdsaParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmHkdfParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmRsaPssParams.h:
* Source/WebCore/crypto/parameters/CryptoAlgorithmX25519Params.h:
* Source/WebCore/crypto/parameters/EcKeyParams.idl:
* Source/WebCore/crypto/parameters/EcdhKeyDeriveParams.idl:
* Source/WebCore/crypto/parameters/EcdsaParams.idl:
* Source/WebCore/crypto/parameters/HkdfParams.idl:
* Source/WebCore/crypto/parameters/HmacKeyParams.idl:
* Source/WebCore/crypto/parameters/Pbkdf2Params.idl:
* Source/WebCore/crypto/parameters/RsaHashedImportParams.idl:
* Source/WebCore/crypto/parameters/RsaHashedKeyGenParams.idl:
* Source/WebCore/crypto/parameters/RsaKeyGenParams.idl:
* Source/WebCore/crypto/parameters/RsaOaepParams.idl:
* Source/WebCore/crypto/parameters/RsaPssParams.idl:
* Source/WebCore/crypto/parameters/X25519Params.idl:
* Source/WebCore/dom/Document.cpp:
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/EmptyScriptExecutionContext.h:
* Source/WebCore/dom/ScriptExecutionContext.h:
* Source/WebCore/page/ChromeClient.h:
(WebCore::ChromeClient::unwrapCryptoKey const):
* Source/WebCore/page/Crypto.cpp:
(WebCore::Crypto::Crypto):
* Source/WebCore/page/Crypto.h:
* Source/WebCore/page/Crypto.idl:
* Source/WebCore/platform/GCrypt.cmake:
* Source/WebCore/platform/LocalizedStrings.cpp:
(WebCore::webCryptoMasterKeyKeychainLabel):
* Source/WebCore/platform/LocalizedStrings.h:
* Source/WebCore/platform/OpenSSL.cmake:
* Source/WebCore/workers/WorkerGlobalScope.cpp:
* Source/WebCore/workers/WorkerGlobalScope.h:
* Source/WebCore/worklets/WorkletGlobalScope.h:
* Source/WebKit/UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::unwrapCryptoKey):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:
* Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h:
* Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Tools/Scripts/webkitperl/FeatureList.pm:

Canonical link: https://commits.webkit.org/272561@main
  • Loading branch information
annevk committed Jan 2, 2024
1 parent 9240183 commit cab109e
Show file tree
Hide file tree
Showing 221 changed files with 86 additions and 860 deletions.
4 changes: 0 additions & 4 deletions Source/WTF/wtf/PlatformEnableCocoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -911,10 +911,6 @@
#define ENABLE_WEB_CODECS 1
#endif

#if !defined(ENABLE_WEB_CRYPTO)
#define ENABLE_WEB_CRYPTO 1
#endif

#if !defined(ENABLE_WEB_PLAYBACK_CONTROLS_MANAGER) && PLATFORM(MAC)
#define ENABLE_WEB_PLAYBACK_CONTROLS_MANAGER 1
#endif
Expand Down
14 changes: 4 additions & 10 deletions Source/WebCore/PAL/pal/PlatformGTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ list(APPEND PAL_PUBLIC_HEADERS
crypto/gcrypt/Initialization.h
crypto/gcrypt/Utilities.h

crypto/tasn1/Utilities.h

system/glib/SleepDisablerGLib.h
)

list(APPEND PAL_SOURCES
crypto/gcrypt/CryptoDigestGCrypt.cpp

crypto/tasn1/Utilities.cpp

system/ClockGeneric.cpp

system/glib/SleepDisablerGLib.cpp
Expand All @@ -20,16 +24,6 @@ list(APPEND PAL_SOURCES
unix/LoggingUnix.cpp
)

if (ENABLE_WEB_CRYPTO)
list(APPEND PAL_PUBLIC_HEADERS
crypto/tasn1/Utilities.h
)

list(APPEND PAL_SOURCES
crypto/tasn1/Utilities.cpp
)
endif ()

list(APPEND PAL_LIBRARIES
GTK::GTK
)
14 changes: 4 additions & 10 deletions Source/WebCore/PAL/pal/PlatformWPE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ list(APPEND PAL_PUBLIC_HEADERS
crypto/gcrypt/Initialization.h
crypto/gcrypt/Utilities.h

crypto/tasn1/Utilities.h

system/glib/SleepDisablerGLib.h
)

list(APPEND PAL_SOURCES
crypto/gcrypt/CryptoDigestGCrypt.cpp

crypto/tasn1/Utilities.cpp

system/ClockGeneric.cpp
system/Sound.cpp

Expand All @@ -19,16 +23,6 @@ list(APPEND PAL_SOURCES
unix/LoggingUnix.cpp
)

if (ENABLE_WEB_CRYPTO)
list(APPEND PAL_PUBLIC_HEADERS
crypto/tasn1/Utilities.h
)

list(APPEND PAL_SOURCES
crypto/tasn1/Utilities.cpp
)
endif ()

list(APPEND PAL_SYSTEM_INCLUDE_DIRECTORIES
${GLIB_INCLUDE_DIRS}
)
20 changes: 0 additions & 20 deletions Source/WebCore/bindings/js/SerializedScriptValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,7 @@ enum SerializationTag {
MapObjectTag = 30,
NonMapPropertiesTag = 31,
NonSetPropertiesTag = 32,
#if ENABLE(WEB_CRYPTO)
CryptoKeyTag = 33,
#endif
SharedArrayBufferTag = 34,
#if ENABLE(WEBASSEMBLY)
WasmModuleTag = 35,
Expand Down Expand Up @@ -301,9 +299,7 @@ static bool isTypeExposedToGlobalObject(JSC::JSGlobalObject& globalObject, Seria
case FileListTag:
case ImageDataTag:
case BlobTag:
#if ENABLE(WEB_CRYPTO)
case CryptoKeyTag:
#endif
case DOMPointReadOnlyTag:
case DOMPointTag:
case DOMRectReadOnlyTag:
Expand Down Expand Up @@ -444,8 +440,6 @@ static String agentClusterIDFromGlobalObject(JSGlobalObject& globalObject)
}
#endif

#if ENABLE(WEB_CRYPTO)

const uint32_t currentKeyFormatVersion = 1;

enum class CryptoKeyClassSubtag {
Expand Down Expand Up @@ -520,8 +514,6 @@ enum class CryptoKeyOKPOpNameTag {
const uint8_t cryptoKeyOKPOpNameTagMaximumValue = 1;


#endif

/* CurrentVersion tracks the serialization version so that persistent stores
* are able to correctly bail out in the case of encountering newer formats.
*
Expand Down Expand Up @@ -756,7 +748,6 @@ class CloneBase {
MarkedArgumentBuffer m_gcBuffer;
};

#if ENABLE(WEB_CRYPTO)
static bool wrapCryptoKey(JSGlobalObject* lexicalGlobalObject, const Vector<uint8_t>& key, Vector<uint8_t>& wrappedKey)
{
auto context = executionContext(lexicalGlobalObject);
Expand All @@ -768,7 +759,6 @@ static bool unwrapCryptoKey(JSGlobalObject* lexicalGlobalObject, const Vector<ui
auto context = executionContext(lexicalGlobalObject);
return context && context->unwrapCryptoKey(wrappedKey, key);
}
#endif

#if ASSUME_LITTLE_ENDIAN
template <typename T> static void writeLittleEndian(Vector<uint8_t>& buffer, T value)
Expand Down Expand Up @@ -1725,7 +1715,6 @@ class CloneSerializer : CloneBase {
recordObject(obj);
return success;
}
#if ENABLE(WEB_CRYPTO)
if (auto* key = JSCryptoKey::toWrapped(vm, obj)) {
write(CryptoKeyTag);
Vector<uint8_t> serializedKey;
Expand Down Expand Up @@ -1774,7 +1763,6 @@ class CloneSerializer : CloneBase {
write(wrappedKey);
return true;
}
#endif
#if ENABLE(WEB_RTC)
if (auto* rtcCertificate = JSRTCCertificate::toWrapped(vm, obj)) {
write(RTCCertificateTag);
Expand Down Expand Up @@ -1907,7 +1895,6 @@ class CloneSerializer : CloneBase {
writeLittleEndian<uint8_t>(m_buffer, static_cast<uint8_t>(tag));
}

#if ENABLE(WEB_CRYPTO)
void write(CryptoKeyClassSubtag tag)
{
writeLittleEndian<uint8_t>(m_buffer, static_cast<uint8_t>(tag));
Expand All @@ -1932,7 +1919,6 @@ class CloneSerializer : CloneBase {
{
writeLittleEndian<uint8_t>(m_buffer, static_cast<uint8_t>(tag));
}
#endif

void write(bool b)
{
Expand Down Expand Up @@ -2143,7 +2129,6 @@ class CloneSerializer : CloneBase {
write(DestinationColorSpaceSRGBTag);
}

#if ENABLE(WEB_CRYPTO)
void write(CryptoKeyOKP::NamedCurve curve)
{
switch (curve) {
Expand Down Expand Up @@ -2348,7 +2333,6 @@ class CloneSerializer : CloneBase {
break;
}
}
#endif

void write(const uint8_t* data, unsigned length)
{
Expand Down Expand Up @@ -3406,7 +3390,6 @@ class CloneDeserializer : CloneBase {
return false;
}

#if ENABLE(WEB_CRYPTO)
bool read(CryptoKeyOKP::NamedCurve& result)
{
uint8_t nameTag;
Expand Down Expand Up @@ -3778,7 +3761,6 @@ class CloneDeserializer : CloneBase {
cryptoKey = getJSValue(result.get());
return true;
}
#endif

bool read(SerializableErrorType& errorType)
{
Expand Down Expand Up @@ -4663,7 +4645,6 @@ class CloneDeserializer : CloneBase {
m_gcBuffer.appendWithCrashOnOverflow(arrayBufferView);
return arrayBufferView;
}
#if ENABLE(WEB_CRYPTO)
case CryptoKeyTag: {
Vector<uint8_t> wrappedKey;
if (!read(wrappedKey)) {
Expand All @@ -4685,7 +4666,6 @@ class CloneDeserializer : CloneBase {
m_gcBuffer.appendWithCrashOnOverflow(cryptoKey);
return cryptoKey;
}
#endif
case DOMPointReadOnlyTag:
return readDOMPoint<DOMPointReadOnly>();
case DOMPointTag:
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/crypto/CommonCryptoUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include "config.h"
#include "CommonCryptoUtilities.h"

#if ENABLE(WEB_CRYPTO)

namespace WebCore {

bool getCommonCryptoDigestAlgorithm(CryptoAlgorithmIdentifier hashFunction, CCDigestAlgorithm& algorithm)
Expand Down Expand Up @@ -56,5 +54,3 @@ ALLOW_DEPRECATED_DECLARATIONS_END
}

} // namespace WebCore

#endif // ENABLE(WEB_CRYPTO)
4 changes: 0 additions & 4 deletions Source/WebCore/crypto/CommonCryptoUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

#pragma once

#if ENABLE(WEB_CRYPTO)

#include "CryptoAlgorithmIdentifier.h"
#include <CommonCrypto/CommonCryptor.h>
#include <CommonCrypto/CommonRandom.h>
Expand All @@ -38,5 +36,3 @@ namespace WebCore {
bool getCommonCryptoDigestAlgorithm(CryptoAlgorithmIdentifier, CCDigestAlgorithm&);

} // namespace WebCore

#endif // ENABLE(WEB_CRYPTO)
6 changes: 1 addition & 5 deletions Source/WebCore/crypto/CryptoAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include "config.h"
#include "CryptoAlgorithm.h"

#if ENABLE(WEB_CRYPTO)

#include "ScriptExecutionContext.h"

namespace WebCore {
Expand Down Expand Up @@ -118,6 +116,4 @@ void CryptoAlgorithm::dispatchOperationInWorkQueue(WorkQueue& workQueue, ScriptE
dispatchAlgorithmOperation(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), WTFMove(operation));
}

}

#endif
} // namespace WebCore
4 changes: 0 additions & 4 deletions Source/WebCore/crypto/CryptoAlgorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#include <wtf/Vector.h>
#include <wtf/WorkQueue.h>

#if ENABLE(WEB_CRYPTO)

namespace WebCore {

class CryptoAlgorithmParameters;
Expand Down Expand Up @@ -82,5 +80,3 @@ class CryptoAlgorithm : public ThreadSafeRefCounted<CryptoAlgorithm> {
};

} // namespace WebCore

#endif // ENABLE(WEB_CRYPTO)
6 changes: 1 addition & 5 deletions Source/WebCore/crypto/CryptoAlgorithmIdentifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@

#pragma once

#if ENABLE(WEB_CRYPTO)

namespace WebCore {

enum class CryptoAlgorithmIdentifier {
enum class CryptoAlgorithmIdentifier : uint8_t {
RSAES_PKCS1_v1_5 = 1,
RSASSA_PKCS1_v1_5,
RSA_PSS,
Expand All @@ -54,5 +52,3 @@ enum class CryptoAlgorithmIdentifier {
};

} // namespace WebCore

#endif // ENABLE(WEB_CRYPTO)
6 changes: 1 addition & 5 deletions Source/WebCore/crypto/CryptoAlgorithmParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@
#include <wtf/TypeCasts.h>
#include <wtf/text/WTFString.h>

#if ENABLE(WEB_CRYPTO)

namespace WebCore {

class CryptoAlgorithmParameters {
WTF_MAKE_FAST_ALLOCATED;
public:
enum class Class {
enum class Class : uint8_t {
None,
AesCbcCfbParams,
AesCtrParams,
Expand Down Expand Up @@ -71,5 +69,3 @@ class CryptoAlgorithmParameters {
SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::CryptoAlgorithm##ToClassName) \
static bool isType(const WebCore::CryptoAlgorithmParameters& parameters) { return parameters.parametersClass() == WebCore::CryptoAlgorithmParameters::Class::ToClassName; } \
SPECIALIZE_TYPE_TRAITS_END()

#endif // ENABLE(WEB_CRYPTO)
4 changes: 1 addition & 3 deletions Source/WebCore/crypto/CryptoAlgorithmParameters.idl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/

[
Conditional=WEB_CRYPTO,
] dictionary CryptoAlgorithmParameters {
dictionary CryptoAlgorithmParameters {
required DOMString name;
};
4 changes: 0 additions & 4 deletions Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include "config.h"
#include "CryptoAlgorithmRegistry.h"

#if ENABLE(WEB_CRYPTO)

#include "CryptoAlgorithm.h"
#include <wtf/NeverDestroyed.h>

Expand Down Expand Up @@ -98,5 +96,3 @@ void CryptoAlgorithmRegistry::registerAlgorithm(const String& name, CryptoAlgori


} // namespace WebCore

#endif // ENABLE(WEB_CRYPTO)
4 changes: 0 additions & 4 deletions Source/WebCore/crypto/CryptoAlgorithmRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
#include <wtf/Noncopyable.h>
#include <wtf/text/StringHash.h>

#if ENABLE(WEB_CRYPTO)

namespace WebCore {

class CryptoAlgorithm;
Expand Down Expand Up @@ -69,5 +67,3 @@ class CryptoAlgorithmRegistry {
};

} // namespace WebCore

#endif // ENABLE(WEB_CRYPTO)
4 changes: 0 additions & 4 deletions Source/WebCore/crypto/CryptoKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include "config.h"
#include "CryptoKey.h"

#if ENABLE(WEB_CRYPTO)

#include "CryptoAlgorithmRegistry.h"
#include "WebCoreOpaqueRoot.h"
#include <wtf/CryptographicallyRandomNumber.h>
Expand Down Expand Up @@ -82,5 +80,3 @@ Vector<uint8_t> CryptoKey::randomData(size_t size)
#endif

} // namespace WebCore

#endif // ENABLE(WEB_CRYPTO)
4 changes: 0 additions & 4 deletions Source/WebCore/crypto/CryptoKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

#pragma once

#if ENABLE(WEB_CRYPTO)

#include "CryptoAesKeyAlgorithm.h"
#include "CryptoAlgorithmIdentifier.h"
#include "CryptoEcKeyAlgorithm.h"
Expand Down Expand Up @@ -98,5 +96,3 @@ WebCoreOpaqueRoot root(CryptoKey*);
SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToClassName) \
static bool isType(const WebCore::CryptoKey& key) { return key.keyClass() == WebCore::KeyClass; } \
SPECIALIZE_TYPE_TRAITS_END()

#endif // ENABLE(WEB_CRYPTO)
1 change: 0 additions & 1 deletion Source/WebCore/crypto/CryptoKey.idl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ enum KeyType {
typedef (CryptoKeyAlgorithm or CryptoAesKeyAlgorithm or CryptoEcKeyAlgorithm or CryptoHmacKeyAlgorithm or CryptoRsaHashedKeyAlgorithm or CryptoRsaKeyAlgorithm) KeyAlgorithm;

[
Conditional=WEB_CRYPTO,
Exposed=(Window,Worker),
GenerateIsReachable=Impl,
SecureContext,
Expand Down
Loading

0 comments on commit cab109e

Please sign in to comment.