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

Unified Diff: net/cert/cert_database_win.cc

Issue 2363653002: Cleanup unreachable cert adding code (Closed)
Patch Set: Created 4 years, 3 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
Index: net/cert/cert_database_win.cc
diff --git a/net/cert/cert_database_win.cc b/net/cert/cert_database_win.cc
index bda2ef02a498c305bf65ef7b5d4e49b2db3c4b13..32c9168ab98279fb27ec3f44b1ddb0dacec0ddf4 100644
--- a/net/cert/cert_database_win.cc
+++ b/net/cert/cert_database_win.cc
@@ -4,12 +4,7 @@
#include "net/cert/cert_database.h"
-#include <windows.h>
-
#include "base/observer_list_threadsafe.h"
-#include "crypto/wincrypt_shim.h"
-#include "net/base/net_errors.h"
-#include "net/cert/x509_certificate.h"
namespace net {
@@ -19,42 +14,4 @@ CertDatabase::CertDatabase()
CertDatabase::~CertDatabase() {}
-int CertDatabase::CheckUserCert(X509Certificate* cert) {
- if (!cert)
- return ERR_CERT_INVALID;
- if (cert->HasExpired())
- return ERR_CERT_DATE_INVALID;
-
- // TODO(rsleevi): Should CRYPT_FIND_SILENT_KEYSET_FLAG be specified? A UI
- // may be shown here / this call may block.
- if (!CryptFindCertificateKeyProvInfo(cert->os_cert_handle(), 0, NULL))
- return ERR_NO_PRIVATE_KEY_FOR_CERT;
-
- return OK;
-}
-
-int CertDatabase::AddUserCert(X509Certificate* cert) {
- // TODO(rsleevi): Would it be more appropriate to have the CertDatabase take
- // construction parameters (Keychain filepath on Mac OS X, PKCS #11 slot on
- // NSS, and Store Type / Path) here? For now, certs will be stashed into the
- // user's personal store, which will not automatically mark them as trusted,
- // but will allow them to be used for client auth.
- HCERTSTORE cert_db = CertOpenSystemStore(NULL, L"MY");
- if (!cert_db)
- return ERR_ADD_USER_CERT_FAILED;
-
- BOOL added = CertAddCertificateContextToStore(cert_db,
- cert->os_cert_handle(),
- CERT_STORE_ADD_USE_EXISTING,
- NULL);
-
- CertCloseStore(cert_db, 0);
-
- if (!added)
- return ERR_ADD_USER_CERT_FAILED;
-
- NotifyObserversOfCertAdded(cert);
- return OK;
-}
-
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698