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

Unified Diff: net/ssl/ssl_platform_key_nss_unittest.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_nss.cc ('k') | net/ssl/ssl_platform_key_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/ssl_platform_key_nss_unittest.cc
diff --git a/net/ssl/ssl_platform_key_nss_unittest.cc b/net/ssl/ssl_platform_key_nss_unittest.cc
index 350c46273b7c5f70679d081b95a26eec1025e3dd..2d40ba178d7e8a5eb440ad681985b17143fa6d51 100644
--- a/net/ssl/ssl_platform_key_nss_unittest.cc
+++ b/net/ssl/ssl_platform_key_nss_unittest.cc
@@ -35,20 +35,21 @@ namespace net {
namespace {
struct TestKey {
+ const char* name;
const char* cert_file;
const char* key_file;
- SSLPrivateKey::Type key_type;
+ bool is_ecdsa;
};
const TestKey kTestKeys[] = {
- {"client_1.pem", "client_1.pk8", SSLPrivateKey::Type::RSA},
- {"client_4.pem", "client_4.pk8", SSLPrivateKey::Type::ECDSA_P256},
- {"client_5.pem", "client_5.pk8", SSLPrivateKey::Type::ECDSA_P384},
- {"client_6.pem", "client_6.pk8", SSLPrivateKey::Type::ECDSA_P521},
+ {"RSA", "client_1.pem", "client_1.pk8", false},
+ {"ECDSA_P256", "client_4.pem", "client_4.pk8", true},
+ {"ECDSA_P384", "client_5.pem", "client_5.pk8", true},
+ {"ECDSA_P521", "client_6.pem", "client_6.pk8", true},
};
std::string TestKeyToString(const testing::TestParamInfo<TestKey>& params) {
- return SSLPrivateKeyTypeToString(params.param.key_type);
+ return params.param.name;
}
} // namespace
@@ -66,7 +67,7 @@ TEST_P(SSLPlatformKeyNSSTest, KeyMatches) {
// Import the key into a test NSS database.
crypto::ScopedTestNSSDB test_db;
scoped_refptr<X509Certificate> cert;
- if (SSLPrivateKey::IsECDSAType(test_key.key_type)) {
+ if (test_key.is_ecdsa) {
// NSS cannot import unencrypted ECDSA keys, so we encrypt it with an empty
// password and import manually.
std::vector<uint8_t> pkcs8_vector(pkcs8.begin(), pkcs8.end());
« no previous file with comments | « net/ssl/ssl_platform_key_nss.cc ('k') | net/ssl/ssl_platform_key_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698