summaryrefslogtreecommitdiffstats
path: root/net/base/ssl_client_auth_cache.cc
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 19:38:58 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 19:38:58 +0000
commit56c866a252b4a7dcb525b0b29bafc4de0168b7bb (patch)
tree3eb4f9f77dede3481a05e9e2d730dbace83d13fd /net/base/ssl_client_auth_cache.cc
parent1a041bb64d411c1902e005cdc1a904607016f707 (diff)
downloadchromium_src-56c866a252b4a7dcb525b0b29bafc4de0168b7bb.zip
chromium_src-56c866a252b4a7dcb525b0b29bafc4de0168b7bb.tar.gz
chromium_src-56c866a252b4a7dcb525b0b29bafc4de0168b7bb.tar.bz2
Add a simple cache of certificates for SSL client authentication.
It is based on FtpAuthCache and will be used in similar ways. The the only difference is that the authentication data is a certificate rather than username and password. R=eroman BUG=http://crbug.com/318 TEST=new unit tests. Review URL: http://codereview.chromium.org/132004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18735 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/ssl_client_auth_cache.cc')
-rw-r--r--net/base/ssl_client_auth_cache.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/net/base/ssl_client_auth_cache.cc b/net/base/ssl_client_auth_cache.cc
new file mode 100644
index 0000000..b0deec9
--- /dev/null
+++ b/net/base/ssl_client_auth_cache.cc
@@ -0,0 +1,25 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/base/ssl_client_auth_cache.h"
+
+namespace net {
+
+X509Certificate* SSLClientAuthCache::Lookup(const std::string& server) {
+ AuthCacheMap::iterator iter = cache_.find(server);
+ return (iter == cache_.end()) ? NULL : iter->second;
+}
+
+void SSLClientAuthCache::Add(const std::string& server,
+ X509Certificate* value) {
+ cache_[server] = value;
+
+ // TODO(wtc): enforce a maximum number of entries.
+}
+
+void SSLClientAuthCache::Remove(const std::string& server) {
+ cache_.erase(server);
+}
+
+} // namespace net