Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1426)

Unified Diff: Source/modules/crypto/SubtleCrypto.cpp

Issue 198513002: [webcrypto] Make the import algorithm a required parameter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/crypto/importKey-expected.txt ('k') | Source/modules/crypto/SubtleCrypto.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()))
« no previous file with comments | « LayoutTests/crypto/importKey-expected.txt ('k') | Source/modules/crypto/SubtleCrypto.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698