diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-30 18:18:32 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-30 18:18:32 +0000 |
commit | e83ba1c4aecdd8bbcdf43c3d8f5581321418ab0e (patch) | |
tree | 22ba8245f15c16d187553f4d31015731c82fc058 /net/socket/ssl_client_socket_nss.cc | |
parent | aa5131a6e4943d858be2e8723094035571c80132 (diff) | |
download | chromium_src-e83ba1c4aecdd8bbcdf43c3d8f5581321418ab0e.zip chromium_src-e83ba1c4aecdd8bbcdf43c3d8f5581321418ab0e.tar.gz chromium_src-e83ba1c4aecdd8bbcdf43c3d8f5581321418ab0e.tar.bz2 |
Remove the unused GetDefaultCertNickname function.
R=ukai
BUG=28744
TEST=none
Review URL: http://codereview.chromium.org/437080
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33298 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/ssl_client_socket_nss.cc')
-rw-r--r-- | net/socket/ssl_client_socket_nss.cc | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc index bc13d2a..155d3e5 100644 --- a/net/socket/ssl_client_socket_nss.cc +++ b/net/socket/ssl_client_socket_nss.cc @@ -2,11 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This file includes code GetDefaultCertNickname(), derived from -// nsNSSCertificate::defaultServerNickName() -// in mozilla/security/manager/ssl/src/nsNSSCertificate.cpp -// and SSLClientSocketNSS::DoVerifyCertComplete() derived from -// AuthCertificateCallback() in +// This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived +// from AuthCertificateCallback() in // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. /* ***** BEGIN LICENSE BLOCK ***** @@ -103,48 +100,6 @@ namespace net { namespace { -// Gets default certificate nickname from cert. -// Derived from nsNSSCertificate::defaultServerNickname -// in mozilla/security/manager/ssl/src/nsNSSCertificate.cpp. -std::string GetDefaultCertNickname( - net::X509Certificate::OSCertHandle cert) { - if (cert == NULL) - return ""; - - char* name = CERT_GetCommonName(&cert->subject); - if (!name) { - // Certs without common names are strange, but they do exist... - // Let's try to use another string for the nickname - name = CERT_GetOrgUnitName(&cert->subject); - if (!name) - name = CERT_GetOrgName(&cert->subject); - if (!name) - name = CERT_GetLocalityName(&cert->subject); - if (!name) - name = CERT_GetStateName(&cert->subject); - if (!name) - name = CERT_GetCountryName(&cert->subject); - if (!name) - return ""; - } - int count = 1; - std::string nickname; - while (1) { - if (count == 1) { - nickname = name; - } else { - nickname = StringPrintf("%s #%d", name, count); - } - PRBool conflict = SEC_CertNicknameConflict( - const_cast<char*>(nickname.c_str()), &cert->derSubject, cert->dbhandle); - if (!conflict) - break; - count++; - } - PR_FREEIF(name); - return nickname; -} - int NetErrorFromNSPRError(PRErrorCode err) { // TODO(port): fill this out as we learn what's important switch (err) { |