summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2014-09-25 17:04:01 +0200
committerLinus Nordberg <linus@nordberg.se>2014-09-25 17:04:01 +0200
commiteb9b05d4b9213c9481a7005c63fa9107fe1b879f (patch)
treea906a7d8b5829bc6c888e96a04696fc9786ab90c
parent8ca2b519859e9ed2284f596a907b63ba615bb7c5 (diff)
Sign the correct things in SPT's.
First, the log entry (i.e. leaf hash) must be a TLS vector. Second, an empty extension (as a TLS vector), must be included.
-rw-r--r--src/plop.erl13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plop.erl b/src/plop.erl
index d9daf8d..5443183 100644
--- a/src/plop.erl
+++ b/src/plop.erl
@@ -408,11 +408,14 @@ serialise(#spt_signed{
}) ->
Sigtype = signature_type(SigtypeAtom),
Entrytype = entry_type(EntrytypeAtom),
- <<Version:8,
- Sigtype:8,
- Timestamp:64,
- Entrytype:16,
- Entry/binary>>;
+ Extensions = <<>>,
+ list_to_binary(
+ [<<Version:8,
+ Sigtype:8,
+ Timestamp:64,
+ Entrytype:16>>,
+ serialise_tls_vector(Entry, 3),
+ serialise_tls_vector(Extensions, 2)]);
serialise(#mtl{ % Merkle Tree Leaf.
version = Version,
leaf_type = TypeAtom,