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

Unified Diff: net/ssl/openssl_client_key_store_unittest.cc

Issue 396803002: Implement TLS client auth in the OS X OpenSSL port. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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/openssl_client_key_store.cc ('k') | net/ssl/openssl_platform_key.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/openssl_client_key_store_unittest.cc
diff --git a/net/ssl/openssl_client_key_store_unittest.cc b/net/ssl/openssl_client_key_store_unittest.cc
index b04e109784d24342a8169248d480a035a624bc54..7909afd5a8284a7fdd0e35b0e9b0fb1e2402388e 100644
--- a/net/ssl/openssl_client_key_store_unittest.cc
+++ b/net/ssl/openssl_client_key_store_unittest.cc
@@ -59,8 +59,7 @@ TEST_F(OpenSSLClientKeyStoreTest, Flush) {
// Retrieve the private key. This should fail because the store
// was flushed.
- crypto::ScopedEVP_PKEY pkey;
- ASSERT_FALSE(store_->FetchClientCertPrivateKey(cert_1.get(), &pkey));
+ crypto::ScopedEVP_PKEY pkey = store_->FetchClientCertPrivateKey(cert_1.get());
ASSERT_FALSE(pkey.get());
}
@@ -75,8 +74,7 @@ TEST_F(OpenSSLClientKeyStoreTest, FetchEmptyPrivateKey) {
// Retrieve the private key now. This should fail because it was
// never recorded in the store.
- crypto::ScopedEVP_PKEY pkey;
- ASSERT_FALSE(store_->FetchClientCertPrivateKey(cert_1.get(), &pkey));
+ crypto::ScopedEVP_PKEY pkey = store_->FetchClientCertPrivateKey(cert_1.get());
ASSERT_FALSE(pkey.get());
}
@@ -110,8 +108,8 @@ TEST_F(OpenSSLClientKeyStoreTest, RecordAndFetchPrivateKey) {
// Retrieve the private key. This should increment the private key's
// reference count.
- crypto::ScopedEVP_PKEY pkey2;
- ASSERT_TRUE(store_->FetchClientCertPrivateKey(cert_1.get(), &pkey2));
+ crypto::ScopedEVP_PKEY pkey2 =
+ store_->FetchClientCertPrivateKey(cert_1.get());
ASSERT_EQ(pkey2.get(), priv_key.get());
ASSERT_EQ(3, EVP_PKEY_get_refcount(priv_key.get()));
@@ -152,12 +150,11 @@ TEST_F(OpenSSLClientKeyStoreTest, RecordAndFetchTwoPrivateKeys) {
// Retrieve the private key now. This shall succeed and increment
// the private key's reference count.
- crypto::ScopedEVP_PKEY fetch_key1;
- ASSERT_TRUE(store_->FetchClientCertPrivateKey(cert_1.get(),
- &fetch_key1));
- crypto::ScopedEVP_PKEY fetch_key2;
- ASSERT_TRUE(store_->FetchClientCertPrivateKey(cert_2.get(),
- &fetch_key2));
+ crypto::ScopedEVP_PKEY fetch_key1 =
+ store_->FetchClientCertPrivateKey(cert_1.get());
+ crypto::ScopedEVP_PKEY fetch_key2 =
+ store_->FetchClientCertPrivateKey(cert_2.get());
+
EXPECT_TRUE(fetch_key1.get());
EXPECT_TRUE(fetch_key2.get());
« no previous file with comments | « net/ssl/openssl_client_key_store.cc ('k') | net/ssl/openssl_platform_key.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698