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

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

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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_openssl.cc ('k') | net/data/url_request_unittest/simple.html » ('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_log_verifier.h" 5 #include "net/cert/ct_log_verifier.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "net/cert/signed_certificate_timestamp.h" 10 #include "net/cert/signed_certificate_timestamp.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ASSERT_TRUE(log_->SetSignedTreeHead(sth.Pass())); 82 ASSERT_TRUE(log_->SetSignedTreeHead(sth.Pass()));
83 } 83 }
84 84
85 TEST_F(CTLogVerifierTest, DoesNotSetInvalidSTH) { 85 TEST_F(CTLogVerifierTest, DoesNotSetInvalidSTH) {
86 scoped_ptr<ct::SignedTreeHead> sth(new ct::SignedTreeHead()); 86 scoped_ptr<ct::SignedTreeHead> sth(new ct::SignedTreeHead());
87 ct::GetSignedTreeHead(sth.get()); 87 ct::GetSignedTreeHead(sth.get());
88 sth->sha256_root_hash[0] = '\x0'; 88 sth->sha256_root_hash[0] = '\x0';
89 ASSERT_FALSE(log_->SetSignedTreeHead(sth.Pass())); 89 ASSERT_FALSE(log_->SetSignedTreeHead(sth.Pass()));
90 } 90 }
91 91
92 // Test that excess data after the public key is rejected.
93 TEST_F(CTLogVerifierTest, ExcessDataInPublicKey) {
94 std::string key = ct::GetTestPublicKey();
95 key += "extra";
96
97 scoped_ptr<CTLogVerifier> log = CTLogVerifier::Create(key, "testlog");
98 EXPECT_FALSE(log);
99 }
100
92 } // namespace net 101 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/ct_log_verifier_openssl.cc ('k') | net/data/url_request_unittest/simple.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698