summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2014-05-20 12:17:05 +0200
committerLinus Nordberg <linus@nordberg.se>2014-05-20 12:17:05 +0200
commit421aed8f975848ee582e1dda0fb7b49197a5ffb7 (patch)
treef792e77894260e77fa66d181b41db0b02ce5a7a2
parentebef3cdcc323f46c6e04e86222b00414a020173e (diff)
parent943b9b21f069a91a4417332940539a3015ad6af7 (diff)
Merge remote-tracking branch 'devp/master'
-rw-r--r--src/v1.erl13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/v1.erl b/src/v1.erl
index 3d0c1e3..9f454fc 100644
--- a/src/v1.erl
+++ b/src/v1.erl
@@ -17,14 +17,14 @@ add_chain(SessionID, _Env, Input) ->
R = [{sct_version, ?PROTOCOL_VERSION},
{id, base64:encode(SPT#spt.logid)},
{timestamp, SPT#spt.timestamp},
- {extensions, []},
+ {extensions, base64:encode("")},
{signature,
base64:encode(
list_to_binary(plop:serialise(SPT#spt.signature)))}],
- binary_to_list(jiffy:encode({R}));
+ jiffy:encode({R});
_ -> html("add-chain: missing input: chain; see RFC 6962", Input)
end,
- mod_esi:deliver(SessionID, Res).
+ deliver(SessionID, Res).
add_pre_chain(SessionID, _Env, _Input) ->
niy(SessionID).
@@ -40,7 +40,7 @@ get_sth(SessionID, _Env, _Input) ->
{sha256_root_hash, base64:encode(Roothash)},
{tree_head_signature, base64:encode(
list_to_binary(plop:serialise(Signature)))}],
- mod_esi:deliver(SessionID, binary_to_list(jiffy:encode({R}))).
+ deliver(SessionID, jiffy:encode({R})).
get_sth_consistency(SessionID, _Env, _Input) ->
niy(SessionID).
@@ -53,7 +53,7 @@ get_entry_and_proof(SessionID, _Env, _Input) ->
get_roots(SessionID, _Env, _Input) ->
R = [{certificates, []}], % NIY.
- mod_esi:deliver(SessionID, binary_to_list(jiffy:encode({R}))).
+ deliver(SessionID, jiffy:encode({R})).
%% For testing. FIXME: Remove.
hello(SessionID, Env, Input) ->
@@ -78,3 +78,6 @@ html(Text, Input) ->
niy(S) ->
mod_esi:deliver(S, html("NIY - Not Yet Implemented|", [])).
+
+deliver(Session, Data) ->
+ mod_esi:deliver(Session, binary_to_list(Data)).