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

Unified Diff: net/cert/ct_serialization.h

Issue 1576513002: Serialisation code for Certificate Transparency data (Closed) Base URL: ssh://caladan.lon.corp.google.com/usr/local/google/eranm/opensource_clients/chrome/src@sth_consistency_validation_2
Patch Set: Created 4 years, 11 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 | « no previous file | net/cert/ct_serialization.cc » ('j') | net/cert/ct_serialization.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/ct_serialization.h
diff --git a/net/cert/ct_serialization.h b/net/cert/ct_serialization.h
index f183247469f9e217e017894b425c8af095127817..fddae120eebfe52781d00c8f60bd52e2c0cbc6a1 100644
--- a/net/cert/ct_serialization.h
+++ b/net/cert/ct_serialization.h
@@ -10,6 +10,7 @@
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
+#include "net/cert/ct_trans_item.h"
#include "net/cert/signed_certificate_timestamp.h"
#include "net/cert/signed_tree_head.h"
@@ -19,6 +20,9 @@ namespace net {
// Transparency to/from the TLS wire format encoding.
namespace ct {
+struct MerkleConsistencyProof;
+struct TransItem;
Eran Messeri 2016/01/14 12:46:45 Unnecessary as you're including ct_trans_item.h
+
// If |input.signature_data| is less than kMaxSignatureLength, encodes the
// |input| to |output| and returns true. Otherwise, returns false.
NET_EXPORT_PRIVATE bool EncodeDigitallySigned(const DigitallySigned& input,
@@ -73,9 +77,43 @@ NET_EXPORT_PRIVATE bool DecodeSignedCertificateTimestamp(
base::StringPiece* input,
scoped_refptr<ct::SignedCertificateTimestamp>* output);
+NET_EXPORT_PRIVATE bool EncodeSignedCertificateTimestamp(
+ const SignedCertificateTimestamp& input,
+ std::string* output);
+
// Writes an SCTList into |output|, containing a single |sct|.
NET_EXPORT_PRIVATE bool EncodeSCTListForTesting(const base::StringPiece& sct,
std::string* output);
+
+NET_EXPORT_PRIVATE bool DecodeSignedTreeHead(base::StringPiece* input,
Eran Messeri 2016/01/14 12:46:45 Comment that all of these are from RFC6962-bis, no
+ SignedTreeHead* output);
+
+NET_EXPORT_PRIVATE bool EncodeSignedTreeHead(const SignedTreeHead& sth,
+ std::string* output);
+
+NET_EXPORT_PRIVATE bool DecodeConsistencyProof(base::StringPiece* input,
+ MerkleConsistencyProof* output);
+
+NET_EXPORT_PRIVATE bool EncodeConsistencyProof(
+ const MerkleConsistencyProof& input,
+ std::string* output);
+
+// Decodes a CT item from |input| to |output|.
+// Any pointers in |output| are owned by the caller.
+// Returns true if all fields in the TransItem could be read and decoded, false
+// otherwise.
+NET_EXPORT bool DecodeTransItem(base::StringPiece* input, TransItem* output);
+
+NET_EXPORT_PRIVATE bool DecodeTransItem(base::StringPiece* input,
+ TransItemV1* output);
+
+// Encodes the TransItem |input| into |output|.
+// Returns true if all of the fields in the TransItem could be encoded and
+// written, false otherwise.
+NET_EXPORT bool EncodeTransItem(const TransItem& input, std::string* output);
+
+NET_EXPORT bool EncodeTransItem(const TransItemV1& input, std::string* output);
+
} // namespace ct
} // namespace net
« no previous file with comments | « no previous file | net/cert/ct_serialization.cc » ('j') | net/cert/ct_serialization.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698