summaryrefslogtreecommitdiff
path: root/chromium/net/cert/test_root_certs.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/cert/test_root_certs.h')
-rw-r--r--chromium/net/cert/test_root_certs.h50
1 files changed, 7 insertions, 43 deletions
diff --git a/chromium/net/cert/test_root_certs.h b/chromium/net/cert/test_root_certs.h
index c0be7b78328..756379fb9b7 100644
--- a/chromium/net/cert/test_root_certs.h
+++ b/chromium/net/cert/test_root_certs.h
@@ -12,11 +12,7 @@
#include "net/base/net_export.h"
#include "net/cert/internal/trust_store_in_memory.h"
-#if defined(USE_NSS_CERTS)
-#include <cert.h>
-#include <vector>
-#include "net/cert/scoped_nss_types.h"
-#elif defined(OS_WIN)
+#if defined(OS_WIN)
#include <windows.h>
#include "base/win/wincrypt_shim.h"
#elif defined(OS_MACOSX)
@@ -62,10 +58,7 @@ class NET_EXPORT TestRootCerts {
// Returns true if there are no certificates that have been marked trusted.
bool IsEmpty() const;
-#if defined(USE_NSS_CERTS)
- bool Contains(CERTCertificate* cert) const;
- TrustStore* test_trust_store() { return &test_trust_store_; }
-#elif defined(OS_MACOSX)
+#if defined(OS_MACOSX)
CFArrayRef temporary_roots() const { return temporary_roots_; }
// Modifies the root certificates of |trust_ref| to include the
@@ -82,7 +75,7 @@ class NET_EXPORT TestRootCerts {
// engine is appropriate. The caller is responsible for freeing the
// returned HCERTCHAINENGINE.
HCERTCHAINENGINE GetChainEngine() const;
-#elif defined(OS_FUCHSIA)
+#elif defined(OS_FUCHSIA) || defined(OS_LINUX) || defined(OS_CHROMEOS)
TrustStore* test_trust_store() { return &test_trust_store_; }
#endif
@@ -95,46 +88,17 @@ class NET_EXPORT TestRootCerts {
// Performs platform-dependent initialization.
void Init();
-#if defined(USE_NSS_CERTS)
- // TrustEntry is used to store the original CERTCertificate and CERTCertTrust
- // for a certificate whose trust status has been changed by the
- // TestRootCerts.
- class TrustEntry {
- public:
- // Creates a new TrustEntry by incrementing the reference to |certificate|
- // and copying |trust|.
- TrustEntry(ScopedCERTCertificate certificate, const CERTCertTrust& trust);
- ~TrustEntry();
-
- CERTCertificate* certificate() const { return certificate_.get(); }
- const CERTCertTrust& trust() const { return trust_; }
-
- private:
- // The temporary root certificate.
- ScopedCERTCertificate certificate_;
-
- // The original trust settings, before |certificate_| was manipulated to
- // be a temporarily trusted root.
- CERTCertTrust trust_;
-
- DISALLOW_COPY_AND_ASSIGN(TrustEntry);
- };
-
- // It is necessary to maintain a cache of the original certificate trust
- // settings, in order to restore them when Clear() is called.
- std::vector<std::unique_ptr<TrustEntry>> trust_cache_;
-
- TrustStoreInMemory test_trust_store_;
-#elif defined(OS_WIN)
+#if defined(OS_WIN)
HCERTSTORE temporary_roots_;
#elif defined(OS_MACOSX)
base::ScopedCFTypeRef<CFMutableArrayRef> temporary_roots_;
TrustStoreInMemory test_trust_store_;
-#elif defined(OS_FUCHSIA)
+#elif defined(OS_FUCHSIA) || defined(OS_LINUX) || defined(OS_CHROMEOS)
TrustStoreInMemory test_trust_store_;
#endif
-#if defined(OS_WIN) || defined(OS_ANDROID) || defined(OS_FUCHSIA)
+#if defined(OS_WIN) || defined(OS_ANDROID) || defined(OS_FUCHSIA) || \
+ defined(OS_LINUX) || defined(OS_CHROMEOS)
// True if there are no temporarily trusted root certificates.
bool empty_ = true;
#endif