diff options
-rw-r--r-- | src/plop.erl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plop.erl b/src/plop.erl index 0cb29f5..39ab2c0 100644 --- a/src/plop.erl +++ b/src/plop.erl @@ -372,6 +372,10 @@ timestamp(Timestamp) -> _ -> Timestamp end. +serialise_tls_vector(Binary, LengthLen) -> + Length = byte_size(Binary), + <<Length:LengthLen/integer-unit:8, Binary/binary>>. + -spec serialise(plop_entry() | timestamped_entry() | mtl() | spt() | spt_signed() | sth() | sth_signed() | sig_and_hash_alg() | signature()) -> binary(). @@ -380,12 +384,14 @@ serialise(#plop_entry{ data = Data }) -> EntryType = entry_type(TypeAtom), - <<EntryType:16, Data/binary>>; + DataVector = serialise_tls_vector(Data, 3), + <<EntryType:16, DataVector/binary>>; serialise(#timestamped_entry{ timestamp = Timestamp, entry = PlopEntry }) -> - list_to_binary([<<Timestamp:64>>, serialise(PlopEntry)]); + Extensions = <<>>, + list_to_binary([<<Timestamp:64>>, serialise(PlopEntry), serialise_tls_vector(Extensions, 2)]); serialise(#spt{ version = Version, logid = LogID, |