| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "net/base/net_errors.h" | 6 #include "net/base/net_errors.h" |
| 7 #include "net/base/test_completion_callback.h" | 7 #include "net/base/test_completion_callback.h" |
| 8 #include "net/base/test_data_directory.h" | 8 #include "net/base/test_data_directory.h" |
| 9 #include "net/cert/cert_status_flags.h" | 9 #include "net/cert/cert_status_flags.h" |
| 10 #include "net/cert/cert_verify_result.h" | 10 #include "net/cert/cert_verify_result.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 scoped_ptr<ProofVerifier> verifier( | 28 scoped_ptr<ProofVerifier> verifier( |
| 29 CryptoTestUtils::ProofVerifierForTesting()); | 29 CryptoTestUtils::ProofVerifierForTesting()); |
| 30 | 30 |
| 31 const string server_config = "server config bytes"; | 31 const string server_config = "server config bytes"; |
| 32 const string hostname = "test.example.com"; | 32 const string hostname = "test.example.com"; |
| 33 const vector<string>* certs; | 33 const vector<string>* certs; |
| 34 const vector<string>* first_certs; | 34 const vector<string>* first_certs; |
| 35 string error_details, signature, first_signature; | 35 string error_details, signature, first_signature; |
| 36 CertVerifyResult cert_verify_result; | 36 CertVerifyResult cert_verify_result; |
| 37 | 37 |
| 38 ASSERT_TRUE(source->GetProof(hostname, server_config, &first_certs, | 38 ASSERT_TRUE(source->GetProof(hostname, server_config, false /* no ECDSA */, |
| 39 &first_signature)); | 39 &first_certs, &first_signature)); |
| 40 ASSERT_TRUE(source->GetProof(hostname, server_config, &certs, &signature)); | 40 ASSERT_TRUE(source->GetProof(hostname, server_config, false /* no ECDSA */, |
| 41 &certs, &signature)); |
| 41 | 42 |
| 42 // Check that the proof source is caching correctly: | 43 // Check that the proof source is caching correctly: |
| 43 ASSERT_EQ(first_certs, certs); | 44 ASSERT_EQ(first_certs, certs); |
| 44 ASSERT_EQ(signature, first_signature); | 45 ASSERT_EQ(signature, first_signature); |
| 45 | 46 |
| 46 int rv; | 47 int rv; |
| 47 TestCompletionCallback callback; | 48 TestCompletionCallback callback; |
| 48 rv = verifier->VerifyProof(hostname, server_config, *certs, signature, | 49 rv = verifier->VerifyProof(hostname, server_config, *certs, signature, |
| 49 &error_details, &cert_verify_result, | 50 &error_details, &cert_verify_result, |
| 50 callback.callback()); | 51 callback.callback()); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 &error_details, &cert_verify_result, | 392 &error_details, &cert_verify_result, |
| 392 callback.callback()); | 393 callback.callback()); |
| 393 rv = callback.GetResult(rv); | 394 rv = callback.GetResult(rv); |
| 394 ASSERT_EQ(ERR_FAILED, rv); | 395 ASSERT_EQ(ERR_FAILED, rv); |
| 395 ASSERT_NE("", error_details); | 396 ASSERT_NE("", error_details); |
| 396 } | 397 } |
| 397 } | 398 } |
| 398 | 399 |
| 399 } // namespace test | 400 } // namespace test |
| 400 } // namespace net | 401 } // namespace net |
| OLD | NEW |