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

Side by Side Diff: net/socket/ssl_session_cache_openssl.h

Issue 328903004: SSL Connect Job Waiting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add separate state for ProcessPendingJobs Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_SOCKET_SSL_SESSION_CACHE_OPENSSL_H 5 #ifndef NET_SOCKET_SSL_SESSION_CACHE_OPENSSL_H
6 #define NET_SOCKET_SSL_SESSION_CACHE_OPENSSL_H 6 #define NET_SOCKET_SSL_SESSION_CACHE_OPENSSL_H
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // ensure that the value of |cache_key| matches the result of calling the 106 // ensure that the value of |cache_key| matches the result of calling the
107 // configuration's |key_func| function with the |ssl| as parameter. 107 // configuration's |key_func| function with the |ssl| as parameter.
108 // 108 //
109 // Every |check_expiration_count| call to either SetSSLSession() or 109 // Every |check_expiration_count| call to either SetSSLSession() or
110 // SetSSLSessionWithKey() triggers a check for, and removal of, expired 110 // SetSSLSessionWithKey() triggers a check for, and removal of, expired
111 // sessions. 111 // sessions.
112 // 112 //
113 // Return true iff a cached session was associated with the |ssl| connection. 113 // Return true iff a cached session was associated with the |ssl| connection.
114 bool SetSSLSessionWithKey(SSL* ssl, const std::string& cache_key); 114 bool SetSSLSessionWithKey(SSL* ssl, const std::string& cache_key);
115 115
116 // Return true iff a cached session was associated with the given |cache_key|.
117 bool SSLSessionIsInCache(const std::string& cache_key) const;
118
116 // Indicates that the SSL session associated with |ssl| is "good" - that is, 119 // Indicates that the SSL session associated with |ssl| is "good" - that is,
117 // that all associated cryptographic parameters that were negotiated, 120 // that all associated cryptographic parameters that were negotiated,
118 // including the peer's certificate, were successfully validated. Because 121 // including the peer's certificate, were successfully validated. Because
119 // OpenSSL does not provide an asynchronous certificate verification 122 // OpenSSL does not provide an asynchronous certificate verification
120 // callback, it's necessary to manually manage the sessions to ensure that 123 // callback, it's necessary to manually manage the sessions to ensure that
121 // only validated sessions are resumed. 124 // only validated sessions are resumed.
122 void MarkSSLSessionAsGood(SSL* ssl); 125 void MarkSSLSessionAsGood(SSL* ssl);
123 126
124 // Flush removes all entries from the cache. This is typically called when 127 // Flush removes all entries from the cache. This is typically called when
125 // the system's certificate store has changed. 128 // the system's certificate store has changed.
126 void Flush(); 129 void Flush();
127 130
128 // TODO(digit): Move to client code. 131 // TODO(digit): Move to client code.
129 static const int kDefaultTimeoutSeconds = 60 * 60; 132 static const int kDefaultTimeoutSeconds = 60 * 60;
130 static const size_t kMaxEntries = 1024; 133 static const size_t kMaxEntries = 1024;
131 static const size_t kMaxExpirationChecks = 256; 134 static const size_t kMaxExpirationChecks = 256;
132 135
133 private: 136 private:
134 DISALLOW_COPY_AND_ASSIGN(SSLSessionCacheOpenSSL); 137 DISALLOW_COPY_AND_ASSIGN(SSLSessionCacheOpenSSL);
135 138
136 SSLSessionCacheOpenSSLImpl* impl_; 139 SSLSessionCacheOpenSSLImpl* impl_;
137 }; 140 };
138 141
139 } // namespace net 142 } // namespace net
140 143
141 #endif // NET_SOCKET_SSL_SESSION_CACHE_OPENSSL_H 144 #endif // NET_SOCKET_SSL_SESSION_CACHE_OPENSSL_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698