| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "net/quic/crypto/proof_verifier_chromium.h" | 5 #include "net/quic/crypto/proof_verifier_chromium.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/base/test_data_directory.h" | 10 #include "net/base/test_data_directory.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 DummyProofVerifierCallback* callback = new DummyProofVerifierCallback; | 295 DummyProofVerifierCallback* callback = new DummyProofVerifierCallback; |
| 296 QuicAsyncStatus status = proof_verifier.VerifyProof( | 296 QuicAsyncStatus status = proof_verifier.VerifyProof( |
| 297 kTestHostname, kTestConfig, certs, GetTestSignature(), | 297 kTestHostname, kTestConfig, certs, GetTestSignature(), |
| 298 verify_context.get(), &error_details, &details, callback); | 298 verify_context.get(), &error_details, &details, callback); |
| 299 ASSERT_EQ(QUIC_SUCCESS, status); | 299 ASSERT_EQ(QUIC_SUCCESS, status); |
| 300 delete callback; | 300 delete callback; |
| 301 | 301 |
| 302 ASSERT_TRUE(details.get()); | 302 ASSERT_TRUE(details.get()); |
| 303 ProofVerifyDetailsChromium* verify_details = | 303 ProofVerifyDetailsChromium* verify_details = |
| 304 static_cast<ProofVerifyDetailsChromium*>(details.get()); | 304 static_cast<ProofVerifyDetailsChromium*>(details.get()); |
| 305 EXPECT_EQ(0u, verify_details->cert_verify_result.cert_status); | 305 EXPECT_EQ(CERT_STATUS_CT_COMPLIANCE_FAILED, |
| 306 verify_details->cert_verify_result.cert_status & |
| 307 (CERT_STATUS_CT_COMPLIANCE_FAILED | CERT_STATUS_IS_EV)); |
| 306 } | 308 } |
| 307 | 309 |
| 308 // Tests that the certificate policy enforcer is not consulted if | 310 // Tests that the certificate policy enforcer is not consulted if |
| 309 // the certificate is not EV. | 311 // the certificate is not EV. |
| 310 TEST(ProofVerifierChromiumTest, IgnoresPolicyEnforcerIfNotEV) { | 312 TEST(ProofVerifierChromiumTest, IgnoresPolicyEnforcerIfNotEV) { |
| 311 scoped_refptr<X509Certificate> test_cert = GetTestServerCertificate(); | 313 scoped_refptr<X509Certificate> test_cert = GetTestServerCertificate(); |
| 312 ASSERT_TRUE(test_cert); | 314 ASSERT_TRUE(test_cert); |
| 313 | 315 |
| 314 CertVerifyResult dummy_result; | 316 CertVerifyResult dummy_result; |
| 315 dummy_result.verified_cert = test_cert; | 317 dummy_result.verified_cert = test_cert; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 339 delete callback; | 341 delete callback; |
| 340 | 342 |
| 341 ASSERT_TRUE(details.get()); | 343 ASSERT_TRUE(details.get()); |
| 342 ProofVerifyDetailsChromium* verify_details = | 344 ProofVerifyDetailsChromium* verify_details = |
| 343 static_cast<ProofVerifyDetailsChromium*>(details.get()); | 345 static_cast<ProofVerifyDetailsChromium*>(details.get()); |
| 344 EXPECT_EQ(0u, verify_details->cert_verify_result.cert_status); | 346 EXPECT_EQ(0u, verify_details->cert_verify_result.cert_status); |
| 345 } | 347 } |
| 346 | 348 |
| 347 } // namespace test | 349 } // namespace test |
| 348 } // namespace net | 350 } // namespace net |
| OLD | NEW |