OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "net/cert/ct_objects_extractor.h" | 5 #include "net/cert/ct_objects_extractor.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "net/base/test_data_directory.h" | 8 #include "net/base/test_data_directory.h" |
9 #include "net/cert/ct_log_verifier.h" | 9 #include "net/cert/ct_log_verifier.h" |
10 #include "net/cert/ct_serialization.h" | 10 #include "net/cert/ct_serialization.h" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 precert_chain_ = | 24 precert_chain_ = |
25 CreateCertificateListFromFile(GetTestCertsDirectory(), | 25 CreateCertificateListFromFile(GetTestCertsDirectory(), |
26 "ct-test-embedded-cert.pem", | 26 "ct-test-embedded-cert.pem", |
27 X509Certificate::FORMAT_AUTO); | 27 X509Certificate::FORMAT_AUTO); |
28 ASSERT_EQ(2u, precert_chain_.size()); | 28 ASSERT_EQ(2u, precert_chain_.size()); |
29 | 29 |
30 std::string der_test_cert(ct::GetDerEncodedX509Cert()); | 30 std::string der_test_cert(ct::GetDerEncodedX509Cert()); |
31 test_cert_ = X509Certificate::CreateFromBytes(der_test_cert.data(), | 31 test_cert_ = X509Certificate::CreateFromBytes(der_test_cert.data(), |
32 der_test_cert.length()); | 32 der_test_cert.length()); |
33 | 33 |
34 log_ = CTLogVerifier::Create(ct::GetTestPublicKey(), "testlog").Pass(); | 34 log_ = CTLogVerifier::Create(ct::GetTestPublicKey(), "testlog", "").Pass(); |
Ryan Sleevi
2015/04/24 10:42:08
s/""/std::string()/
Eran Messeri
2015/06/18 15:18:42
Done.
| |
35 ASSERT_TRUE(log_); | 35 ASSERT_TRUE(log_); |
36 } | 36 } |
37 | 37 |
38 void ExtractEmbeddedSCT(scoped_refptr<X509Certificate> cert, | 38 void ExtractEmbeddedSCT(scoped_refptr<X509Certificate> cert, |
39 scoped_refptr<SignedCertificateTimestamp>* sct) { | 39 scoped_refptr<SignedCertificateTimestamp>* sct) { |
40 std::string sct_list; | 40 std::string sct_list; |
41 EXPECT_TRUE(ExtractEmbeddedSCTList(cert->os_cert_handle(), &sct_list)); | 41 EXPECT_TRUE(ExtractEmbeddedSCTList(cert->os_cert_handle(), &sct_list)); |
42 | 42 |
43 std::vector<base::StringPiece> parsed_scts; | 43 std::vector<base::StringPiece> parsed_scts; |
44 base::StringPiece sct_list_sp(sct_list); | 44 base::StringPiece sct_list_sp(sct_list); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
172 std::string extracted_sct_list; | 172 std::string extracted_sct_list; |
173 // Use test_cert_ for issuer - it is not the correct issuer of |subject_cert|. | 173 // Use test_cert_ for issuer - it is not the correct issuer of |subject_cert|. |
174 EXPECT_FALSE(ct::ExtractSCTListFromOCSPResponse( | 174 EXPECT_FALSE(ct::ExtractSCTListFromOCSPResponse( |
175 test_cert_->os_cert_handle(), subject_cert->serial_number(), | 175 test_cert_->os_cert_handle(), subject_cert->serial_number(), |
176 ocsp_response, &extracted_sct_list)); | 176 ocsp_response, &extracted_sct_list)); |
177 } | 177 } |
178 | 178 |
179 } // namespace ct | 179 } // namespace ct |
180 | 180 |
181 } // namespace net | 181 } // namespace net |
OLD | NEW |