diff options
-rw-r--r-- | src/v1.erl | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -19,10 +19,10 @@ add_chain(SessionID, _Env, Input) -> {timestamp, SPT#spt.timestamp}, {extensions, []}, {signature, base64:encode(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). @@ -37,7 +37,7 @@ get_sth(SessionID, _Env, _Input) -> {timestamp, Timestamp}, {sha256_root_hash, base64:encode(Roothash)}, {tree_head_signature, Signature}], - mod_esi:deliver(SessionID, binary_to_list(jiffy:encode({R}))). + deliver(SessionID, jiffy:encode({R})). get_sth_consistency(SessionID, _Env, _Input) -> niy(SessionID). @@ -50,7 +50,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) -> @@ -75,3 +75,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)). |