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

Unified Diff: content/renderer/webcrypto/webcrypto_impl_nss.cc

Issue 117013002: [webcrypto] Add import of AES-KW key for NSS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for eroman Created 7 years 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 | « no previous file | content/renderer/webcrypto/webcrypto_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/webcrypto/webcrypto_impl_nss.cc
diff --git a/content/renderer/webcrypto/webcrypto_impl_nss.cc b/content/renderer/webcrypto/webcrypto_impl_nss.cc
index 107c27b0cc135023af09961f6af002aff2a05933..1df84289b243df2018f9de3bcf4e1a7d15d523d5 100644
--- a/content/renderer/webcrypto/webcrypto_impl_nss.cc
+++ b/content/renderer/webcrypto/webcrypto_impl_nss.cc
@@ -260,6 +260,7 @@ bool ImportKeyInternalRaw(
switch (algorithm.id()) {
case blink::WebCryptoAlgorithmIdHmac:
case blink::WebCryptoAlgorithmIdAesCbc:
+ case blink::WebCryptoAlgorithmIdAesKw:
type = blink::WebCryptoKeyTypeSecret;
break;
// TODO(bryaneyler): Support more key types.
@@ -267,8 +268,6 @@ bool ImportKeyInternalRaw(
return false;
}
- // TODO(bryaneyler): Need to split handling for symmetric and asymmetric keys.
- // Currently only supporting symmetric.
CK_MECHANISM_TYPE mechanism = CKM_INVALID_MECHANISM;
// Flags are verified at the Blink layer; here the flags are set to all
// possible operations for this key type.
@@ -295,6 +294,11 @@ bool ImportKeyInternalRaw(
flags |= CKF_ENCRYPT | CKF_DECRYPT;
break;
}
+ case blink::WebCryptoAlgorithmIdAesKw: {
+ mechanism = CKM_NSS_AES_KEY_WRAP;
+ flags |= CKF_WRAP | CKF_WRAP;
+ break;
+ }
default:
return false;
}
« no previous file with comments | « no previous file | content/renderer/webcrypto/webcrypto_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698