X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/de8edc7fdb0a26ca9cb736a49b020a64ee4a0d40..fb6a9f13a40d1b9e797b4fe858a06cfdbcc1109b:/server/tests.at diff --git a/server/tests.at b/server/tests.at index 88b9d160..d217054a 100644 --- a/server/tests.at +++ b/server/tests.at @@ -9,19 +9,18 @@ ### ### This file is part of Trivial IP Encryption (TrIPE). ### -### TrIPE is free software; you can redistribute it and/or modify -### it under the terms of the GNU General Public License as published by -### the Free Software Foundation; either version 2 of the License, or -### (at your option) any later version. +### TrIPE is free software: you can redistribute it and/or modify it under +### the terms of the GNU General Public License as published by the Free +### Software Foundation; either version 3 of the License, or (at your +### option) any later version. ### -### TrIPE is distributed in the hope that it will be useful, -### but WITHOUT ANY WARRANTY; without even the implied warranty of -### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -### GNU General Public License for more details. +### TrIPE is distributed in the hope that it will be useful, but WITHOUT +### ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +### for more details. ### ### You should have received a copy of the GNU General Public License -### along with TrIPE; if not, write to the Free Software Foundation, -### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +### along with TrIPE. If not, see . m4_define([nl], [ ]) @@ -35,12 +34,10 @@ m4_define([SETUPDIR], [ ## Running standard programs with useful options. m4_define([TRIPE], [env TRIPE_PRIVHELPER=$abs_top_builddir/priv/tripe-privhelper \ - $abs_top_builddir/server/tripe -F -d. -aadmin -p0 -b127.0.0.1 -talice \ + $abs_top_builddir/server/tripe -F -d. -aadmin -p0 -b127.0.0.1 \ ${TRIPE_TEST_TRACEOPTS+-T$TRIPE_TEST_TRACEOPTS}]) m4_define([TRIPECTL], [$abs_top_builddir/client/tripectl -d. -aadmin]) m4_define([USLIP], [$abs_top_builddir/uslip/tripe-uslip]) -m4_define([PKSTREAM], - [$abs_top_builddir/pkstream/pkstream -b127.0.0.1 -p127.0.0.1]) m4_define([MITM], [$abs_top_builddir/proxy/tripe-mitm]) ## WITH_STRACE(tag, cmd) @@ -405,16 +402,17 @@ export TRIPE_SLIPIF=USLIP for p in alice bob carol; do (mkdir $p; cd $p; SETUPDIR([alpha])); done -## WITH_PKSTREAM(adir, aport, bdir, bport, body) -m4_define([WITH_PKSTREAM], [ - echo >&2 "pkstream: $1 <--> :$2 <-pkstream-> :$4 <--> $3" - PKSTREAM -l$4 127.0.0.1:$4 127.0.0.1:$(cat $3/port)& pkstream_$3_$1=$! +## WITH_MITM(adir, aport, bdir, bport, body) +m4_define([WITH_MITM], [ + echo >&2 "mitm: $1 <--> :$2 <-mitm-> :$4 <--> $3" + MITM -k$1/keyring.pub \ + peer:$1:$2:127.0.0.1:$(cat $1/port) \ + peer:$3:$4:127.0.0.1:$(cat $3/port) \ + filt:send& mitmpid_$1_$3=$! + trap 'kill $mitmpid_$1_$3; exit 127' EXIT INT QUIT TERM HUP sleep 1 - PKSTREAM -c127.0.0.1:$4 127.0.0.1:$2 127.0.0.1:$(cat $1/port)& - pkstream_$1_$3=$! - set +x $5 - kill $pkstream_$3_$1 $pkstream_$1_$3 + kill $mitmpid_$1_$3; trap - EXIT INT QUIT TERM HUP ]) WITH_3TRIPES([alice], [bob], [carol], [-nslip], @@ -422,35 +420,35 @@ WITH_3TRIPES([alice], [bob], [carol], [-nslip], ## We need an indirection layer between the two peers so that we can ## simulate the effects of NAT remapping. The nearest thing we have to - ## this is pkstream, so we may as well use that. + ## this is the mitm proxy, so we may as well use that. ## - ## alice <--> :5311 <-pkstream-> :5312 <--> bob - ## alice <--> :5321 <-pkstream-> :5322 <--> carol + ## alice <--> :5311 <-mitm-> :5312 <--> bob + ## alice <--> :5321 <-mitm-> :5322 <--> carol - WITH_PKSTREAM([alice], [5311], [bob], [5312], [ + WITH_MITM([alice], [5311], [bob], [5312], [ ESTABLISH([alice], [alice], [], [bob], [bob], [-mobile], [5312], [5311]) ]) - WITH_PKSTREAM([alice], [5319], [bob], [5312], [ + WITH_MITM([alice], [5319], [bob], [5312], [ COMMS_EPING([bob], [bob], [alice], [alice]) COMMS_SLIP([bob], [bob], [alice], [alice]) ]) - WITH_PKSTREAM([alice], [5321], [carol], [5322], [ + WITH_MITM([alice], [5321], [carol], [5322], [ ESTABLISH([alice], [alice], [], [carol], [carol], [-mobile], [5322], [5321]) ]) - WITH_PKSTREAM([alice], [5311], [bob], [5312], [ - WITH_PKSTREAM([alice], [5321], [carol], [5322], [ + WITH_MITM([alice], [5311], [bob], [5312], [ + WITH_MITM([alice], [5321], [carol], [5322], [ COMMS_EPING([bob], [bob], [alice], [alice]) COMMS_EPING([carol], [carol], [alice], [alice]) COMMS_SLIP([bob], [bob], [alice], [alice]) COMMS_SLIP([carol], [carol], [alice], [alice]) ])]) - WITH_PKSTREAM([alice], [5321], [bob], [5312], [ - WITH_PKSTREAM([alice], [5311], [carol], [5322], [ + WITH_MITM([alice], [5321], [bob], [5312], [ + WITH_MITM([alice], [5311], [carol], [5322], [ COMMS_EPING([bob], [bob], [alice], [alice]) COMMS_EPING([carol], [carol], [alice], [alice]) COMMS_SLIP([bob], [bob], [alice], [alice]) @@ -586,10 +584,10 @@ WITH_3TRIPES([alice], [bob], [carol], [-nslip -Tmx], for p in $princs; do TRIPECTL -d$p RELOAD; done AT_DATA([algs-alpha], [dnl -kx-group=ec kx-group-order-bits=256 kx-group-elt-bits=512 +kx-group=curve25519 kx-group-order-bits=252 kx-group-elt-bits=255 hash=sha256 mgf=sha256-mgf hash-sz=32 bulk-transform=naclbox bulk-overhead=20 -cipher=salsa20 cipher-keysz=32 +cipher=chacha20 cipher-keysz=32 mac=poly1305 mac-tagsz=16 cipher-data-limit=2147483648 ])