OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SSL_CLIENT_CERT_STORE_CHROMEOS_H_ | 5 #ifndef NET_SSL_CLIENT_CERT_STORE_CHROMEOS_H_ |
6 #define NET_SSL_CLIENT_CERT_STORE_CHROMEOS_H_ | 6 #define NET_SSL_CLIENT_CERT_STORE_CHROMEOS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 // Must be called at most once. | 26 // Must be called at most once. |
27 virtual bool Init(const base::Closure& callback) = 0; | 27 virtual bool Init(const base::Closure& callback) = 0; |
28 | 28 |
29 // Returns true if |cert| is allowed to be used as a client certificate | 29 // Returns true if |cert| is allowed to be used as a client certificate |
30 // (e.g. for a certain browser context or user). | 30 // (e.g. for a certain browser context or user). |
31 // This is only called once initialization is finished, see Init(). | 31 // This is only called once initialization is finished, see Init(). |
32 virtual bool IsCertAllowed( | 32 virtual bool IsCertAllowed( |
33 const scoped_refptr<X509Certificate>& cert) const = 0; | 33 const scoped_refptr<X509Certificate>& cert) const = 0; |
34 }; | 34 }; |
35 | 35 |
36 // This ClientCertStore will return only client certs that pass the filter | 36 // This ClientCertStore will return client certs from NSS certificate |
37 // |cert_filter|. | 37 // databases that pass the filter |cert_filter| and unconditionally the certs |
38 // from |additional_certs|. | |
38 ClientCertStoreChromeOS( | 39 ClientCertStoreChromeOS( |
40 const CertificateList& additional_certs, | |
Ryan Sleevi
2015/08/07 23:51:09
Are you sure this is the right pattern? I don't be
pneubeck (no reviews)
2015/08/10 12:09:56
Yeah, I thought about that point as well.
As far a
davidben
2015/08/10 21:54:00
Honestly, this whole ClientCertStore thing is pret
pneubeck (no reviews)
2015/08/13 12:25:24
Done.
| |
39 scoped_ptr<CertFilter> cert_filter, | 41 scoped_ptr<CertFilter> cert_filter, |
40 const PasswordDelegateFactory& password_delegate_factory); | 42 const PasswordDelegateFactory& password_delegate_factory); |
41 ~ClientCertStoreChromeOS() override; | 43 ~ClientCertStoreChromeOS() override; |
42 | 44 |
43 // ClientCertStoreNSS: | 45 // ClientCertStoreNSS: |
44 void GetClientCerts(const SSLCertRequestInfo& cert_request_info, | 46 void GetClientCerts(const SSLCertRequestInfo& cert_request_info, |
45 CertificateList* selected_certs, | 47 CertificateList* selected_certs, |
46 const base::Closure& callback) override; | 48 const base::Closure& callback) override; |
47 | 49 |
48 protected: | 50 protected: |
49 // ClientCertStoreNSS: | 51 // ClientCertStoreNSS: |
50 void GetClientCertsImpl(CERTCertList* cert_list, | 52 void GetClientCertsImpl(CERTCertList* cert_list, |
51 const SSLCertRequestInfo& request, | 53 const SSLCertRequestInfo& request, |
52 bool query_nssdb, | 54 bool query_nssdb, |
53 CertificateList* selected_certs) override; | 55 CertificateList* selected_certs) override; |
54 | 56 |
55 private: | 57 private: |
56 void CertFilterInitialized(const SSLCertRequestInfo* request, | 58 void CertFilterInitialized(const SSLCertRequestInfo* request, |
57 CertificateList* selected_certs, | 59 CertificateList* selected_certs, |
58 const base::Closure& callback); | 60 const base::Closure& callback); |
59 | 61 |
62 const CertificateList additional_certs_; | |
60 scoped_ptr<CertFilter> cert_filter_; | 63 scoped_ptr<CertFilter> cert_filter_; |
61 | 64 |
62 DISALLOW_COPY_AND_ASSIGN(ClientCertStoreChromeOS); | 65 DISALLOW_COPY_AND_ASSIGN(ClientCertStoreChromeOS); |
63 }; | 66 }; |
64 | 67 |
65 } // namespace net | 68 } // namespace net |
66 | 69 |
67 #endif // NET_SSL_CLIENT_CERT_STORE_CHROMEOS_H_ | 70 #endif // NET_SSL_CLIENT_CERT_STORE_CHROMEOS_H_ |
OLD | NEW |