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

Unified Diff: net/base/cert_database_nss.cc

Issue 8566056: This applies GUIDs to certificate and key nicknames when (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final review changes Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/cert_database.h ('k') | net/base/cert_database_nss_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cert_database_nss.cc
diff --git a/net/base/cert_database_nss.cc b/net/base/cert_database_nss.cc
index 817372d28e0006e999973ec932dde3abd15a4054..678191711d556fe11a603884ef7edfef39143f1b 100644
--- a/net/base/cert_database_nss.cc
+++ b/net/base/cert_database_nss.cc
@@ -66,28 +66,12 @@ int CertDatabase::AddUserCert(X509Certificate* cert_obj) {
PK11SlotInfo* slot = NULL;
std::string nickname;
- // Create a nickname for this certificate.
- // We use the scheme used by Firefox:
- // --> <subject's common name>'s <issuer's common name> ID.
-
- std::string username, ca_name;
- char* temp_username = CERT_GetCommonName(&cert->subject);
- char* temp_ca_name = CERT_GetCommonName(&cert->issuer);
- if (temp_username) {
- username = temp_username;
- PORT_Free(temp_username);
- }
- if (temp_ca_name) {
- ca_name = temp_ca_name;
- PORT_Free(temp_ca_name);
- }
- nickname = username + "'s " + ca_name + " ID";
-
{
crypto::AutoNSSWriteLock lock;
- slot = PK11_ImportCertForKey(cert,
- const_cast<char*>(nickname.c_str()),
- NULL);
+ slot = PK11_ImportCertForKey(
+ cert,
+ cert_obj->GetDefaultNickname(net::USER_CERT).c_str(),
+ NULL);
}
if (!slot) {
@@ -161,11 +145,13 @@ int CertDatabase::ImportFromPKCS12(
CryptoModule* module,
const std::string& data,
const string16& password,
- bool is_extractable) {
+ bool is_extractable,
+ net::CertificateList* imported_certs) {
int result = psm::nsPKCS12Blob_Import(module->os_module_handle(),
data.data(), data.size(),
password,
- is_extractable);
+ is_extractable,
+ imported_certs);
if (result == net::OK)
CertDatabase::NotifyObserversOfUserCertAdded(NULL);
@@ -328,13 +314,6 @@ bool CertDatabase::DeleteCertAndKey(const X509Certificate* cert) {
return true;
}
-bool CertDatabase::DeleteCertAndKeyByLabel(const std::string& label) {
- // TODO(gspencer):Find the certificate with the given CKA_LABEL
- // (nickname), and delete it.
- NOTIMPLEMENTED();
- return false;
-}
-
bool CertDatabase::IsReadOnly(const X509Certificate* cert) const {
PK11SlotInfo* slot = cert->os_cert_handle()->slot;
return slot && PK11_IsReadOnly(slot);
« no previous file with comments | « net/base/cert_database.h ('k') | net/base/cert_database_nss_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698