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

Unified Diff: net/socket/ssl_client_socket_nss.cc

Issue 502087: Use Separate SSL Session Cache in OTR Mode (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 6 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_nss.cc
===================================================================
--- net/socket/ssl_client_socket_nss.cc (revision 51274)
+++ net/socket/ssl_client_socket_nss.cc (working copy)
@@ -514,10 +514,17 @@
// Set the peer ID for session reuse. This is necessary when we create an
// SSL tunnel through a proxy -- GetPeerName returns the proxy's address
// rather than the destination server's address in that case.
+ // For requests in OTR mode use a modified peer id so that the session cache
+ // is not shared with non-OTR mode.
// TODO(wtc): port in |peer_address| is not the server's port when a proxy is
// used.
std::string peer_id = StringPrintf("%s:%d", hostname_.c_str(),
- peer_address.GetPort());
+ peer_address.GetPort());
+
+ // Separate session ID cache for OTR mode
+ if (ssl_config_.otr_mode)
+ peer_id += std::string("OTR");
davidben 2010/07/26 21:31:33 An explicit separator here (another colon?) would
+
rv = SSL_SetSockPeerID(nss_fd_, const_cast<char*>(peer_id.c_str()));
if (rv != SECSuccess)
LOG(INFO) << "SSL_SetSockPeerID failed: peer_id=" << peer_id;

Powered by Google App Engine
This is Rietveld 408576698