From db0894020b459775e7051441ee343ecd1c270883 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Mon, 12 May 2014 14:55:47 +0200 Subject: Encode signatures properly. --- include/plop.hrl | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/plop.hrl b/include/plop.hrl index 0f687d0..354a0f2 100644 --- a/include/plop.hrl +++ b/include/plop.hrl @@ -20,7 +20,7 @@ version :: pos_integer(), % uint8 logid :: binary(), % SHA-256 over DER encoded public log key timestamp :: integer(), % uint64 - signature :: binary() + signature :: signature() }). -type spt() :: #spt{}. @@ -44,8 +44,25 @@ treesize :: integer(), timestamp :: integer(), roothash :: binary(), - signature :: binary() + signature :: signature() }). -type sth() :: #sth{}. +%% RFC 5246 7.4.1.4.1 +-type hash_alg_type() :: none | md5 | sha1 | sha224 | sha256 | sha384 | + sha512. % uint8 +-type signature_alg_type() :: anonymous | rsa | dsa | ecdsa. % uint8 +-record(sig_and_hash_alg, { + hash_alg :: hash_alg_type(), + signature_alg :: signature_alg_type() + }). +-type sig_and_hash_alg() :: #sig_and_hash_alg{}. + +%% RFC 5246 4.7 +-record(signature, { + algorithm :: sig_and_hash_alg(), + signature :: binary() + }). +-type signature() :: #signature{}. + -export_type([timestamped_entry/0, mtl/0, entry_type/0]). -- cgit v1.1