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

Side by Side Diff: net/base/ssl_client_auth_cache.cc

Issue 4568002: Remember if a user declines to provide a server with a client certificate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and wtc feedback Created 10 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 | Annotate | Revision Log
« no previous file with comments | « net/base/ssl_client_auth_cache.h ('k') | net/base/ssl_client_auth_cache_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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/base/ssl_client_auth_cache.h" 5 #include "net/base/ssl_client_auth_cache.h"
6 6
7 #include "base/logging.h"
8 #include "net/base/x509_certificate.h"
9
7 namespace net { 10 namespace net {
8 11
9 SSLClientAuthCache::SSLClientAuthCache() {} 12 SSLClientAuthCache::SSLClientAuthCache() {}
10 13
11 SSLClientAuthCache::~SSLClientAuthCache() {} 14 SSLClientAuthCache::~SSLClientAuthCache() {}
12 15
13 X509Certificate* SSLClientAuthCache::Lookup(const std::string& server) { 16 bool SSLClientAuthCache::Lookup(
17 const std::string& server,
18 scoped_refptr<X509Certificate>* certificate) {
19 DCHECK(certificate);
20
14 AuthCacheMap::iterator iter = cache_.find(server); 21 AuthCacheMap::iterator iter = cache_.find(server);
15 return (iter == cache_.end()) ? NULL : iter->second; 22 if (iter == cache_.end())
23 return false;
24
25 *certificate = iter->second;
26 return true;
16 } 27 }
17 28
18 void SSLClientAuthCache::Add(const std::string& server, 29 void SSLClientAuthCache::Add(const std::string& server,
19 X509Certificate* value) { 30 X509Certificate* value) {
20 cache_[server] = value; 31 cache_[server] = value;
21 32
22 // TODO(wtc): enforce a maximum number of entries. 33 // TODO(wtc): enforce a maximum number of entries.
23 } 34 }
24 35
25 void SSLClientAuthCache::Remove(const std::string& server) { 36 void SSLClientAuthCache::Remove(const std::string& server) {
26 cache_.erase(server); 37 cache_.erase(server);
27 } 38 }
28 39
29 } // namespace net 40 } // namespace net
OLDNEW
« no previous file with comments | « net/base/ssl_client_auth_cache.h ('k') | net/base/ssl_client_auth_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698