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

Unified Diff: crypto/rsa_private_key_openssl.cc

Issue 805193004: Don't allow importing non-RSA keys from crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: aaand remove space Created 5 years, 12 months 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
« no previous file with comments | « no previous file | crypto/rsa_private_key_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/rsa_private_key_openssl.cc
diff --git a/crypto/rsa_private_key_openssl.cc b/crypto/rsa_private_key_openssl.cc
index 3dcce675a010b8ae837e74e8f4bdfc57917e7fc1..799d0f076afaaf7b5337f04e4a3c000a4e9c1ed8 100644
--- a/crypto/rsa_private_key_openssl.cc
+++ b/crypto/rsa_private_key_openssl.cc
@@ -91,7 +91,7 @@ RSAPrivateKey* RSAPrivateKey::CreateFromPrivateKeyInfo(
scoped_ptr<RSAPrivateKey> result(new RSAPrivateKey);
result->key_ = EVP_PKCS82PKEY(p8inf.get());
- if (!result->key_)
+ if (!result->key_ || EVP_PKEY_id(result->key_) != EVP_PKEY_RSA)
return NULL;
return result.release();
« no previous file with comments | « no previous file | crypto/rsa_private_key_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698