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

Side by Side Diff: chrome/browser/certificate_manager_model.h

Issue 9940001: Fix imported server certs being distrusted in NSS 3.13. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/certificate_manager_model.cc » ('j') | net/base/cert_database.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 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 CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ 5 #ifndef CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_
6 #define CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ 6 #define CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // Import server certificate. The first cert should be the server cert. Any 79 // Import server certificate. The first cert should be the server cert. Any
80 // additional certs should be intermediate/CA certs and will be imported but 80 // additional certs should be intermediate/CA certs and will be imported but
81 // not given any trust. 81 // not given any trust.
82 // Any certificates that could not be imported will be listed in 82 // Any certificates that could not be imported will be listed in
83 // |not_imported|. 83 // |not_imported|.
84 // Returns false if there is an internal error, otherwise true is returned and 84 // Returns false if there is an internal error, otherwise true is returned and
85 // |not_imported| should be checked for any certificates that were not 85 // |not_imported| should be checked for any certificates that were not
86 // imported. 86 // imported.
87 bool ImportServerCert( 87 bool ImportServerCert(
88 const net::CertificateList& certificates, 88 const net::CertificateList& certificates,
89 net::CertDatabase::TrustBits trust_bits,
wtc 2012/03/30 22:00:50 Document the new trust_bits parameter.
mattm 2012/05/16 03:30:45 Done.
89 net::CertDatabase::ImportCertFailureList* not_imported); 90 net::CertDatabase::ImportCertFailureList* not_imported);
90 91
91 // Set trust values for certificate. 92 // Set trust values for certificate.
92 // |trust_bits| should be a bit field of TRUST_* values from CertDatabase, or 93 // |trust_bits| should be a bit field of TRUST_* values from CertDatabase, or
93 // UNTRUSTED. 94 // UNTRUSTED.
94 // Returns true on success or false on failure. 95 // Returns true on success or false on failure.
95 bool SetCertTrust(const net::X509Certificate* cert, 96 bool SetCertTrust(const net::X509Certificate* cert,
96 net::CertType type, 97 net::CertType type,
97 net::CertDatabase::TrustBits trust_bits); 98 net::CertDatabase::TrustBits trust_bits);
98 99
99 // Delete the cert. Returns true on success. |cert| is still valid when this 100 // Delete the cert. Returns true on success. |cert| is still valid when this
100 // function returns. 101 // function returns.
101 bool Delete(net::X509Certificate* cert); 102 bool Delete(net::X509Certificate* cert);
102 103
103 private: 104 private:
104 // Callback used by Refresh() for when the cert slots have been unlocked. 105 // Callback used by Refresh() for when the cert slots have been unlocked.
105 // This method does the actual refreshing. 106 // This method does the actual refreshing.
106 void RefreshSlotsUnlocked(); 107 void RefreshSlotsUnlocked();
107 108
108 net::CertDatabase cert_db_; 109 net::CertDatabase cert_db_;
109 net::CertificateList cert_list_; 110 net::CertificateList cert_list_;
110 111
111 // The observer to notify when certificate list is refreshed. 112 // The observer to notify when certificate list is refreshed.
112 Observer* observer_; 113 Observer* observer_;
113 114
114 DISALLOW_COPY_AND_ASSIGN(CertificateManagerModel); 115 DISALLOW_COPY_AND_ASSIGN(CertificateManagerModel);
115 }; 116 };
116 117
117 #endif // CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ 118 #endif // CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/certificate_manager_model.cc » ('j') | net/base/cert_database.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698