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

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 23441005: net: mark cert as revoked if EV revocation check receives revoked response (Win). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: g try Created 7 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 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 #endif 10 #endif
(...skipping 5709 matching lines...) Expand 10 before | Expand all | Expand 10 after
5720 DoConnection(ssl_options, &cert_status); 5720 DoConnection(ssl_options, &cert_status);
5721 5721
5722 EXPECT_EQ(ExpectedCertStatusForFailedOnlineRevocationCheck(), 5722 EXPECT_EQ(ExpectedCertStatusForFailedOnlineRevocationCheck(),
5723 cert_status & CERT_STATUS_ALL_ERRORS); 5723 cert_status & CERT_STATUS_ALL_ERRORS);
5724 5724
5725 EXPECT_FALSE(cert_status & CERT_STATUS_IS_EV); 5725 EXPECT_FALSE(cert_status & CERT_STATUS_IS_EV);
5726 EXPECT_EQ(SystemUsesChromiumEVMetadata(), 5726 EXPECT_EQ(SystemUsesChromiumEVMetadata(),
5727 static_cast<bool>(cert_status & CERT_STATUS_REV_CHECKING_ENABLED)); 5727 static_cast<bool>(cert_status & CERT_STATUS_REV_CHECKING_ENABLED));
5728 } 5728 }
5729 5729
5730 TEST_F(HTTPSEVCRLSetTest, MissingCRLSetAndRevokedOCSP) {
5731 if (!SystemSupportsOCSP()) {
5732 LOG(WARNING) << "Skipping test because system doesn't support OCSP";
5733 return;
5734 }
5735
5736 SpawnedTestServer::SSLOptions ssl_options(
5737 SpawnedTestServer::SSLOptions::CERT_AUTO);
5738 ssl_options.ocsp_status = SpawnedTestServer::SSLOptions::OCSP_REVOKED;
5739 SSLConfigService::SetCRLSet(scoped_refptr<CRLSet>());
5740
5741 CertStatus cert_status;
5742 DoConnection(ssl_options, &cert_status);
5743
5744 // Currently only works for Windows. For NSS we request a hard-fail check for
5745 // EV OCSP but then cannot tell whether the check failed because of a revoked
5746 // response, or an OCSP failure.
Ryan Sleevi 2013/08/28 19:23:11 comment nit: ever trying to reduce the pronoun usa
wtc 2013/08/28 23:58:42 Perhaps for NSS we can first request a soft-fail c
agl 2013/08/29 16:46:59 Updated comment.
agl 2013/08/29 16:46:59 That means that we would be making two OCSP reques
5747 #if defined(OS_WIN)
5748 EXPECT_EQ(CERT_STATUS_REVOKED, cert_status & CERT_STATUS_ALL_ERRORS);
5749 #else
5750 EXPECT_EQ(0u, cert_status & CERT_STATUS_ALL_ERRORS);
5751 #endif
5752
5753 EXPECT_FALSE(cert_status & CERT_STATUS_IS_EV);
5754 EXPECT_EQ(SystemUsesChromiumEVMetadata(),
5755 static_cast<bool>(cert_status & CERT_STATUS_REV_CHECKING_ENABLED));
5756 }
5757
5730 TEST_F(HTTPSEVCRLSetTest, MissingCRLSetAndGoodOCSP) { 5758 TEST_F(HTTPSEVCRLSetTest, MissingCRLSetAndGoodOCSP) {
5731 if (!SystemSupportsOCSP()) { 5759 if (!SystemSupportsOCSP()) {
5732 LOG(WARNING) << "Skipping test because system doesn't support OCSP"; 5760 LOG(WARNING) << "Skipping test because system doesn't support OCSP";
5733 return; 5761 return;
5734 } 5762 }
5735 5763
5736 SpawnedTestServer::SSLOptions ssl_options( 5764 SpawnedTestServer::SSLOptions ssl_options(
5737 SpawnedTestServer::SSLOptions::CERT_AUTO); 5765 SpawnedTestServer::SSLOptions::CERT_AUTO);
5738 ssl_options.ocsp_status = SpawnedTestServer::SSLOptions::OCSP_OK; 5766 ssl_options.ocsp_status = SpawnedTestServer::SSLOptions::OCSP_OK;
5739 SSLConfigService::SetCRLSet(scoped_refptr<CRLSet>()); 5767 SSLConfigService::SetCRLSet(scoped_refptr<CRLSet>());
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
6258 6286
6259 EXPECT_FALSE(r.is_pending()); 6287 EXPECT_FALSE(r.is_pending());
6260 EXPECT_EQ(1, d->response_started_count()); 6288 EXPECT_EQ(1, d->response_started_count());
6261 EXPECT_FALSE(d->received_data_before_response()); 6289 EXPECT_FALSE(d->received_data_before_response());
6262 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); 6290 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size));
6263 } 6291 }
6264 } 6292 }
6265 #endif // !defined(DISABLE_FTP_SUPPORT) 6293 #endif // !defined(DISABLE_FTP_SUPPORT)
6266 6294
6267 } // namespace net 6295 } // namespace net
OLDNEW
« net/cert/cert_verify_proc_win.cc ('K') | « net/cert/cert_verify_proc_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698