Index: Source/modules/crypto/SubtleCrypto.cpp |
diff --git a/Source/modules/crypto/SubtleCrypto.cpp b/Source/modules/crypto/SubtleCrypto.cpp |
index 0543c8898ccb5c086fa2ff62987925b39ae17e52..cc690fdf519b5b496c25ddb74d775b09c655a6fc 100644 |
--- a/Source/modules/crypto/SubtleCrypto.cpp |
+++ b/Source/modules/crypto/SubtleCrypto.cpp |
@@ -177,9 +177,8 @@ ScriptPromise SubtleCrypto::importKey(const String& rawFormat, ArrayBufferView* |
if (!Key::parseUsageMask(rawKeyUsages, keyUsages, result.get())) |
return promise; |
- // The algorithm is optional. |
blink::WebCryptoAlgorithm algorithm; |
- if (!rawAlgorithm.isUndefinedOrNull() && !parseAlgorithm(rawAlgorithm, ImportKey, algorithm, exceptionState, result.get())) |
+ if (!parseAlgorithm(rawAlgorithm, ImportKey, algorithm, exceptionState, result.get())) |
return promise; |
const unsigned char* keyDataBytes = static_cast<unsigned char*>(keyData->baseAddress()); |
@@ -273,9 +272,8 @@ ScriptPromise SubtleCrypto::unwrapKey(const String& rawFormat, ArrayBufferView* |
if (!parseAlgorithm(rawUnwrapAlgorithm, UnwrapKey, unwrapAlgorithm, exceptionState, result.get())) |
return promise; |
- // The unwrappedKeyAlgorithm is optional. |
blink::WebCryptoAlgorithm unwrappedKeyAlgorithm; |
- if (!rawUnwrappedKeyAlgorithm.isUndefinedOrNull() && !parseAlgorithm(rawUnwrappedKeyAlgorithm, ImportKey, unwrappedKeyAlgorithm, exceptionState, result.get())) |
+ if (!parseAlgorithm(rawUnwrappedKeyAlgorithm, ImportKey, unwrappedKeyAlgorithm, exceptionState, result.get())) |
return promise; |
if (!unwrappingKey->canBeUsedForAlgorithm(unwrapAlgorithm, UnwrapKey, result.get())) |