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

Unified Diff: net/cert/cert_verify_proc_win.cc

Issue 1081913003: Route OCSP stapling through CertVerifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@boringnss
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/cert_verify_proc_win.h ('k') | net/cert/mock_cert_verifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/cert_verify_proc_win.cc
diff --git a/net/cert/cert_verify_proc_win.cc b/net/cert/cert_verify_proc_win.cc
index 13a337bfe2f54fa5a826b09642f5a6807eda741f..6e10d653ef725bce97f7a6cd838b191d737b5e08 100644
--- a/net/cert/cert_verify_proc_win.cc
+++ b/net/cert/cert_verify_proc_win.cc
@@ -559,9 +559,19 @@ bool CertVerifyProcWin::SupportsAdditionalTrustAnchors() const {
return false;
}
+bool CertVerifyProcWin::SupportsOCSPStapling() const {
+ // CERT_OCSP_RESPONSE_PROP_ID is only implemented on Vista+, but it can be
+ // set on Windows XP without error. There is some overhead from the server
+ // sending the OCSP response if it supports the extension, for the subset of
+ // XP clients who will request it but be unable to use it, but this is an
+ // acceptable trade-off for simplicity of implementation.
+ return true;
+}
+
int CertVerifyProcWin::VerifyInternal(
X509Certificate* cert,
const std::string& hostname,
+ const std::string& ocsp_response,
int flags,
CRLSet* crl_set,
const CertificateList& additional_trust_anchors,
@@ -570,6 +580,20 @@ int CertVerifyProcWin::VerifyInternal(
if (!cert_handle)
return ERR_UNEXPECTED;
+ // Attach the OCSP response to the certificate.
+ if (!ocsp_response.empty()) {
+ CRYPT_DATA_BLOB ocsp_response_blob;
+ ocsp_response_blob.cbData = ocsp_response.size();
+ ocsp_response_blob.pbData =
+ reinterpret_cast<BYTE*>(const_cast<char*>(ocsp_response.data()));
+ BOOL ok = CertSetCertificateContextProperty(
+ cert_handle, CERT_OCSP_RESPONSE_PROP_ID,
+ CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG, &ocsp_response_blob);
+ if (!ok) {
+ VLOG(1) << "Failed to set OCSP response property: " << GetLastError();
+ }
+ }
Ryan Sleevi 2015/04/22 22:53:37 Move this down to line 659 and your problems go aw
davidben 2015/04/23 01:02:32 Done.
+
// Build and validate certificate chain.
CERT_CHAIN_PARA chain_para;
memset(&chain_para, 0, sizeof(chain_para));
« no previous file with comments | « net/cert/cert_verify_proc_win.h ('k') | net/cert/mock_cert_verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698