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

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

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « net/socket/ssl_client_socket_nss.cc ('k') | net/socket/ssl_session_cache_openssl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "net/socket/ssl_session_cache_openssl.h" 5 #include "net/socket/ssl_session_cache_openssl.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 9
10 #include <openssl/rand.h> 10 #include <openssl/rand.h>
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 KeyIndex::const_iterator it = key_index_.find(cache_key); 243 KeyIndex::const_iterator it = key_index_.find(cache_key);
244 if (it == key_index_.end()) 244 if (it == key_index_.end())
245 return false; 245 return false;
246 246
247 SSL_SESSION* session = *it->second; 247 SSL_SESSION* session = *it->second;
248 DCHECK(session); 248 DCHECK(session);
249 249
250 void* session_is_good = 250 void* session_is_good =
251 SSL_SESSION_get_ex_data(session, GetSSLSessionExIndex()); 251 SSL_SESSION_get_ex_data(session, GetSSLSessionExIndex());
252 252
253 return session_is_good; 253 return session_is_good != NULL;
254 } 254 }
255 255
256 void MarkSSLSessionAsGood(SSL* ssl) { 256 void MarkSSLSessionAsGood(SSL* ssl) {
257 SSL_SESSION* session = SSL_get_session(ssl); 257 SSL_SESSION* session = SSL_get_session(ssl);
258 CHECK(session); 258 CHECK(session);
259 259
260 // Mark the session as good, allowing it to be used for future connections. 260 // Mark the session as good, allowing it to be used for future connections.
261 SSL_SESSION_set_ex_data( 261 SSL_SESSION_set_ex_data(
262 session, GetSSLSessionExIndex(), reinterpret_cast<void*>(1)); 262 session, GetSSLSessionExIndex(), reinterpret_cast<void*>(1));
263 } 263 }
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 return impl_->SSLSessionIsInCache(cache_key); 521 return impl_->SSLSessionIsInCache(cache_key);
522 } 522 }
523 523
524 void SSLSessionCacheOpenSSL::MarkSSLSessionAsGood(SSL* ssl) { 524 void SSLSessionCacheOpenSSL::MarkSSLSessionAsGood(SSL* ssl) {
525 return impl_->MarkSSLSessionAsGood(ssl); 525 return impl_->MarkSSLSessionAsGood(ssl);
526 } 526 }
527 527
528 void SSLSessionCacheOpenSSL::Flush() { impl_->Flush(); } 528 void SSLSessionCacheOpenSSL::Flush() { impl_->Flush(); }
529 529
530 } // namespace net 530 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_nss.cc ('k') | net/socket/ssl_session_cache_openssl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698