Chromium Code Reviews| 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; |