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

Unified Diff: net/cert/ct_serialization.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/ct_serialization.h ('k') | net/cert/ct_serialization_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/ct_serialization.cc
diff --git a/net/cert/ct_serialization.cc b/net/cert/ct_serialization.cc
index 64a6ff5c5d097a0b77d2ced8ec4640ab87049461..7bc7083815e56cc2f94fd66d7e44b2361725321e 100644
--- a/net/cert/ct_serialization.cc
+++ b/net/cert/ct_serialization.cc
@@ -28,7 +28,7 @@ const size_t kVersionLength = 1;
// Common V1 struct members
const size_t kTimestampLength = 8;
-const size_t kLogEntryTypeLength = 2;
+const size_t kSignedEntryTypeLength = 2;
const size_t kAsn1CertificateLengthBytes = 3;
const size_t kTbsCertificateLengthBytes = 3;
const size_t kExtensionsLengthBytes = 2;
@@ -247,20 +247,22 @@ bool WriteVariableBytes(size_t prefix_length,
return true;
}
-// Writes a LogEntry of type X.509 cert to |output|.
-// |input| is the LogEntry containing the certificate.
-// Returns true if the leaf_certificate in the LogEntry does not exceed
+// Writes a SignedEntryData of type X.509 cert to |output|.
+// |input| is the SignedEntryData containing the certificate.
+// Returns true if the leaf_certificate in the SignedEntryData does not exceed
// kMaxAsn1CertificateLength and so can be written to |output|.
-bool EncodeAsn1CertLogEntry(const LogEntry& input, std::string* output) {
+bool EncodeAsn1CertSignedEntry(const SignedEntryData& input,
+ std::string* output) {
return WriteVariableBytes(kAsn1CertificateLengthBytes,
input.leaf_certificate, output);
}
-// Writes a LogEntry of type PreCertificate to |output|.
-// |input| is the LogEntry containing the TBSCertificate and issuer key hash.
-// Returns true if the TBSCertificate component in the LogEntry does not
-// exceed kMaxTbsCertificateLength and so can be written to |output|.
-bool EncodePrecertLogEntry(const LogEntry& input, std::string* output) {
+// Writes a SignedEntryData of type PreCertificate to |output|.
+// |input| is the SignedEntryData containing the TBSCertificate and issuer key
+// hash. Returns true if the TBSCertificate component in the SignedEntryData
+// does not exceed kMaxTbsCertificateLength and so can be written to |output|.
+bool EncodePrecertSignedEntry(const SignedEntryData& input,
+ std::string* output) {
WriteEncodedBytes(
base::StringPiece(
reinterpret_cast<const char*>(input.issuer_key_hash.data),
@@ -308,13 +310,13 @@ bool DecodeDigitallySigned(base::StringPiece* input,
return true;
}
-bool EncodeLogEntry(const LogEntry& input, std::string* output) {
- WriteUint(kLogEntryTypeLength, input.type, output);
+bool EncodeSignedEntry(const SignedEntryData& input, std::string* output) {
+ WriteUint(kSignedEntryTypeLength, input.type, output);
switch (input.type) {
- case LogEntry::LOG_ENTRY_TYPE_X509:
- return EncodeAsn1CertLogEntry(input, output);
- case LogEntry::LOG_ENTRY_TYPE_PRECERT:
- return EncodePrecertLogEntry(input, output);
+ case SignedEntryData::LOG_ENTRY_TYPE_X509:
+ return EncodeAsn1CertSignedEntry(input, output);
+ case SignedEntryData::LOG_ENTRY_TYPE_PRECERT:
+ return EncodePrecertSignedEntry(input, output);
}
return false;
}
@@ -349,7 +351,7 @@ bool EncodeTreeLeaf(const MerkleTreeLeaf& leaf, std::string* output) {
WriteUint(kVersionLength, 0, output); // version: 1
WriteUint(kMerkleLeafTypeLength, 0, output); // type: timestamped entry
WriteTimeSinceEpoch(leaf.timestamp, output);
- if (!EncodeLogEntry(leaf.log_entry, output))
+ if (!EncodeSignedEntry(leaf.signed_entry, output))
return false;
if (!WriteVariableBytes(kExtensionsLengthBytes, leaf.extensions, output))
return false;
« no previous file with comments | « net/cert/ct_serialization.h ('k') | net/cert/ct_serialization_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698