From 7062a5789410e34a4ca4d16786a4f46983acf893 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Mon, 19 May 2014 16:24:38 +0200 Subject: Change default protocol version from 1 to 0. RFC6962 "v1" is 0, not 1. Also, use a define and not a literal. Also also, move the define to plop.hrl. --- src/plop.erl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/plop.erl') diff --git a/src/plop.erl b/src/plop.erl index eb16aa8..d7d25ba 100644 --- a/src/plop.erl +++ b/src/plop.erl @@ -27,7 +27,6 @@ -include_lib("public_key/include/public_key.hrl"). -include_lib("eunit/include/eunit.hrl"). --define(PLOPVERSION, 1). -define(TESTPRIVKEYFILE, "test/eckey.pem"). -define(TESTPUBKEYFILE, "test/eckey-public.pem"). @@ -39,7 +38,7 @@ %% @doc The parts of an STH which is to be signed. Used as the %% interface to plop:sth/1, for testing. -record(sth_signed, { - version = 1 :: pos_integer(), + version = ?PLOPVERSION :: pos_integer(), signature_type :: signature_type(), timestamp = now :: 'now' | integer(), tree_size :: integer(), @@ -50,7 +49,7 @@ %% @doc What's signed in an SPT. Used for serialisation before hasning %% and signing. FIXME: Overlapping #spt{} -- merge somehow? -record(spt_signed, { - version :: pos_integer(), + version = ?PLOPVERSION :: pos_integer(), signature_type :: signature_type(), timestamp :: integer(), entry_type :: entry_type(), @@ -180,7 +179,6 @@ spt(LogID, PrivKey, #timestamped_entry{ }) -> BinToSign = list_to_binary(serialise(#spt_signed{ - version = 1, signature_type = certificate_timestamp, timestamp = Timestamp, entry_type = EntryType, -- cgit v1.1