summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorgspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-13 01:52:36 +0000
committergspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-13 01:52:36 +0000
commit91f10325d9835d204cbe88693f79221b3b402931 (patch)
treed91573a39f3ad21d57fe5100a465fa089aaee804 /net
parent400f521a37053501a85f92ea6bc57f9a4daf3072 (diff)
downloadchromium_src-91f10325d9835d204cbe88693f79221b3b402931.zip
chromium_src-91f10325d9835d204cbe88693f79221b3b402931.tar.gz
chromium_src-91f10325d9835d204cbe88693f79221b3b402931.tar.bz2
This fixes a bug I introduced last night with
fetching the default nickname. BUG=none TEST=imported user certs successfully. Review URL: http://codereview.chromium.org/8919020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114150 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/cert_database_nss.cc1
-rw-r--r--net/base/x509_certificate_nss.cc2
2 files changed, 1 insertions, 2 deletions
diff --git a/net/base/cert_database_nss.cc b/net/base/cert_database_nss.cc
index 6781917..a8ee5dd 100644
--- a/net/base/cert_database_nss.cc
+++ b/net/base/cert_database_nss.cc
@@ -64,7 +64,6 @@ int CertDatabase::CheckUserCert(X509Certificate* cert_obj) {
int CertDatabase::AddUserCert(X509Certificate* cert_obj) {
CERTCertificate* cert = cert_obj->os_cert_handle();
PK11SlotInfo* slot = NULL;
- std::string nickname;
{
crypto::AutoNSSWriteLock lock;
diff --git a/net/base/x509_certificate_nss.cc b/net/base/x509_certificate_nss.cc
index af7172c..0436abb 100644
--- a/net/base/x509_certificate_nss.cc
+++ b/net/base/x509_certificate_nss.cc
@@ -710,7 +710,7 @@ std::string X509Certificate::GetDefaultNickname(CertType type) const {
return default_nickname_;
std::string result;
- if (type == USER_CERT) {
+ if (type == USER_CERT && cert_handle_->slot) {
// Find the private key for this certificate and see if it has a
// nickname. If there is a private key, and it has a nickname, then
// we return that nickname.