summaryrefslogtreecommitdiff
path: root/verifycert.erl
diff options
context:
space:
mode:
Diffstat (limited to 'verifycert.erl')
-rwxr-xr-xverifycert.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/verifycert.erl b/verifycert.erl
index e501d6d..b9a3753 100755
--- a/verifycert.erl
+++ b/verifycert.erl
@@ -1,16 +1,16 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa ebin -pa lib/catlfish-0.2.0-dev.ez/catlfish-0.2.0-dev/ebin -pa lib/lager-2.1.1.ez/lager-2.1.1/ebin
+%%! -pa ebin -pa lib/catlfish-0.6.0-dev.ez/catlfish-0.6.0-dev/ebin -pa lib/lager-2.1.1.ez/lager-2.1.1/ebin
write_reply(Bin) ->
Length = size(Bin),
file:write(standard_io, <<Length:32, Bin/binary>>).
-verify(Certs, DBEntry) ->
+verify(RootCerts, DBEntry) ->
try
Chain = catlfish:chain_from_entry(DBEntry),
%% XXX: doesn't verify that MTL is derived from Chain
- case x509:normalise_chain(Certs, Chain) of
+ case x509:normalise_chain(RootCerts, Chain) of
{ok, _} ->
write_reply(<<0:8>>);
{error, Reason} ->
@@ -24,7 +24,7 @@ verify(Certs, DBEntry) ->
write_reply(<<2:8, ErrorBin/binary>>)
end.
-loop(Certs) ->
+loop(RootCerts) ->
{ok, LengthBin} = file:read(standard_io, 4),
<<Length:32>> = list_to_binary(LengthBin),
case Length of
@@ -32,8 +32,8 @@ loop(Certs) ->
none;
_ ->
{ok, DBEntry} = file:read(standard_io, Length),
- verify(Certs, list_to_binary(DBEntry)),
- loop(Certs)
+ verify(RootCerts, list_to_binary(DBEntry)),
+ loop(RootCerts)
end.
main(_) ->