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

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

Issue 2824983002: Rename net::ct::LogEntry to SignedEntryData and clarify the comment. (Closed)
Patch Set: sort forward decls Created 3 years, 8 months 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/merkle_tree_leaf.h ('k') | net/cert/merkle_tree_leaf_unittest.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/merkle_tree_leaf.h" 5 #include "net/cert/merkle_tree_leaf.h"
6 6
7 #include "crypto/sha2.h" 7 #include "crypto/sha2.h"
8 #include "net/cert/ct_objects_extractor.h" 8 #include "net/cert/ct_objects_extractor.h"
9 #include "net/cert/ct_serialization.h" 9 #include "net/cert/ct_serialization.h"
10 #include "net/cert/x509_certificate.h" 10 #include "net/cert/x509_certificate.h"
(...skipping 18 matching lines...) Expand all
29 29
30 *out = crypto::SHA256HashString(leaf_in_tls_format); 30 *out = crypto::SHA256HashString(leaf_in_tls_format);
31 return true; 31 return true;
32 } 32 }
33 33
34 bool GetMerkleTreeLeaf(const X509Certificate* cert, 34 bool GetMerkleTreeLeaf(const X509Certificate* cert,
35 const SignedCertificateTimestamp* sct, 35 const SignedCertificateTimestamp* sct,
36 MerkleTreeLeaf* merkle_tree_leaf) { 36 MerkleTreeLeaf* merkle_tree_leaf) {
37 if (sct->origin == SignedCertificateTimestamp::SCT_EMBEDDED) { 37 if (sct->origin == SignedCertificateTimestamp::SCT_EMBEDDED) {
38 if (cert->GetIntermediateCertificates().empty() || 38 if (cert->GetIntermediateCertificates().empty() ||
39 !GetPrecertLogEntry(cert->os_cert_handle(), 39 !GetPrecertSignedEntry(cert->os_cert_handle(),
40 cert->GetIntermediateCertificates().front(), 40 cert->GetIntermediateCertificates().front(),
41 &merkle_tree_leaf->log_entry)) { 41 &merkle_tree_leaf->signed_entry)) {
42 return false; 42 return false;
43 } 43 }
44 } else { 44 } else {
45 if (!GetX509LogEntry(cert->os_cert_handle(), 45 if (!GetX509SignedEntry(cert->os_cert_handle(),
46 &merkle_tree_leaf->log_entry)) { 46 &merkle_tree_leaf->signed_entry)) {
47 return false; 47 return false;
48 } 48 }
49 } 49 }
50 50
51 merkle_tree_leaf->timestamp = sct->timestamp; 51 merkle_tree_leaf->timestamp = sct->timestamp;
52 merkle_tree_leaf->extensions = sct->extensions; 52 merkle_tree_leaf->extensions = sct->extensions;
53 return true; 53 return true;
54 } 54 }
55 55
56 } // namespace ct 56 } // namespace ct
57 57
58 } // namespace net 58 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/merkle_tree_leaf.h ('k') | net/cert/merkle_tree_leaf_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698