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

Unified Diff: net/socket/ssl_client_socket.cc

Issue 6487012: Clear the SSL Client Auth cache when a new SSL Client Certificate is... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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.cc
===================================================================
--- net/socket/ssl_client_socket.cc (revision 75583)
+++ net/socket/ssl_client_socket.cc (working copy)
@@ -4,6 +4,16 @@
#include "net/socket/ssl_client_socket.h"
+#if defined(OS_WIN)
+#include "net/socket/ssl_client_socket_nss.h"
+#elif defined(USE_OPENSSL)
+#include "net/socket/ssl_client_socket_openssl.h"
+#elif defined(USE_NSS)
+#include "net/socket/ssl_client_socket_nss.h"
+#elif defined(OS_MACOSX)
+#include "net/socket/ssl_client_socket_nss.h"
+#endif
+
namespace net {
SSLClientSocket::SSLClientSocket()
@@ -59,4 +69,43 @@
return was_spdy_negotiated_ = negotiated;
}
+// Default mechanism for clearing the SSL session cache, which is
+// to use the NSS function.
+void DefaultClearSSLSessionCache() {
+#if defined(OS_WIN)
+ return SSLClientSocketNSS::ClearSessionCache();
+#elif defined(USE_OPENSSL)
+ // no-op
+#elif defined(USE_NSS)
+ return SSLClientSocketNSS::ClearSessionCache();
+#elif defined(OS_MACOSX)
+ return SSLClientSocketNSS::ClearSessionCache();
+#else
+ NOTIMPLEMENTED();
+#endif
+}
+
+// Default mechanism for clearing the SSL session cache, which is not actually
+// definted on mac/windows.
+void SystemClearSSLSessionCache() {
+#if defined(OS_WIN)
+ // no-op
+#elif defined(OS_MACOSX)
+ // no-op
+#else
+ NOTIMPLEMENTED();
+#endif
+}
+
+void (*g_clear_ssl_session_cache)() =
+ DefaultClearSSLSessionCache;
+
+void SSLClientSocket::ClearSSLSessionCache() {
+ g_clear_ssl_session_cache();
+}
+
+void SSLClientSocket::UseSystemClearSSLSessionCache() {
+ g_clear_ssl_session_cache = SystemClearSSLSessionCache;
+}
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698