Index: content/child/webcrypto/openssl/ec_key_openssl.cc |
diff --git a/content/child/webcrypto/openssl/ec_key_openssl.cc b/content/child/webcrypto/openssl/ec_key_openssl.cc |
index 8d5fc0879d70227c6c687918cb3515dce2b73af4..81e233701f42767301e104023301db12f4942f6f 100644 |
--- a/content/child/webcrypto/openssl/ec_key_openssl.cc |
+++ b/content/child/webcrypto/openssl/ec_key_openssl.cc |
@@ -218,6 +218,9 @@ Status EcAlgorithm::GenerateKey(const blink::WebCryptoAlgorithm& algorithm, |
const blink::WebCryptoKeyUsageMask private_usages = |
combined_usages & all_private_key_usages_; |
+ if (private_usages == 0) |
+ return Status::ErrorCreateKeyEmptyUsages(); |
+ |
const blink::WebCryptoEcKeyGenParams* params = algorithm.ecKeyGenParams(); |
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); |