| 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 1df84289b243df2018f9de3bcf4e1a7d15d523d5..28161fd449cb74b739b0eb94dd934cdaf7ad60d3 100644
|
| --- a/content/renderer/webcrypto/webcrypto_impl_nss.cc
|
| +++ b/content/renderer/webcrypto/webcrypto_impl_nss.cc
|
| @@ -194,6 +194,8 @@ CK_MECHANISM_TYPE WebCryptoAlgorithmToGenMechanism(
|
| const blink::WebCryptoAlgorithm& algorithm) {
|
| switch (algorithm.id()) {
|
| case blink::WebCryptoAlgorithmIdAesCbc:
|
| + case blink::WebCryptoAlgorithmIdAesGcm:
|
| + case blink::WebCryptoAlgorithmIdAesKw:
|
| return CKM_AES_KEY_GEN;
|
| case blink::WebCryptoAlgorithmIdHmac:
|
| return HmacAlgorithmToGenMechanism(algorithm);
|
| @@ -669,10 +671,14 @@ bool WebCryptoImpl::GenerateKeyInternal(
|
| }
|
|
|
| switch (algorithm.id()) {
|
| - case blink::WebCryptoAlgorithmIdAesCbc: {
|
| + case blink::WebCryptoAlgorithmIdAesCbc:
|
| + case blink::WebCryptoAlgorithmIdAesGcm:
|
| + case blink::WebCryptoAlgorithmIdAesKw: {
|
| const blink::WebCryptoAesKeyGenParams* params =
|
| algorithm.aesKeyGenParams();
|
| DCHECK(params);
|
| + // Ensure the key length is a multiple of 8 bits. Let NSS verify further
|
| + // algorithm-specific length restrictions.
|
| if (params->lengthBits() % 8)
|
| return false;
|
| keylen_bytes = params->lengthBits() / 8;
|
|
|