Browse Source

CertificateList => ScopedCERTCertificateList

Cheng Zhao 7 years ago
parent
commit
76ef6e3ecc

+ 1 - 1
atom/browser/api/atom_api_app.cc

@@ -484,7 +484,7 @@ int ImportIntoCertStore(
     const base::DictionaryValue& options) {
   std::string file_data, cert_path;
   base::string16 password;
-  net::CertificateList imported_certs;
+  net::ScopedCERTCertificateList imported_certs;
   int rv = -1;
   options.GetString("certificate", &cert_path);
   options.GetString("password", &password);

+ 10 - 9
chromium_src/chrome/browser/certificate_manager_model.cc

@@ -91,11 +91,12 @@ CertificateManagerModel::CertificateManagerModel(
 CertificateManagerModel::~CertificateManagerModel() {
 }
 
-int CertificateManagerModel::ImportFromPKCS12(PK11SlotInfo* slot_info,
-                                              const std::string& data,
-                                              const base::string16& password,
-                                              bool is_extractable,
-                                              net::CertificateList* imported_certs) {
+int CertificateManagerModel::ImportFromPKCS12(
+    PK11SlotInfo* slot_info,
+    const std::string& data,
+    const base::string16& password,
+    bool is_extractable,
+    net::ScopedCERTCertificateList* imported_certs) {
   return cert_db_->ImportFromPKCS12(slot_info, data, password,
                                     is_extractable, imported_certs);
 }
@@ -105,14 +106,14 @@ int CertificateManagerModel::ImportUserCert(const std::string& data) {
 }
 
 bool CertificateManagerModel::ImportCACerts(
-    const net::CertificateList& certificates,
+    const net::ScopedCERTCertificateList& certificates,
     net::NSSCertDatabase::TrustBits trust_bits,
     net::NSSCertDatabase::ImportCertFailureList* not_imported) {
   return cert_db_->ImportCACerts(certificates, trust_bits, not_imported);
 }
 
 bool CertificateManagerModel::ImportServerCert(
-    const net::CertificateList& certificates,
+    const net::ScopedCERTCertificateList& certificates,
     net::NSSCertDatabase::TrustBits trust_bits,
     net::NSSCertDatabase::ImportCertFailureList* not_imported) {
   return cert_db_->ImportServerCert(certificates, trust_bits,
@@ -120,13 +121,13 @@ bool CertificateManagerModel::ImportServerCert(
 }
 
 bool CertificateManagerModel::SetCertTrust(
-    const net::X509Certificate* cert,
+    CERTCertificate* cert,
     net::CertType type,
     net::NSSCertDatabase::TrustBits trust_bits) {
   return cert_db_->SetCertTrust(cert, type, trust_bits);
 }
 
-bool CertificateManagerModel::Delete(net::X509Certificate* cert) {
+bool CertificateManagerModel::Delete(CERTCertificate* cert) {
   return cert_db_->DeleteCertAndKey(cert);
 }
 

+ 5 - 5
chromium_src/chrome/browser/certificate_manager_model.h

@@ -48,7 +48,7 @@ class CertificateManagerModel {
                        const std::string& data,
                        const base::string16& password,
                        bool is_extractable,
-                       net::CertificateList* imported_certs);
+                       net::ScopedCERTCertificateList* imported_certs);
 
   // Import user certificate from DER encoded |data|.
   // Returns a net error code on failure.
@@ -62,7 +62,7 @@ class CertificateManagerModel {
   // Returns false if there is an internal error, otherwise true is returned and
   // |not_imported| should be checked for any certificates that were not
   // imported.
-  bool ImportCACerts(const net::CertificateList& certificates,
+  bool ImportCACerts(const net::ScopedCERTCertificateList& certificates,
                      net::NSSCertDatabase::TrustBits trust_bits,
                      net::NSSCertDatabase::ImportCertFailureList* not_imported);
 
@@ -77,20 +77,20 @@ class CertificateManagerModel {
   // |not_imported| should be checked for any certificates that were not
   // imported.
   bool ImportServerCert(
-      const net::CertificateList& certificates,
+      const net::ScopedCERTCertificateList& certificates,
       net::NSSCertDatabase::TrustBits trust_bits,
       net::NSSCertDatabase::ImportCertFailureList* not_imported);
 
   // Set trust values for certificate.
   // |trust_bits| should be a bit field of TRUST* values from NSSCertDatabase.
   // Returns true on success or false on failure.
-  bool SetCertTrust(const net::X509Certificate* cert,
+  bool SetCertTrust(CERTCertificate* cert,
                     net::CertType type,
                     net::NSSCertDatabase::TrustBits trust_bits);
 
   // Delete the cert.  Returns true on success.  |cert| is still valid when this
   // function returns.
-  bool Delete(net::X509Certificate* cert);
+  bool Delete(CERTCertificate* cert);
 
  private:
   CertificateManagerModel(net::NSSCertDatabase* nss_cert_database,