Chromium Code Reviews| Index: net/base/cert_database_openssl.cc |
| diff --git a/net/base/cert_database_openssl.cc b/net/base/cert_database_openssl.cc |
| index 73a67c1abc7cd77c65b79aa1d03b5cb1a6018a8f..7de67011dbf6a6c476d8c5a2be44c5a324ee0ee1 100644 |
| --- a/net/base/cert_database_openssl.cc |
| +++ b/net/base/cert_database_openssl.cc |
| @@ -4,8 +4,11 @@ |
| #include "net/base/cert_database.h" |
| +#include <openssl/x509.h> |
| + |
| #include "net/base/net_errors.h" |
| #include "net/base/x509_certificate.h" |
| +#include "net/base/openssl_private_key_store.h" |
|
bulach
2010/12/08 20:37:00
one up
joth
2010/12/09 11:20:21
Done.
|
| namespace net { |
| @@ -18,22 +21,28 @@ int CertDatabase::CheckUserCert(X509Certificate* cert) { |
| if (cert->HasExpired()) |
| return ERR_CERT_DATE_INVALID; |
| - // TODO(bulach): implement me. |
| - return ERR_NOT_IMPLEMENTED; |
| + if (!OpenSSLPrivateKeyStore::GetInstance()->FetchPrivateKey( |
| + X509_PUBKEY_get(X509_get_X509_PUBKEY(cert->os_cert_handle())))) |
| + return ERR_NO_PRIVATE_KEY_FOR_CERT; |
| + |
| + return OK; |
| } |
| int CertDatabase::AddUserCert(X509Certificate* cert) { |
| // TODO(bulach): implement me. |
| + NOTIMPLEMENTED(); |
| return ERR_NOT_IMPLEMENTED; |
| } |
| void CertDatabase::ListCerts(CertificateList* certs) { |
| // TODO(bulach): implement me. |
| + NOTIMPLEMENTED(); |
| } |
| int CertDatabase::ImportFromPKCS12(const std::string& data, |
| const string16& password) { |
| // TODO(bulach): implement me. |
| + NOTIMPLEMENTED(); |
| return ERR_NOT_IMPLEMENTED; |
| } |
| @@ -41,18 +50,20 @@ int CertDatabase::ExportToPKCS12(const CertificateList& certs, |
| const string16& password, |
| std::string* output) const { |
| // TODO(bulach): implement me. |
| + NOTIMPLEMENTED(); |
| return 0; |
| } |
| bool CertDatabase::DeleteCertAndKey(const X509Certificate* cert) { |
| // TODO(bulach): implement me. |
| + NOTIMPLEMENTED(); |
| return false; |
| } |
| unsigned int CertDatabase::GetCertTrust(const X509Certificate* cert, |
| CertType type) const { |
| // TODO(bulach): implement me. |
| - // NOTE: This method is currently only declared for USE_NSS builds. |
| + NOTIMPLEMENTED(); |
| return 0; |
| } |
| @@ -60,7 +71,7 @@ bool CertDatabase::SetCertTrust(const X509Certificate* cert, |
| CertType type, |
| unsigned int trust_bits) { |
| // TODO(bulach): implement me. |
| - // NOTE: This method is currently only declared for USE_NSS builds. |
| + NOTIMPLEMENTED(); |
| return false; |
| } |