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

Side by Side Diff: chrome/browser/ssl/ssl_add_cert_handler.cc

Issue 10160007: Parse an application/x-x509-user-cert response with (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add back a blank line deleted by accident Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ssl/ssl_add_cert_handler.h" 5 #include "chrome/browser/ssl/ssl_add_cert_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" 8 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h"
9 #include "chrome/browser/tab_contents/tab_util.h" 9 #include "chrome/browser/tab_contents/tab_util.h"
10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
(...skipping 21 matching lines...) Expand all
32 AddRef(); 32 AddRef();
33 // Delay adding the certificate until the next mainloop iteration. 33 // Delay adding the certificate until the next mainloop iteration.
34 BrowserThread::PostTask( 34 BrowserThread::PostTask(
35 BrowserThread::IO, FROM_HERE, 35 BrowserThread::IO, FROM_HERE,
36 base::Bind(&SSLAddCertHandler::Run, this)); 36 base::Bind(&SSLAddCertHandler::Run, this));
37 } 37 }
38 38
39 SSLAddCertHandler::~SSLAddCertHandler() {} 39 SSLAddCertHandler::~SSLAddCertHandler() {}
40 40
41 void SSLAddCertHandler::Run() { 41 void SSLAddCertHandler::Run() {
42 // TODO(wtc): if cert_ is NULL, it means we could not decode the
43 // application/x-x509-user-cert response. db.CheckUserCert() will
44 // return net::ERR_CERT_INVALID. We should add a more informative
45 // error code.
42 int cert_error; 46 int cert_error;
43 { 47 {
44 net::CertDatabase db; 48 net::CertDatabase db;
45 cert_error = db.CheckUserCert(cert_); 49 cert_error = db.CheckUserCert(cert_);
46 } 50 }
47 if (cert_error != net::OK) { 51 if (cert_error != net::OK) {
48 LOG_IF(ERROR, cert_error == net::ERR_NO_PRIVATE_KEY_FOR_CERT) 52 LOG_IF(ERROR, cert_error == net::ERR_NO_PRIVATE_KEY_FOR_CERT)
49 << "No corresponding private key in store for cert: " 53 << "No corresponding private key in store for cert: "
50 << (cert_.get() ? cert_->subject().GetDisplayName() : "NULL"); 54 << (cert_.get() ? cert_->subject().GetDisplayName() : "NULL");
51 55
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 TabContentsWrapper::GetCurrentWrapperForContents(tab); 114 TabContentsWrapper::GetCurrentWrapperForContents(tab);
111 if (add_cert) { 115 if (add_cert) {
112 if (cert_error == net::OK) { 116 if (cert_error == net::OK) {
113 wrapper->ssl_helper()->OnAddClientCertificateSuccess(this); 117 wrapper->ssl_helper()->OnAddClientCertificateSuccess(this);
114 } else { 118 } else {
115 wrapper->ssl_helper()->OnAddClientCertificateError(this, cert_error); 119 wrapper->ssl_helper()->OnAddClientCertificateError(this, cert_error);
116 } 120 }
117 } 121 }
118 wrapper->ssl_helper()->OnAddClientCertificateFinished(this); 122 wrapper->ssl_helper()->OnAddClientCertificateFinished(this);
119 } 123 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698