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

Side by Side Diff: net/quic/crypto/proof_verifier_chromium_test.cc

Issue 2084783002: Cleanup HPKP error handling and weak DH key handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@require_ct_enforcer
Patch Set: Fix bad test Created 4 years, 6 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
« no previous file with comments | « net/quic/crypto/proof_verifier_chromium.cc ('k') | net/socket/ssl_client_socket_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "net/base/test_data_directory.h" 9 #include "net/base/test_data_directory.h"
10 #include "net/cert/cert_status_flags.h" 10 #include "net/cert/cert_status_flags.h"
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 new DummyProofVerifierCallback); 423 new DummyProofVerifierCallback);
424 QuicAsyncStatus status = proof_verifier.VerifyProof( 424 QuicAsyncStatus status = proof_verifier.VerifyProof(
425 kTestHostname, kTestPort, kTestConfig, QUIC_VERSION_25, "", certs_, "", 425 kTestHostname, kTestPort, kTestConfig, QUIC_VERSION_25, "", certs_, "",
426 GetTestSignature(), verify_context_.get(), &error_details_, &details_, 426 GetTestSignature(), verify_context_.get(), &error_details_, &details_,
427 callback.get()); 427 callback.get());
428 ASSERT_EQ(QUIC_FAILURE, status); 428 ASSERT_EQ(QUIC_FAILURE, status);
429 429
430 ASSERT_TRUE(details_.get()); 430 ASSERT_TRUE(details_.get());
431 ProofVerifyDetailsChromium* verify_details = 431 ProofVerifyDetailsChromium* verify_details =
432 static_cast<ProofVerifyDetailsChromium*>(details_.get()); 432 static_cast<ProofVerifyDetailsChromium*>(details_.get());
433 EXPECT_EQ(0u, verify_details->cert_verify_result.cert_status); 433 EXPECT_TRUE(verify_details->cert_verify_result.cert_status &
434 CERT_STATUS_PINNED_KEY_MISSING);
434 EXPECT_FALSE(verify_details->pkp_bypassed); 435 EXPECT_FALSE(verify_details->pkp_bypassed);
435 EXPECT_NE("", verify_details->pinning_failure_log); 436 EXPECT_NE("", verify_details->pinning_failure_log);
436 } 437 }
437 438
438 // Test |pkp_bypassed| is set when PKP is bypassed due to a local 439 // Test |pkp_bypassed| is set when PKP is bypassed due to a local
439 // trust anchor 440 // trust anchor
440 TEST_F(ProofVerifierChromiumTest, PKPBypassFlagSet) { 441 TEST_F(ProofVerifierChromiumTest, PKPBypassFlagSet) {
441 scoped_refptr<X509Certificate> test_cert = GetTestServerCertificate(); 442 scoped_refptr<X509Certificate> test_cert = GetTestServerCertificate();
442 ASSERT_TRUE(test_cert); 443 ASSERT_TRUE(test_cert);
443 444
(...skipping 26 matching lines...) Expand all
470 ASSERT_EQ(QUIC_SUCCESS, status); 471 ASSERT_EQ(QUIC_SUCCESS, status);
471 472
472 ASSERT_TRUE(details_.get()); 473 ASSERT_TRUE(details_.get());
473 ProofVerifyDetailsChromium* verify_details = 474 ProofVerifyDetailsChromium* verify_details =
474 static_cast<ProofVerifyDetailsChromium*>(details_.get()); 475 static_cast<ProofVerifyDetailsChromium*>(details_.get());
475 EXPECT_TRUE(verify_details->pkp_bypassed); 476 EXPECT_TRUE(verify_details->pkp_bypassed);
476 } 477 }
477 478
478 } // namespace test 479 } // namespace test
479 } // namespace net 480 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/proof_verifier_chromium.cc ('k') | net/socket/ssl_client_socket_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698