Index: content/child/webcrypto/nss/hmac_nss.cc |
diff --git a/content/child/webcrypto/nss/hmac_nss.cc b/content/child/webcrypto/nss/hmac_nss.cc |
index b539e8715ce299f2a21da8c44710a30dea4ab7a4..74cdaef0525a666f973615e02265b55bc6694dc8 100644 |
--- a/content/child/webcrypto/nss/hmac_nss.cc |
+++ b/content/child/webcrypto/nss/hmac_nss.cc |
@@ -55,10 +55,14 @@ class HmacImplementation : public AlgorithmImplementation { |
public: |
HmacImplementation() {} |
- virtual Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm, |
- bool extractable, |
- blink::WebCryptoKeyUsageMask usage_mask, |
- blink::WebCryptoKey* key) const override { |
+ virtual Status GenerateKey(const blink::WebCryptoAlgorithm& algorithm, |
+ bool extractable, |
+ blink::WebCryptoKeyUsageMask usage_mask, |
+ GenerateKeyResult* result) const override { |
+ Status status = CheckKeyCreationUsages(kAllKeyUsages, usage_mask); |
+ if (status.IsError()) |
+ return status; |
+ |
const blink::WebCryptoHmacKeyGenParams* params = |
algorithm.hmacKeyGenParams(); |
@@ -68,7 +72,7 @@ class HmacImplementation : public AlgorithmImplementation { |
return Status::ErrorUnsupported(); |
unsigned int keylen_bits = 0; |
- Status status = GetHmacKeyGenLengthInBits(params, &keylen_bits); |
+ status = GetHmacKeyGenLengthInBits(params, &keylen_bits); |
if (status.IsError()) |
return status; |
@@ -78,7 +82,7 @@ class HmacImplementation : public AlgorithmImplementation { |
usage_mask, |
keylen_bits / 8, |
mechanism, |
- key); |
+ result); |
} |
virtual Status VerifyKeyUsagesBeforeImportKey( |
@@ -93,11 +97,6 @@ class HmacImplementation : public AlgorithmImplementation { |
} |
} |
- virtual Status VerifyKeyUsagesBeforeGenerateKey( |
- blink::WebCryptoKeyUsageMask usage_mask) const override { |
- return CheckKeyCreationUsages(kAllKeyUsages, usage_mask); |
- } |
- |
virtual Status ImportKeyRaw(const CryptoData& key_data, |
const blink::WebCryptoAlgorithm& algorithm, |
bool extractable, |