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

Unified Diff: content/child/webcrypto/shared_crypto.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
Index: content/child/webcrypto/shared_crypto.cc
diff --git a/content/child/webcrypto/shared_crypto.cc b/content/child/webcrypto/shared_crypto.cc
index b4d5931327a31de64f6ec3a9dd5ab5fa2d96823b..6b3d45010b0979259e9cfc0d495d7e923c9391f8 100644
--- a/content/child/webcrypto/shared_crypto.cc
+++ b/content/child/webcrypto/shared_crypto.cc
@@ -219,6 +219,10 @@ Status ImportKeyRaw(const CryptoData& key_data,
case blink::WebCryptoAlgorithmIdAesKw:
if (!IsValidAesKeyLengthBytes(key_data.byte_length()))
return Status::ErrorImportAesKeyLength();
+ if (key_data.byte_length() == 24 &&
+ algorithm.id() == blink::WebCryptoAlgorithmIdAesGcm) {
+ return Status::ErrorAesGcm192Unsupported();
Ryan Sleevi 2014/06/10 23:44:21 Same comments re All AES
+ }
// Fallthrough intentional!
case blink::WebCryptoAlgorithmIdHmac:
return platform::ImportKeyRaw(
@@ -662,6 +666,12 @@ Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm,
if (!IsValidAesKeyLengthBits(algorithm.aesKeyGenParams()->lengthBits()))
return Status::ErrorGenerateKeyLength();
keylen_bytes = algorithm.aesKeyGenParams()->lengthBits() / 8;
+
+ if (keylen_bytes == 24 &&
+ algorithm.id() == blink::WebCryptoAlgorithmIdAesGcm) {
+ return Status::ErrorAesGcm192Unsupported();
+ }
Ryan Sleevi 2014/06/10 23:44:21 Same comments re All AES
+
break;
}
case blink::WebCryptoAlgorithmIdHmac: {

Powered by Google App Engine
This is Rietveld 408576698