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

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: Add more tests 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..06a5876d96f6a82354e51fb808818652b69146a8 100644
--- a/content/child/webcrypto/openssl/util_openssl.cc
+++ b/content/child/webcrypto/openssl/util_openssl.cc
@@ -180,6 +180,9 @@ 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/20 23:40:10 This test is not possible, as it will prevent impo
nharper 2014/11/21 22:12:01 Is it an issue that this affects behavior of key i
eroman 2014/11/21 22:55:47 Correct, importKey() must also throw a SyntaxError
+ return Status::ErrorCreateKeyBadUsages();
+ }
return Status::Success();
}

Powered by Google App Engine
This is Rietveld 408576698