Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1020)

Side by Side Diff: net/cert/ct_objects_extractor_unittest.cc

Issue 67513008: Certificate Transparency: Add the high-level interface for verifying SCTs over multiple logs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698