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

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

Issue 87923002: Certificate Transparency: Address review comments from issue 67513008 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « no previous file | net/cert/multi_log_ct_verifier.cc » ('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_serialization.h" 5 #include "net/cert/ct_serialization.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 input, &result)) { 309 input, &result)) {
310 return false; 310 return false;
311 } 311 }
312 312
313 if (!input->empty() || result.empty()) 313 if (!input->empty() || result.empty())
314 return false; 314 return false;
315 output->swap(result); 315 output->swap(result);
316 return true; 316 return true;
317 } 317 }
318 318
319 bool DecodeSignedCertificateTimestamp(base::StringPiece* input, 319 bool DecodeSignedCertificateTimestamp(
320 base::StringPiece* input,
320 scoped_refptr<SignedCertificateTimestamp>* output) { 321 scoped_refptr<SignedCertificateTimestamp>* output) {
321 scoped_refptr<SignedCertificateTimestamp> result( 322 scoped_refptr<SignedCertificateTimestamp> result(
322 new SignedCertificateTimestamp()); 323 new SignedCertificateTimestamp());
323 unsigned version; 324 unsigned version;
324 if (!ReadUint(kVersionLength, input, &version)) 325 if (!ReadUint(kVersionLength, input, &version))
325 return false; 326 return false;
326 if (version != SignedCertificateTimestamp::SCT_VERSION_1) { 327 if (version != SignedCertificateTimestamp::SCT_VERSION_1) {
327 DVLOG(1) << "Unsupported/invalid version " << version; 328 DVLOG(1) << "Unsupported/invalid version " << version;
328 return false; 329 return false;
329 } 330 }
(...skipping 28 matching lines...) Expand all
358 bool EncodeSCTListForTesting(const base::StringPiece& sct, 359 bool EncodeSCTListForTesting(const base::StringPiece& sct,
359 std::string* output) { 360 std::string* output) {
360 std::string encoded_sct; 361 std::string encoded_sct;
361 return WriteVariableBytes(kSerializedSCTLengthBytes, sct, &encoded_sct) && 362 return WriteVariableBytes(kSerializedSCTLengthBytes, sct, &encoded_sct) &&
362 WriteVariableBytes(kSCTListLengthBytes, encoded_sct, output); 363 WriteVariableBytes(kSCTListLengthBytes, encoded_sct, output);
363 } 364 }
364 365
365 } // namespace ct 366 } // namespace ct
366 367
367 } // namespace net 368 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/cert/multi_log_ct_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698