OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/x509_certificate.h" | 5 #include "net/base/x509_certificate.h" |
6 | 6 |
7 #define PRArenaPool PLArenaPool // Required by <blapi.h>. | 7 #define PRArenaPool PLArenaPool // Required by <blapi.h>. |
8 #include <blapi.h> // Implement CalculateChainFingerprint() with NSS. | 8 #include <blapi.h> // Implement CalculateChainFingerprint() with NSS. |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 | 797 |
798 ~GlobalCertStore() { | 798 ~GlobalCertStore() { |
799 CertCloseStore(cert_store_, 0 /* flags */); | 799 CertCloseStore(cert_store_, 0 /* flags */); |
800 } | 800 } |
801 | 801 |
802 const HCERTSTORE cert_store_; | 802 const HCERTSTORE cert_store_; |
803 | 803 |
804 DISALLOW_COPY_AND_ASSIGN(GlobalCertStore); | 804 DISALLOW_COPY_AND_ASSIGN(GlobalCertStore); |
805 }; | 805 }; |
806 | 806 |
807 static base::LazyInstance<GlobalCertStore, | 807 static base::LazyInstance<GlobalCertStore>::Leaky |
808 base::LeakyLazyInstanceTraits<GlobalCertStore> > | |
809 g_cert_store = LAZY_INSTANCE_INITIALIZER; | 808 g_cert_store = LAZY_INSTANCE_INITIALIZER; |
810 | 809 |
811 // static | 810 // static |
812 HCERTSTORE X509Certificate::cert_store() { | 811 HCERTSTORE X509Certificate::cert_store() { |
813 return g_cert_store.Get().cert_store(); | 812 return g_cert_store.Get().cert_store(); |
814 } | 813 } |
815 | 814 |
816 PCCERT_CONTEXT X509Certificate::CreateOSCertChainForCert() const { | 815 PCCERT_CONTEXT X509Certificate::CreateOSCertChainForCert() const { |
817 // Create an in-memory certificate store to hold this certificate and | 816 // Create an in-memory certificate store to hold this certificate and |
818 // any intermediate certificates in |intermediate_ca_certs_|. The store | 817 // any intermediate certificates in |intermediate_ca_certs_|. The store |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 *type = kPublicKeyTypeECDH; | 1265 *type = kPublicKeyTypeECDH; |
1267 break; | 1266 break; |
1268 default: | 1267 default: |
1269 *type = kPublicKeyTypeUnknown; | 1268 *type = kPublicKeyTypeUnknown; |
1270 *size_bits = 0; | 1269 *size_bits = 0; |
1271 break; | 1270 break; |
1272 } | 1271 } |
1273 } | 1272 } |
1274 | 1273 |
1275 } // namespace net | 1274 } // namespace net |
OLD | NEW |