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

Unified Diff: net/ssl/ssl_platform_key_test.cc

Issue 1639463003: Use SSLPrivateKey for testing client authentication (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding header. Created 4 years, 11 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
« net/ssl/ssl_platform_key_test.h ('K') | « net/ssl/ssl_platform_key_test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/ssl_platform_key_test.cc
diff --git a/net/ssl/ssl_platform_key_android.cc b/net/ssl/ssl_platform_key_test.cc
similarity index 84%
copy from net/ssl/ssl_platform_key_android.cc
copy to net/ssl/ssl_platform_key_test.cc
index 6a6595cc0e651eedcacdc97804bf3cc1f8bdd0ca..fae116ceaafd20dd20792048518de6db533ce11c 100644
--- a/net/ssl/ssl_platform_key_android.cc
+++ b/net/ssl/ssl_platform_key_test.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "net/ssl/ssl_platform_key.h"
+#include "net/ssl/ssl_platform_key_test.h"
#include <openssl/digest.h>
#include <openssl/evp.h>
@@ -12,7 +12,6 @@
#include "base/macros.h"
#include "crypto/scoped_openssl_types.h"
#include "net/base/net_errors.h"
-#include "net/ssl/openssl_client_key_store.h"
#include "net/ssl/ssl_platform_key_task_runner.h"
#include "net/ssl/ssl_private_key.h"
#include "net/ssl/threaded_ssl_private_key.h"
@@ -21,12 +20,12 @@ namespace net {
namespace {
-class SSLPlatformKeyAndroid : public ThreadedSSLPrivateKey::Delegate {
+class SSLPlatformKeyTest : public ThreadedSSLPrivateKey::Delegate {
public:
- SSLPlatformKeyAndroid(crypto::ScopedEVP_PKEY key, SSLPrivateKey::Type type)
+ SSLPlatformKeyTest(crypto::ScopedEVP_PKEY key, SSLPrivateKey::Type type)
: key_(std::move(key)), type_(type) {}
- ~SSLPlatformKeyAndroid() override {}
+ ~SSLPlatformKeyTest() override {}
SSLPrivateKey::Type GetType() override { return type_; }
@@ -100,9 +99,11 @@ class SSLPlatformKeyAndroid : public ThreadedSSLPrivateKey::Delegate {
crypto::ScopedEVP_PKEY key_;
SSLPrivateKey::Type type_;
- DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeyAndroid);
+ DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeyTest);
};
+} // namespace
+
scoped_refptr<SSLPrivateKey> WrapOpenSSLPrivateKey(crypto::ScopedEVP_PKEY key) {
if (!key)
return nullptr;
@@ -120,18 +121,8 @@ scoped_refptr<SSLPrivateKey> WrapOpenSSLPrivateKey(crypto::ScopedEVP_PKEY key) {
return nullptr;
}
return make_scoped_refptr(new ThreadedSSLPrivateKey(
- make_scoped_ptr(new SSLPlatformKeyAndroid(std::move(key), type)),
+ make_scoped_ptr(new SSLPlatformKeyTest(std::move(key), type)),
GetSSLPlatformKeyTaskRunner()));
}
-} // namespace
-
-scoped_refptr<SSLPrivateKey> FetchClientCertPrivateKey(
- X509Certificate* certificate) {
- crypto::ScopedEVP_PKEY key =
- OpenSSLClientKeyStore::GetInstance()->FetchClientCertPrivateKey(
- certificate);
- return WrapOpenSSLPrivateKey(std::move(key));
-}
-
} // namespace net
« net/ssl/ssl_platform_key_test.h ('K') | « net/ssl/ssl_platform_key_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698