Index: content/child/webcrypto/test/hmac_unittest.cc |
diff --git a/content/child/webcrypto/test/hmac_unittest.cc b/content/child/webcrypto/test/hmac_unittest.cc |
index ff2bbe16a1ebf2aa3a602ff5040469d60ebe428e..cc1335bf039eb4ba831785e9ce3e4073bda53d6f 100644 |
--- a/content/child/webcrypto/test/hmac_unittest.cc |
+++ b/content/child/webcrypto/test/hmac_unittest.cc |
@@ -184,7 +184,7 @@ TEST(WebCryptoHmacTest, GenerateKeyEmptyUsage) { |
blink::WebCryptoKey key; |
blink::WebCryptoAlgorithm algorithm = |
CreateHmacKeyGenAlgorithm(blink::WebCryptoAlgorithmIdSha512, 0); |
- ASSERT_EQ(Status::ErrorCreateKeyEmptyUsages(), |
+ ASSERT_EQ(Status::ErrorKeyEmptyUsages(), |
GenerateSecretKey(algorithm, true, 0, &key)); |
} |
@@ -208,6 +208,18 @@ TEST(WebCryptoHmacTest, Generate1BitKey) { |
EXPECT_FALSE(raw_key[0] & 0x7F); |
} |
+TEST(WebCryptoHmacTest, ImportKeyEmptyUsage) { |
+ blink::WebCryptoKey key; |
+ std::string key_raw_hex_in = "025a8cf3f08b4f6c5f33bbc76a471939"; |
+ EXPECT_EQ( |
+ Status::ErrorKeyEmptyUsages(), |
+ ImportKey(blink::WebCryptoKeyFormatRaw, |
+ CryptoData(HexStringToBytes(key_raw_hex_in)), |
+ CreateHmacImportAlgorithmNoLength( |
+ blink::WebCryptoAlgorithmIdSha1), |
+ true, 0, &key)); |
+} |
+ |
TEST(WebCryptoHmacTest, ImportKeyJwkKeyOpsSignVerify) { |
blink::WebCryptoKey key; |
base::DictionaryValue dict; |
@@ -457,11 +469,6 @@ TEST(WebCryptoHmacTest, ImportExportJwk) { |
ImportExportJwkSymmetricKey( |
512, CreateHmacImportAlgorithmNoLength(blink::WebCryptoAlgorithmIdSha512), |
blink::WebCryptoKeyUsageVerify, "HS512"); |
- |
- // Zero usage value |
- ImportExportJwkSymmetricKey( |
- 512, CreateHmacImportAlgorithmNoLength(blink::WebCryptoAlgorithmIdSha512), |
- 0, "HS512"); |
} |
TEST(WebCryptoHmacTest, ExportJwkEmptyKey) { |