From 8dc315cd7c623bcc0fcfc3e44df30822f3ca1828 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 22 Sep 2019 14:46:53 +0100 Subject: [PATCH] server/tests.at: Add roundtrip test for the crypto transforms. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This should avoid future débâcles like the one we had this time. --- server/tests.at | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/server/tests.at b/server/tests.at index 3fd2e47b..eb2e5612 100644 --- a/server/tests.at +++ b/server/tests.at @@ -39,6 +39,9 @@ m4_define([TRIPE], m4_define([TRIPECTL], [$abs_top_builddir/client/tripectl -d. -aadmin]) m4_define([USLIP], [$abs_top_builddir/uslip/tripe-uslip]) m4_define([MITM], [$abs_top_builddir/proxy/tripe-mitm]) +m4_define([BULKTEST], + [$abs_top_builddir/server/tripe-test \ + ${TRIPE_TEST_TRACEOPTS+-T$TRIPE_TEST_TRACEOPTS}]) ## WITH_STRACE(tag, cmd) ## @@ -806,4 +809,32 @@ WITH_2TRIPES([alice], [bob], [-nslip], [-talice], [-tbob], [ AT_CLEANUP +###-------------------------------------------------------------------------- +### Key-exchange ad bulk crypto round trip. + +AT_SETUP([server roundtrip]) +AT_KEYWORDS([roundtrip]) + +while read label genalg paramalg spec; do + paramopts=${spec%--*} attrs=${spec#*--} + key -kkeyring.$label add -a$paramalg -eforever $paramopts -tparam tripe-param $attrs + key -kkeyring.$label add -a$genalg -pparam -eforever -talice tripe + key -kkeyring.$label extract -f-secret keyring.$label-pub + { sh -c "echo $$"; date; } >msg + AT_CHECK([BULKTEST -kkeyring.$label -talice \ + ies-encrypt 99 "$(cat msg)nl"], [0], [stdout], [stderr]) + cp msg expout; mv stdout ct + AT_CHECK([BULKTEST -kkeyring.$label -talice \ + ies-decrypt 99 "$(cat ct)"], [0], [expout], [stderr]) +done <