CertificateList => ScopedCERTCertificateList

This commit is contained in:
Cheng Zhao 2018-03-12 15:28:55 +09:00 committed by Aleksei Kuzmin
parent 0f9f04e4ec
commit 76ef6e3ecc
3 changed files with 16 additions and 15 deletions

View file

@ -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);

View file

@ -91,11 +91,12 @@ CertificateManagerModel::CertificateManagerModel(
CertificateManagerModel::~CertificateManagerModel() {
}
int CertificateManagerModel::ImportFromPKCS12(PK11SlotInfo* slot_info,
int CertificateManagerModel::ImportFromPKCS12(
PK11SlotInfo* slot_info,
const std::string& data,
const base::string16& password,
bool is_extractable,
net::CertificateList* imported_certs) {
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);
}

View file

@ -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,