| Index: content/child/webcrypto/test/aes_cbc_unittest.cc
|
| diff --git a/content/child/webcrypto/test/aes_cbc_unittest.cc b/content/child/webcrypto/test/aes_cbc_unittest.cc
|
| index b62a362acecc8cb13ae0bd3d24ac537e2f03fac9..d0abe48d3bfac97b9546a6ce0c7cf64fda78c370 100644
|
| --- a/content/child/webcrypto/test/aes_cbc_unittest.cc
|
| +++ b/content/child/webcrypto/test/aes_cbc_unittest.cc
|
| @@ -195,10 +195,19 @@ TEST(WebCryptoAesCbcTest, GenerateKeyBadLength) {
|
| SCOPED_TRACE(i);
|
| EXPECT_EQ(Status::ErrorGenerateAesKeyLength(),
|
| GenerateSecretKey(CreateAesCbcKeyGenAlgorithm(kKeyLen[i]), true,
|
| - 0, &key));
|
| + blink::WebCryptoKeyUsageEncrypt, &key));
|
| }
|
| }
|
|
|
| +TEST(WebCryptoAesCbcTest, ImportKeyEmptyUsage) {
|
| + blink::WebCryptoKey key;
|
| + ASSERT_EQ(Status::ErrorKeyEmptyUsages(),
|
| + ImportKey(blink::WebCryptoKeyFormatRaw,
|
| + CryptoData(std::vector<uint8_t>(16)),
|
| + CreateAlgorithm(blink::WebCryptoAlgorithmIdAesCbc),
|
| + true, 0, &key));
|
| +}
|
| +
|
| // If key_ops is specified but empty, no key usages are allowed for the key.
|
| TEST(WebCryptoAesCbcTest, ImportKeyJwkEmptyKeyOps) {
|
| blink::WebCryptoKey key;
|
| @@ -208,13 +217,6 @@ TEST(WebCryptoAesCbcTest, ImportKeyJwkEmptyKeyOps) {
|
| dict.SetString("k", "GADWrMRHwQfoNaXU5fZvTg");
|
| dict.Set("key_ops", new base::ListValue); // Takes ownership.
|
|
|
| - EXPECT_EQ(Status::Success(),
|
| - ImportKeyJwkFromDict(
|
| - dict, CreateAlgorithm(blink::WebCryptoAlgorithmIdAesCbc), false,
|
| - 0, &key));
|
| -
|
| - EXPECT_EQ(0, key.usages());
|
| -
|
| // The JWK does not contain encrypt usages.
|
| EXPECT_EQ(Status::ErrorJwkKeyopsInconsistent(),
|
| ImportKeyJwkFromDict(
|
| @@ -467,7 +469,7 @@ TEST(WebCryptoAesCbcTest, GenerateKeyBadUsages) {
|
| TEST(WebCryptoAesCbcTest, GenerateKeyEmptyUsages) {
|
| blink::WebCryptoKey key;
|
|
|
| - ASSERT_EQ(Status::ErrorCreateKeyEmptyUsages(),
|
| + ASSERT_EQ(Status::ErrorKeyEmptyUsages(),
|
| GenerateSecretKey(CreateAesCbcKeyGenAlgorithm(128), true, 0, &key));
|
| }
|
|
|
| @@ -533,8 +535,8 @@ TEST(WebCryptoAesCbcTest, WrapUnwrapRoundtripSpkiPkcs8) {
|
| ASSERT_EQ(
|
| Status::Success(),
|
| UnwrapKey(blink::WebCryptoKeyFormatSpki, CryptoData(wrapped_public_key),
|
| - wrapping_key, wrap_algorithm, rsa_import_algorithm, true, 0,
|
| - &unwrapped_public_key));
|
| + wrapping_key, wrap_algorithm, rsa_import_algorithm, true,
|
| + blink::WebCryptoKeyUsageVerify, &unwrapped_public_key));
|
|
|
| blink::WebCryptoKey unwrapped_private_key;
|
|
|
|
|