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

Unified Diff: net/ssl/ssl_platform_key_util.cc

Issue 2822283002: Remove SSLPrivateKey metadata hooks. (Closed)
Patch Set: emaxx comment Created 3 years, 8 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 | « net/ssl/ssl_platform_key_util.h ('k') | net/ssl/ssl_platform_key_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/ssl_platform_key_util.cc
diff --git a/net/ssl/ssl_platform_key_util.cc b/net/ssl/ssl_platform_key_util.cc
index 39af9eb6eba26a9bc288639900eb60f2785ef1d5..edee7db93c02aa8290502221386efa3c7ae96a35 100644
--- a/net/ssl/ssl_platform_key_util.cc
+++ b/net/ssl/ssl_platform_key_util.cc
@@ -50,7 +50,7 @@ scoped_refptr<base::SingleThreadTaskRunner> GetSSLPlatformKeyTaskRunner() {
}
bool GetClientCertInfo(const X509Certificate* certificate,
- SSLPrivateKey::Type* out_type,
+ int* out_type,
size_t* out_max_length) {
crypto::OpenSSLErrStackTracer tracker(FROM_HERE);
@@ -71,37 +71,7 @@ bool GetClientCertInfo(const X509Certificate* certificate,
return false;
}
- int key_type = EVP_PKEY_id(key.get());
- switch (key_type) {
- case EVP_PKEY_RSA:
- *out_type = SSLPrivateKey::Type::RSA;
- break;
-
- case EVP_PKEY_EC: {
- EC_KEY* ec_key = EVP_PKEY_get0_EC_KEY(key.get());
- int curve = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key));
- switch (curve) {
- case NID_X9_62_prime256v1:
- *out_type = SSLPrivateKey::Type::ECDSA_P256;
- break;
- case NID_secp384r1:
- *out_type = SSLPrivateKey::Type::ECDSA_P384;
- break;
- case NID_secp521r1:
- *out_type = SSLPrivateKey::Type::ECDSA_P521;
- break;
- default:
- LOG(ERROR) << "Unsupported curve type " << curve;
- return false;
- }
- break;
- }
-
- default:
- LOG(ERROR) << "Unsupported key type " << key_type;
- return false;
- }
-
+ *out_type = EVP_PKEY_id(key.get());
*out_max_length = EVP_PKEY_size(key.get());
return true;
}
« no previous file with comments | « net/ssl/ssl_platform_key_util.h ('k') | net/ssl/ssl_platform_key_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698