OLD | NEW |
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 "net/quic/test_tools/crypto_test_utils.h" | 5 #include "net/quic/test_tools/crypto_test_utils.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "crypto/openssl_util.h" | 10 #include "crypto/openssl_util.h" |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 } | 564 } |
565 | 565 |
566 uint64_t CryptoTestUtils::LeafCertHashForTesting() { | 566 uint64_t CryptoTestUtils::LeafCertHashForTesting() { |
567 scoped_refptr<ProofSource::Chain> chain; | 567 scoped_refptr<ProofSource::Chain> chain; |
568 IPAddress server_ip; | 568 IPAddress server_ip; |
569 string sig; | 569 string sig; |
570 string cert_sct; | 570 string cert_sct; |
571 std::unique_ptr<ProofSource> proof_source( | 571 std::unique_ptr<ProofSource> proof_source( |
572 CryptoTestUtils::ProofSourceForTesting()); | 572 CryptoTestUtils::ProofSourceForTesting()); |
573 if (!proof_source->GetProof(server_ip, "", "", AllSupportedVersions().front(), | 573 if (!proof_source->GetProof(server_ip, "", "", AllSupportedVersions().front(), |
574 "", &chain, &sig, &cert_sct) || | 574 "", QuicTagVector(), &chain, &sig, &cert_sct) || |
575 chain->certs.empty()) { | 575 chain->certs.empty()) { |
576 DCHECK(false) << "Proof generation failed"; | 576 DCHECK(false) << "Proof generation failed"; |
577 return 0; | 577 return 0; |
578 } | 578 } |
579 | 579 |
580 return QuicUtils::FNV1a_64_Hash(chain->certs.at(0).c_str(), | 580 return QuicUtils::FNV1a_64_Hash(chain->certs.at(0).c_str(), |
581 chain->certs.at(0).length()); | 581 chain->certs.at(0).length()); |
582 } | 582 } |
583 | 583 |
584 class MockCommonCertSets : public CommonCertSets { | 584 class MockCommonCertSets : public CommonCertSets { |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 // Pass a inchoate CHLO. | 1011 // Pass a inchoate CHLO. |
1012 FullChloGenerator generator(crypto_config, server_ip, client_addr, clock, | 1012 FullChloGenerator generator(crypto_config, server_ip, client_addr, clock, |
1013 proof, compressed_certs_cache, out); | 1013 proof, compressed_certs_cache, out); |
1014 crypto_config->ValidateClientHello( | 1014 crypto_config->ValidateClientHello( |
1015 inchoate_chlo, client_addr.address(), server_ip, version, clock, proof, | 1015 inchoate_chlo, client_addr.address(), server_ip, version, clock, proof, |
1016 generator.GetValidateClientHelloCallback()); | 1016 generator.GetValidateClientHelloCallback()); |
1017 } | 1017 } |
1018 | 1018 |
1019 } // namespace test | 1019 } // namespace test |
1020 } // namespace net | 1020 } // namespace net |
OLD | NEW |