aboutsummaryrefslogtreecommitdiff
path: root/cmd/sigsum/test
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@mullvad.net>2022-03-02 23:16:43 +0100
committerRasmus Dahlberg <rasmus@mullvad.net>2022-03-02 23:17:48 +0100
commit8da382069f42f6d88d3abf914dd38d7e40a845bc (patch)
tree780e8297ee3905ab662c6c88cb8bf33f0717c90c /cmd/sigsum/test
initial commit
Diffstat (limited to 'cmd/sigsum/test')
-rw-r--r--cmd/sigsum/test/keys/signify.pub2
-rw-r--r--cmd/sigsum/test/keys/signify.sec2
-rwxr-xr-xcmd/sigsum/test/signify.sh55
3 files changed, 59 insertions, 0 deletions
diff --git a/cmd/sigsum/test/keys/signify.pub b/cmd/sigsum/test/keys/signify.pub
new file mode 100644
index 0000000..742a66a
--- /dev/null
+++ b/cmd/sigsum/test/keys/signify.pub
@@ -0,0 +1,2 @@
+untrusted comment: signify public key
+RWQhuW/GnP7W13NSC8qzkpnB1BJXk96/GhaWe6f/OpBvMRHFdwuUIYGb
diff --git a/cmd/sigsum/test/keys/signify.sec b/cmd/sigsum/test/keys/signify.sec
new file mode 100644
index 0000000..57cdf84
--- /dev/null
+++ b/cmd/sigsum/test/keys/signify.sec
@@ -0,0 +1,2 @@
+untrusted comment: signify secret key
+RWRCSwAAACrUdp2uXyio8Rdwv0W6PLGiUQei6JeOZAYhuW/GnP7W1655JdycJo4tbOh/ba1OxA7QyVSdNFBs5SyF4eM5yIE98xhTAtizBDxki1Y3sqcFvWFH8ZlKzRjY8rUrTYaaCQE=
diff --git a/cmd/sigsum/test/signify.sh b/cmd/sigsum/test/signify.sh
new file mode 100755
index 0000000..8e86e8d
--- /dev/null
+++ b/cmd/sigsum/test/signify.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+set -e
+trap cleanup EXIT
+
+pass=1234
+priv=keys/signify.sec
+pub=keys/signify.pub
+domain_hint=_sigsum_v0.test-only.rgdd.se
+msg=msg-$(date +%s)
+num_msg=3
+
+function cleanup() {
+ set +e
+
+ rm -f sigsum
+ for i in $(seq 1 $num_msg); do
+ rm -f $msg-$i{,.trunnel,.sig}
+ done
+
+ exit
+}
+
+go build ../
+
+files=""
+for i in $(seq 1 $num_msg); do
+ echo $msg-$i > $msg-$i
+ if ! ./sigsum format $msg-$i > $msg-$i.trunnel; then
+ echo "[FAIL] format for $num_msg signify message(s)" >&2
+ exit 1
+ fi
+ if ! echo $pass | signify-openbsd -Ss $priv -m $msg-$i.trunnel -x $msg-$i.sig; then
+ echo "[FAIL] sign for $num_msg signify message(s)" >&2
+ exit 1
+ fi
+ files=$(echo -n $files $msg-$i)
+done
+
+echo "[PASS] format for $num_msg signify message(s)" >&2
+echo "[PASS] sign for $num_msg signify message(s)" >&2
+
+if ! ./sigsum bundle -t signify -k $pub -d $domain_hint $files; then
+ echo "[FAIL] bundle for $num_msg signify message(s)" >&2
+ exit 1
+fi
+
+echo "[PASS] bundle for $num_msg signify message(s)" >&2
+
+if ! ./sigsum verify -t signify -k $pub $files; then
+ echo "[FAIL] verify for $num_msg signify message(s)" >&2
+ exit 1
+fi
+
+echo "[PASS] verify for $num_msg signify message(s)" >&2