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

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

Issue 1440643002: Certificate Transparency: Per-profile CT verification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing iOS compilation Created 5 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
« no previous file with comments | « net/cert/ct_log_verifier_unittest.cc ('k') | net/cert/ct_verifier.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 base::StringPiece sct_list_sp(sct_list); 45 base::StringPiece sct_list_sp(sct_list);
46 // Make sure the SCT list can be decoded properly 46 // Make sure the SCT list can be decoded properly
47 EXPECT_TRUE(DecodeSCTList(&sct_list_sp, &parsed_scts)); 47 EXPECT_TRUE(DecodeSCTList(&sct_list_sp, &parsed_scts));
48 48
49 EXPECT_TRUE(DecodeSignedCertificateTimestamp(&parsed_scts[0], sct)); 49 EXPECT_TRUE(DecodeSignedCertificateTimestamp(&parsed_scts[0], sct));
50 } 50 }
51 51
52 protected: 52 protected:
53 CertificateList precert_chain_; 53 CertificateList precert_chain_;
54 scoped_refptr<X509Certificate> test_cert_; 54 scoped_refptr<X509Certificate> test_cert_;
55 scoped_refptr<CTLogVerifier> log_; 55 scoped_refptr<const CTLogVerifier> log_;
56 }; 56 };
57 57
58 // Test that an SCT can be extracted and the extracted SCT contains the 58 // Test that an SCT can be extracted and the extracted SCT contains the
59 // expected data. 59 // expected data.
60 TEST_F(CTObjectsExtractorTest, ExtractEmbeddedSCT) { 60 TEST_F(CTObjectsExtractorTest, ExtractEmbeddedSCT) {
61 scoped_refptr<ct::SignedCertificateTimestamp> sct( 61 scoped_refptr<ct::SignedCertificateTimestamp> sct(
62 new ct::SignedCertificateTimestamp()); 62 new ct::SignedCertificateTimestamp());
63 ExtractEmbeddedSCT(precert_chain_[0], &sct); 63 ExtractEmbeddedSCT(precert_chain_[0], &sct);
64 64
65 EXPECT_EQ(sct->version, SignedCertificateTimestamp::SCT_VERSION_1); 65 EXPECT_EQ(sct->version, SignedCertificateTimestamp::SCT_VERSION_1);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 std::string extracted_sct_list; 173 std::string extracted_sct_list;
174 // Use test_cert_ for issuer - it is not the correct issuer of |subject_cert|. 174 // Use test_cert_ for issuer - it is not the correct issuer of |subject_cert|.
175 EXPECT_FALSE(ct::ExtractSCTListFromOCSPResponse( 175 EXPECT_FALSE(ct::ExtractSCTListFromOCSPResponse(
176 test_cert_->os_cert_handle(), subject_cert->serial_number(), 176 test_cert_->os_cert_handle(), subject_cert->serial_number(),
177 ocsp_response, &extracted_sct_list)); 177 ocsp_response, &extracted_sct_list));
178 } 178 }
179 179
180 } // namespace ct 180 } // namespace ct
181 181
182 } // namespace net 182 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/ct_log_verifier_unittest.cc ('k') | net/cert/ct_verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698