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

Unified Diff: net/base/x509_certificate_win.cc

Issue 7473009: Revert r92977 partially to fix a certificate verification regression (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Move CreateOSCert into the unnamed namespace Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/x509_certificate.cc ('k') | net/socket/ssl_client_socket_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/x509_certificate_win.cc
===================================================================
--- net/base/x509_certificate_win.cc (revision 93224)
+++ net/base/x509_certificate_win.cc (working copy)
@@ -4,6 +4,7 @@
#include "net/base/x509_certificate.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/pickle.h"
#include "base/sha1.h"
@@ -642,6 +643,37 @@
}
}
+class GlobalCertStore {
+ public:
+ HCERTSTORE cert_store() {
+ return cert_store_;
+ }
+
+ private:
+ friend struct base::DefaultLazyInstanceTraits<GlobalCertStore>;
+
+ GlobalCertStore()
+ : cert_store_(CertOpenStore(CERT_STORE_PROV_MEMORY, 0, NULL, 0, NULL)) {
+ }
+
+ ~GlobalCertStore() {
+ CertCloseStore(cert_store_, 0 /* flags */);
+ }
+
+ const HCERTSTORE cert_store_;
+
+ DISALLOW_COPY_AND_ASSIGN(GlobalCertStore);
+};
+
+static base::LazyInstance<GlobalCertStore,
+ base::LeakyLazyInstanceTraits<GlobalCertStore> >
+ g_cert_store(base::LINKER_INITIALIZED);
+
+// static
+HCERTSTORE X509Certificate::cert_store() {
+ return g_cert_store.Get().cert_store();
+}
+
int X509Certificate::VerifyInternal(const std::string& hostname,
int flags,
CertVerifyResult* verify_result) const {
« no previous file with comments | « net/base/x509_certificate.cc ('k') | net/socket/ssl_client_socket_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698