From 76ef6e3ecca2e394d50c7cc8505ae0e8151ebd57 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 12 Mar 2018 15:28:55 +0900 Subject: [PATCH] CertificateList => ScopedCERTCertificateList --- atom/browser/api/atom_api_app.cc | 2 +- .../browser/certificate_manager_model.cc | 19 ++++++++++--------- .../browser/certificate_manager_model.h | 10 +++++----- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 87cc591736f6..c38f9e237238 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/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); diff --git a/chromium_src/chrome/browser/certificate_manager_model.cc b/chromium_src/chrome/browser/certificate_manager_model.cc index 0713fc2eb807..aefc51783405 100644 --- a/chromium_src/chrome/browser/certificate_manager_model.cc +++ b/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); } diff --git a/chromium_src/chrome/browser/certificate_manager_model.h b/chromium_src/chrome/browser/certificate_manager_model.h index eb84b69f733c..d1a50b1b79a0 100644 --- a/chromium_src/chrome/browser/certificate_manager_model.h +++ b/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,