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

Unified Diff: net/socket/ssl_client_socket_openssl.cc

Issue 361193003: Eliminate ScopedOpenSSL in favour of scoped_ptr<> specializations. (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/quic/test_tools/crypto_test_utils_openssl.cc ('k') | net/socket/ssl_client_socket_openssl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_openssl.cc
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc
index b63e120108eaba2cce38ebac3917f80501658c37..8bdc3148d11e83b8b2a28ee5ceebca57d6bce9f5 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -18,6 +18,7 @@
#include "base/synchronization/lock.h"
#include "crypto/ec_private_key.h"
#include "crypto/openssl_util.h"
+#include "crypto/scoped_openssl_types.h"
#include "net/base/net_errors.h"
#include "net/cert/cert_verifier.h"
#include "net/cert/single_request_cert_verifier.h"
@@ -96,6 +97,10 @@ std::string GetSocketSessionCacheKey(const SSLClientSocketOpenSSL& socket) {
return result;
}
+static void FreeX509Stack(STACK_OF(X509) * ptr) {
+ sk_X509_pop_free(ptr, X509_free);
+}
+
} // namespace
class SSLClientSocketOpenSSL::SSLContext {
@@ -170,7 +175,7 @@ class SSLClientSocketOpenSSL::SSLContext {
// SSLClientSocketOpenSSL object from an SSL instance.
int ssl_socket_data_index_;
- crypto::ScopedOpenSSL<SSL_CTX, SSL_CTX_free> ssl_ctx_;
+ crypto::ScopedOpenSSL<SSL_CTX, SSL_CTX_free>::Type ssl_ctx_;
// |session_cache_| must be destroyed before |ssl_ctx_|.
SSLSessionCacheOpenSSL session_cache_;
};
@@ -209,13 +214,10 @@ class SSLClientSocketOpenSSL::PeerCertificateChain {
bool IsValid() { return os_chain_.get() && openssl_chain_.get(); }
private:
- static void FreeX509Stack(STACK_OF(X509)* cert_chain) {
- sk_X509_pop_free(cert_chain, X509_free);
- }
-
- friend class crypto::ScopedOpenSSL<STACK_OF(X509), FreeX509Stack>;
+ typedef crypto::ScopedOpenSSL<STACK_OF(X509), FreeX509Stack>::Type
+ ScopedX509Stack;
- crypto::ScopedOpenSSL<STACK_OF(X509), FreeX509Stack> openssl_chain_;
+ ScopedX509Stack openssl_chain_;
scoped_refptr<X509Certificate> os_chain_;
};
« no previous file with comments | « net/quic/test_tools/crypto_test_utils_openssl.cc ('k') | net/socket/ssl_client_socket_openssl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698