| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 break; | 91 break; |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 | 94 |
| 95 // Reads the certificate named "quic_" + |file_name| in the test data directory. | 95 // Reads the certificate named "quic_" + |file_name| in the test data directory. |
| 96 // The certificate must be PEM encoded. Returns the DER-encoded certificate. | 96 // The certificate must be PEM encoded. Returns the DER-encoded certificate. |
| 97 string LoadTestCert(const string& file_name) { | 97 string LoadTestCert(const string& file_name) { |
| 98 base::FilePath certs_dir = GetTestCertsDirectory(); | 98 base::FilePath certs_dir = GetTestCertsDirectory(); |
| 99 scoped_refptr<X509Certificate> cert = | 99 scoped_refptr<X509Certificate> cert = |
| 100 ImportCertFromFile(certs_dir, "quic_" + file_name); | 100 ImportCertFromFile(certs_dir, "quic_" + file_name); |
| 101 CHECK_NE(static_cast<X509Certificate*>(NULL), cert); | 101 CHECK_NE(static_cast<X509Certificate*>(NULL), cert.get()); |
| 102 | 102 |
| 103 string der_bytes; | 103 string der_bytes; |
| 104 CHECK(X509Certificate::GetDEREncoded(cert->os_cert_handle(), &der_bytes)); | 104 CHECK(X509Certificate::GetDEREncoded(cert->os_cert_handle(), &der_bytes)); |
| 105 return der_bytes; | 105 return der_bytes; |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace | 108 } // namespace |
| 109 | 109 |
| 110 // TODO(rtenneti): Enable testing of ProofVerifier. | 110 // TODO(rtenneti): Enable testing of ProofVerifier. |
| 111 TEST(ProofTest, DISABLED_Verify) { | 111 TEST(ProofTest, DISABLED_Verify) { |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 wrong_certs.push_back(certs[i]); | 362 wrong_certs.push_back(certs[i]); |
| 363 } | 363 } |
| 364 RunVerification( | 364 RunVerification( |
| 365 verifier.get(), hostname, server_config, wrong_certs, signature, | 365 verifier.get(), hostname, server_config, wrong_certs, signature, |
| 366 false); | 366 false); |
| 367 } | 367 } |
| 368 } | 368 } |
| 369 | 369 |
| 370 } // namespace test | 370 } // namespace test |
| 371 } // namespace net | 371 } // namespace net |
| OLD | NEW |