| 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 #ifndef NET_CERT_TEST_ROOT_CERTS_H_ | 5 #ifndef NET_CERT_TEST_ROOT_CERTS_H_ |
| 6 #define NET_CERT_TEST_ROOT_CERTS_H_ | 6 #define NET_CERT_TEST_ROOT_CERTS_H_ |
| 7 | 7 |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // Modifies the root certificates of |trust_ref| to include the | 72 // Modifies the root certificates of |trust_ref| to include the |
| 73 // certificates stored in |temporary_roots_|. If IsEmpty() is true, this | 73 // certificates stored in |temporary_roots_|. If IsEmpty() is true, this |
| 74 // does not modify |trust_ref|. | 74 // does not modify |trust_ref|. |
| 75 OSStatus FixupSecTrustRef(SecTrustRef trust_ref) const; | 75 OSStatus FixupSecTrustRef(SecTrustRef trust_ref) const; |
| 76 | 76 |
| 77 // Configures whether or not the default/system root store should also | 77 // Configures whether or not the default/system root store should also |
| 78 // be trusted. By default, this is true, indicating that the TestRootCerts | 78 // be trusted. By default, this is true, indicating that the TestRootCerts |
| 79 // are used in addition to OS trust store. | 79 // are used in addition to OS trust store. |
| 80 void SetAllowSystemTrust(bool allow_system_trust); | 80 void SetAllowSystemTrust(bool allow_system_trust); |
| 81 #elif defined(USE_OPENSSL_CERTS) && !defined(OS_ANDROID) | 81 #elif defined(USE_OPENSSL_CERTS) && !defined(OS_ANDROID) |
| 82 const std::vector<scoped_refptr<X509Certificate> >& | 82 const std::vector<scoped_refptr<X509Certificate> >& temporary_roots() const { |
| 83 temporary_roots() const { return temporary_roots_; } | 83 return temporary_roots_; |
| 84 } |
| 84 bool Contains(X509* cert) const; | 85 bool Contains(X509* cert) const; |
| 85 #elif defined(OS_WIN) | 86 #elif defined(OS_WIN) |
| 86 HCERTSTORE temporary_roots() const { return temporary_roots_; } | 87 HCERTSTORE temporary_roots() const { return temporary_roots_; } |
| 87 | 88 |
| 88 // Returns an HCERTCHAINENGINE suitable to be used for certificate | 89 // Returns an HCERTCHAINENGINE suitable to be used for certificate |
| 89 // validation routines, or NULL to indicate that the default system chain | 90 // validation routines, or NULL to indicate that the default system chain |
| 90 // engine is appropriate. The caller is responsible for freeing the | 91 // engine is appropriate. The caller is responsible for freeing the |
| 91 // returned HCERTCHAINENGINE. | 92 // returned HCERTCHAINENGINE. |
| 92 HCERTCHAINENGINE GetChainEngine() const; | 93 HCERTCHAINENGINE GetChainEngine() const; |
| 93 #endif | 94 #endif |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 141 |
| 141 private: | 142 private: |
| 142 scoped_refptr<X509Certificate> cert_; | 143 scoped_refptr<X509Certificate> cert_; |
| 143 | 144 |
| 144 DISALLOW_COPY_AND_ASSIGN(ScopedTestRoot); | 145 DISALLOW_COPY_AND_ASSIGN(ScopedTestRoot); |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 } // namespace net | 148 } // namespace net |
| 148 | 149 |
| 149 #endif // NET_CERT_TEST_ROOT_CERTS_H_ | 150 #endif // NET_CERT_TEST_ROOT_CERTS_H_ |
| OLD | NEW |