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

Unified Diff: net/socket/ssl_client_socket_openssl.cc

Issue 6805019: Move crypto files out of base, to a top level directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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
Index: net/socket/ssl_client_socket_openssl.cc
===================================================================
--- net/socket/ssl_client_socket_openssl.cc (revision 80572)
+++ net/socket/ssl_client_socket_openssl.cc (working copy)
@@ -12,8 +12,8 @@
#include "base/memory/singleton.h"
#include "base/metrics/histogram.h"
-#include "base/openssl_util.h"
#include "base/synchronization/lock.h"
+#include "crypto/openssl_util.h"
#include "net/base/cert_verifier.h"
#include "net/base/net_errors.h"
#include "net/base/openssl_private_key_store.h"
@@ -172,7 +172,7 @@
// error stack if needed. Note that |tracer| is not currently used in the
// implementation, but is passed in anyway as this ensures the caller will clear
// any residual codes left on the error stack.
-int MapOpenSSLError(int err, const base::OpenSSLErrStackTracer& tracer) {
+int MapOpenSSLError(int err, const crypto::OpenSSLErrStackTracer& tracer) {
switch (err) {
case SSL_ERROR_WANT_READ:
case SSL_ERROR_WANT_WRITE:
@@ -206,7 +206,7 @@
void OnSessionAdded(const HostPortPair& host_and_port, SSL_SESSION* session) {
// Declare the session cleaner-upper before the lock, so any call into
// OpenSSL to free the session will happen after the lock is released.
- base::ScopedOpenSSL<SSL_SESSION, SSL_SESSION_free> session_to_free;
+ crypto::ScopedOpenSSL<SSL_SESSION, SSL_SESSION_free> session_to_free;
base::AutoLock lock(lock_);
DCHECK_EQ(0U, session_map_.count(session));
@@ -228,7 +228,7 @@
void OnSessionRemoved(SSL_SESSION* session) {
// Declare the session cleaner-upper before the lock, so any call into
// OpenSSL to free the session will happen after the lock is released.
- base::ScopedOpenSSL<SSL_SESSION, SSL_SESSION_free> session_to_free;
+ crypto::ScopedOpenSSL<SSL_SESSION, SSL_SESSION_free> session_to_free;
base::AutoLock lock(lock_);
SessionMap::iterator it = session_map_.find(session);
@@ -301,7 +301,7 @@
friend struct DefaultSingletonTraits<SSLContext>;
SSLContext() {
- base::EnsureOpenSSLInit();
+ crypto::EnsureOpenSSLInit();
ssl_socket_data_index_ = SSL_get_ex_new_index(0, 0, 0, 0, 0);
DCHECK_NE(ssl_socket_data_index_, -1);
ssl_ctx_.reset(SSL_CTX_new(SSLv23_client_method()));
@@ -358,7 +358,7 @@
// SSLClientSocketOpenSSL object from an SSL instance.
int ssl_socket_data_index_;
- base::ScopedOpenSSL<SSL_CTX, SSL_CTX_free> ssl_ctx_;
+ crypto::ScopedOpenSSL<SSL_CTX, SSL_CTX_free> ssl_ctx_;
SSLSessionCache session_cache_;
};
@@ -415,7 +415,7 @@
DCHECK(!transport_bio_);
SSLContext* context = SSLContext::GetInstance();
- base::OpenSSLErrStackTracer err_tracer(FROM_HERE);
+ crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
ssl_ = SSL_new(context->ssl_ctx());
if (!ssl_ || !context->SetClientSocketForSSL(ssl_, this))
@@ -723,7 +723,7 @@
}
int SSLClientSocketOpenSSL::DoHandshake() {
- base::OpenSSLErrStackTracer err_tracer(FROM_HERE);
+ crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
int net_error = net::OK;
int rv = SSL_do_handshake(ssl_);
@@ -855,7 +855,7 @@
if (server_cert_)
return server_cert_;
- base::ScopedOpenSSL<X509, X509_free> cert(SSL_get_peer_certificate(ssl_));
+ crypto::ScopedOpenSSL<X509, X509_free> cert(SSL_get_peer_certificate(ssl_));
if (!cert.get()) {
LOG(WARNING) << "SSL_get_peer_certificate returned NULL";
return NULL;
@@ -1165,7 +1165,7 @@
}
int SSLClientSocketOpenSSL::DoPayloadRead() {
- base::OpenSSLErrStackTracer err_tracer(FROM_HERE);
+ crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
int rv = SSL_read(ssl_, user_read_buf_->data(), user_read_buf_len_);
// We don't need to invalidate the non-client-authenticated SSL session
// because the server will renegotiate anyway.
@@ -1180,7 +1180,7 @@
}
int SSLClientSocketOpenSSL::DoPayloadWrite() {
- base::OpenSSLErrStackTracer err_tracer(FROM_HERE);
+ crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
int rv = SSL_write(ssl_, user_write_buf_->data(), user_write_buf_len_);
if (rv >= 0)

Powered by Google App Engine
This is Rietveld 408576698