diff options
author | Linus Nordberg <linus@nordberg.se> | 2014-05-12 14:55:47 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2014-05-12 14:55:47 +0200 |
commit | db0894020b459775e7051441ee343ecd1c270883 (patch) | |
tree | 766023e90897106966e7fd60adce209c6b7d396e /include/plop.hrl | |
parent | 942cba0d18b9fc7d692ebc49f4955ae95f65a2be (diff) |
Encode signatures properly.
Diffstat (limited to 'include/plop.hrl')
-rw-r--r-- | include/plop.hrl | 21 |
1 files changed, 19 insertions, 2 deletions
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]). |