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

Unified 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: Forgot about unittests 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 side-by-side diff with in-line comments
Download patch
Index: net/base/ssl_client_auth_cache.cc
diff --git a/net/base/ssl_client_auth_cache.cc b/net/base/ssl_client_auth_cache.cc
index d2f47cc2b0c61a92335fa7e59657b05ec8253875..d16d4df1e19d479cc1ae07c8e85bcbac2e6670d7 100644
--- a/net/base/ssl_client_auth_cache.cc
+++ b/net/base/ssl_client_auth_cache.cc
@@ -4,15 +4,26 @@
#include "net/base/ssl_client_auth_cache.h"
+#include "base/logging.h"
+#include "net/base/x509_certificate.h"
+
namespace net {
SSLClientAuthCache::SSLClientAuthCache() {}
SSLClientAuthCache::~SSLClientAuthCache() {}
-X509Certificate* SSLClientAuthCache::Lookup(const std::string& server) {
+bool SSLClientAuthCache::Lookup(const std::string& server,
+ X509Certificate** certificate) {
+ DCHECK(certificate);
+ *certificate = NULL;
+
AuthCacheMap::iterator iter = cache_.find(server);
- return (iter == cache_.end()) ? NULL : iter->second;
+ if (iter == cache_.end())
+ return false;
+
+ *certificate = iter->second;
+ return true;
}
void SSLClientAuthCache::Add(const std::string& server,

Powered by Google App Engine
This is Rietveld 408576698