Index: chrome/browser/renderer_host/x509_user_cert_resource_handler.cc |
diff --git a/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc b/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc |
index abf5541cf23129d47ce800c0198352f358e22896..5fbec9658cac560ff4a767dc82a13bba1c7a0905 100644 |
--- a/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc |
+++ b/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc |
@@ -12,7 +12,6 @@ |
#include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h" |
#include "chrome/common/resource_response.h" |
#include "chrome/common/url_constants.h" |
-#include "net/base/cert_database.h" |
#include "net/base/io_buffer.h" |
#include "net/base/mime_sniffer.h" |
#include "net/base/mime_util.h" |
@@ -79,12 +78,17 @@ bool X509UserCertResourceHandler::OnResponseCompleted( |
int request_id, |
const URLRequestStatus& urs, |
const std::string& sec_info) { |
+ if (urs.status() != URLRequestStatus::SUCCESS) |
+ return false; |
+ |
// TODO(gauravsh): Verify that 'request_id' was actually a keygen form post |
// and only then import the certificate. |
- scoped_ptr<net::CertDatabase> cert_db(new net::CertDatabase()); |
AssembleResource(); |
- |
- return cert_db->AddUserCert(resource_buffer_->data(), content_length_); |
+ scoped_refptr<net::X509Certificate> cert = |
+ net::X509Certificate::CreateFromBytes(resource_buffer_->data(), |
+ content_length_); |
+ request_->delegate()->OnClientCertificateGenerated(request_, cert); |
+ return true; |
} |
void X509UserCertResourceHandler::AssembleResource() { |