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

Unified Diff: content/child/webcrypto/shared_crypto_unittest.cc

Issue 211943002: [webcrypto] Minor cleanup/consolidation of JWK source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes for eroman 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
Index: content/child/webcrypto/shared_crypto_unittest.cc
diff --git a/content/child/webcrypto/shared_crypto_unittest.cc b/content/child/webcrypto/shared_crypto_unittest.cc
index f7acd6da5189407e8351292372715a2d2877523a..696868e28394dc4f1a2c9a9d707b4ef14f535d8f 100644
--- a/content/child/webcrypto/shared_crypto_unittest.cc
+++ b/content/child/webcrypto/shared_crypto_unittest.cc
@@ -516,6 +516,19 @@ Status AesGcmDecrypt(const blink::WebCryptoKey& key,
return Decrypt(algorithm, key, CryptoData(cipher_text_with_tag), plain_text);
}
+Status ImportKeyJwk(const CryptoData& key_data,
+ const blink::WebCryptoAlgorithm& algorithm,
+ bool extractable,
+ blink::WebCryptoKeyUsageMask usage_mask,
+ blink::WebCryptoKey* key) {
+ return ImportKey(blink::WebCryptoKeyFormatJwk,
+ key_data,
+ algorithm,
+ extractable,
+ usage_mask,
+ key);
+}
+
Status ImportKeyJwkFromDict(const base::DictionaryValue& dict,
const blink::WebCryptoAlgorithm& algorithm,
bool extractable,
@@ -1720,7 +1733,7 @@ TEST_F(SharedCryptoTest, MAYBE(ImportExportJwkSymmetricKey)) {
HexStringToBytes(test.key_hex), test.algorithm, test.usage);
// Export the key in JWK format and validate.
- ASSERT_STATUS_SUCCESS(ExportKeyJwk(key, &json));
+ ASSERT_STATUS_SUCCESS(ExportKey(blink::WebCryptoKeyFormatJwk, key, &json));
EXPECT_TRUE(VerifySecretJwk(json, test.jwk_alg, test.key_hex, test.usage));
// Import the JWK-formatted key.

Powered by Google App Engine
This is Rietveld 408576698