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

Unified Diff: net/cert/cert_database_nss.cc

Issue 2363653002: Cleanup unreachable cert adding code (Closed)
Patch Set: Rebased Created 4 years, 2 months 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/cert/cert_database_mac.cc ('k') | net/cert/cert_database_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/cert_database_nss.cc
diff --git a/net/cert/cert_database_nss.cc b/net/cert/cert_database_nss.cc
index 2073de1890bc605b084847dbb9471b95d2b647ae..cd71820d1de5bb74beedd50ae560bf5501682ed8 100644
--- a/net/cert/cert_database_nss.cc
+++ b/net/cert/cert_database_nss.cc
@@ -4,23 +4,8 @@
#include "net/cert/cert_database.h"
-#include <cert.h>
-#include <pk11pub.h>
-#include <secmod.h>
-
-#include <vector>
-
-#include "base/logging.h"
#include "base/observer_list_threadsafe.h"
#include "crypto/nss_util.h"
-#include "crypto/scoped_nss_types.h"
-#include "net/base/net_errors.h"
-#include "net/cert/x509_certificate.h"
-#include "net/cert/x509_util_nss.h"
-#include "net/third_party/mozilla_security_manager/nsNSSCertificateDB.h"
-
-// PSM = Mozilla's Personal Security Manager.
-namespace psm = mozilla_security_manager;
namespace net {
@@ -31,38 +16,4 @@ CertDatabase::CertDatabase()
CertDatabase::~CertDatabase() {}
-int CertDatabase::CheckUserCert(X509Certificate* cert_obj) {
- if (!cert_obj)
- return ERR_CERT_INVALID;
- if (cert_obj->HasExpired())
- return ERR_CERT_DATE_INVALID;
-
- // Check if the private key corresponding to the certificate exist
- // We shouldn't accept any random client certificate sent by a CA.
-
- // Note: The NSS source documentation wrongly suggests that this
- // also imports the certificate if the private key exists. This
- // doesn't seem to be the case.
-
- CERTCertificate* cert = cert_obj->os_cert_handle();
- PK11SlotInfo* slot = PK11_KeyForCertExists(cert, NULL, NULL);
- if (!slot)
- return ERR_NO_PRIVATE_KEY_FOR_CERT;
-
- PK11_FreeSlot(slot);
-
- return OK;
-}
-
-int CertDatabase::AddUserCert(X509Certificate* cert_obj) {
- CertificateList cert_list;
- cert_list.push_back(cert_obj);
- int result = psm::ImportUserCert(cert_list);
-
- if (result == OK)
- NotifyObserversOfCertAdded(NULL);
-
- return result;
-}
-
} // namespace net
« no previous file with comments | « net/cert/cert_database_mac.cc ('k') | net/cert/cert_database_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698