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

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

Issue 328903003: [webcrypto] Remove support for AES 192-bit keys (2 of 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | « no previous file | content/child/webcrypto/shared_crypto.cc » ('j') | content/child/webcrypto/shared_crypto.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/platform_crypto_nss.cc
diff --git a/content/child/webcrypto/platform_crypto_nss.cc b/content/child/webcrypto/platform_crypto_nss.cc
index dab8582753cf2329dedec349bba9e40e92c160f3..b653fa2b53f84937a1b0d9a3521a391b21d70b91 100644
--- a/content/child/webcrypto/platform_crypto_nss.cc
+++ b/content/child/webcrypto/platform_crypto_nss.cc
@@ -1853,9 +1853,17 @@ Status UnwrapSymKeyAesKw(const CryptoData& wrapped_key_data,
if (status.IsError())
return status;
+ unsigned int unwrapped_key_length_bytes =
+ PK11_GetKeyLength(unwrapped_key.get());
+
+ if (unwrapped_key_length_bytes == 24 &&
+ algorithm.id() == blink::WebCryptoAlgorithmIdAesGcm) {
Ryan Sleevi 2014/06/10 23:44:21 Adam's comments were about AES as a whole. if (Is
eroman 2014/06/11 01:15:26 I see, I'll rework this change to apply to all of
eroman 2014/06/12 01:01:30 I sent you another CL which remove the special cas
+ return Status::ErrorAesGcm192Unsupported();
+ }
+
blink::WebCryptoKeyAlgorithm key_algorithm;
if (!CreateSecretKeyAlgorithm(
- algorithm, PK11_GetKeyLength(unwrapped_key.get()), &key_algorithm))
+ algorithm, unwrapped_key_length_bytes, &key_algorithm))
return Status::ErrorUnexpected();
scoped_ptr<SymKey> key_handle;
« no previous file with comments | « no previous file | content/child/webcrypto/shared_crypto.cc » ('j') | content/child/webcrypto/shared_crypto.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698