Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Unified Diff: content/child/webcrypto/openssl/util_openssl.cc

Issue 745443002: Check that usage isn't empty when generateKey() is called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/child/webcrypto/openssl/util_openssl.cc
diff --git a/content/child/webcrypto/openssl/util_openssl.cc b/content/child/webcrypto/openssl/util_openssl.cc
index 665e1525ff1f267dd024eb8cb4669e840ff1bf01..78e116d13eeb45b2912721b5d4499d58cf76b567 100644
--- a/content/child/webcrypto/openssl/util_openssl.cc
+++ b/content/child/webcrypto/openssl/util_openssl.cc
@@ -180,6 +180,8 @@ Status CreateWebCryptoPrivateKey(crypto::ScopedEVP_PKEY private_key,
*key = blink::WebCryptoKey::create(
new AsymKeyOpenSsl(private_key.Pass(), CryptoData(pkcs8_data)),
blink::WebCryptoKeyTypePrivate, extractable, algorithm, usages);
+ if (key->usages() == 0)
eroman 2014/11/21 23:35:34 Per our discussion this is best left to a follow-u
nharper 2014/11/22 00:26:45 I moved this check up to the GenerateKey() functio
+ return Status::ErrorCreateKeyEmptyUsages();
return Status::Success();
}

Powered by Google App Engine
This is Rietveld 408576698