| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // Test that the embedded SCT verifies | 98 // Test that the embedded SCT verifies |
| 99 TEST_F(CTObjectsExtractorTest, ExtractedSCTVerifies) { | 99 TEST_F(CTObjectsExtractorTest, ExtractedSCTVerifies) { |
| 100 ct::SignedCertificateTimestamp sct; | 100 ct::SignedCertificateTimestamp sct; |
| 101 ExtractEmbeddedSCT(precert_chain_[0], &sct); | 101 ExtractEmbeddedSCT(precert_chain_[0], &sct); |
| 102 | 102 |
| 103 LogEntry entry; | 103 LogEntry entry; |
| 104 ASSERT_TRUE(GetPrecertLogEntry(precert_chain_[0]->os_cert_handle(), | 104 ASSERT_TRUE(GetPrecertLogEntry(precert_chain_[0]->os_cert_handle(), |
| 105 precert_chain_[1]->os_cert_handle(), | 105 precert_chain_[1]->os_cert_handle(), |
| 106 &entry)); | 106 &entry)); |
| 107 | 107 |
| 108 EXPECT_TRUE(log_->Verify(entry, sct)); | 108 ASSERT_EQ(CTLogVerifier::SCT_VERIFIED_OK, log_->Verify(entry, sct)); |
| 109 } | 109 } |
| 110 | 110 |
| 111 // Test that an externally-provided SCT verifies over the LogEntry | 111 // Test that an externally-provided SCT verifies over the LogEntry |
| 112 // of a regular X.509 Certificate | 112 // of a regular X.509 Certificate |
| 113 TEST_F(CTObjectsExtractorTest, ComplementarySCTVerifies) { | 113 TEST_F(CTObjectsExtractorTest, ComplementarySCTVerifies) { |
| 114 ct::SignedCertificateTimestamp sct; | 114 ct::SignedCertificateTimestamp sct; |
| 115 GetX509CertSCT(&sct); | 115 GetX509CertSCT(&sct); |
| 116 | 116 |
| 117 LogEntry entry; | 117 LogEntry entry; |
| 118 ASSERT_TRUE(GetX509LogEntry(test_cert_->os_cert_handle(), &entry)); | 118 ASSERT_TRUE(GetX509LogEntry(test_cert_->os_cert_handle(), &entry)); |
| 119 | 119 |
| 120 EXPECT_TRUE(log_->Verify(entry, sct)); | 120 ASSERT_EQ(CTLogVerifier::SCT_VERIFIED_OK, log_->Verify(entry, sct)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace ct | 123 } // namespace ct |
| 124 | 124 |
| 125 } // namespace net | 125 } // namespace net |
| OLD | NEW |