summaryrefslogtreecommitdiff
path: root/test/auth.sh
diff options
context:
space:
mode:
authorMikhail Osipov <mike.osipov@gmail.com>2021-09-22 14:08:50 +0300
committerMikhail Osipov <mike.osipov@gmail.com>2021-09-22 14:10:24 +0300
commitbb5930cfc1852de96296c3a8b19b1e202e5c504c (patch)
treee66aad2b93762e88889ce7052cb2e9b1a50e32e6 /test/auth.sh
parent8f869ec31d249732e22c609e8dff0a492a47af5a (diff)
aes: get secret from file
Diffstat (limited to 'test/auth.sh')
-rwxr-xr-xtest/auth.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/auth.sh b/test/auth.sh
index 608b4fd..1baf2bb 100755
--- a/test/auth.sh
+++ b/test/auth.sh
@@ -1,20 +1,24 @@
#!/bin/bash
-FILE=`mktemp`
+AESFILE=`mktemp`
+AUTHFILE=`mktemp`
-cat > $FILE <<EOF
+echo secret > $AESFILE
+
+cat > $AUTHFILE <<EOF
T t
X x
EOF
-trap 'unlink $FILE' EXIT
+trap 'rm -f $AESFILE $AUTHFILE' EXIT
ROOT=$(dirname $0)/..
PATH=$ROOT/bin:$PATH
tunnel add name T listen,addr=%2000 auth dump aes dial,addr=%3000
tunnel add name X listen,addr=%3000 /aes /auth dial,addr=%4000
-tunnel set authfile $FILE
+tunnel set aesfile $AESFILE
+tunnel set authfile $AUTHFILE
tunnel set tunnel.T.authuser T
tunnel set tunnel.X.authuser X
nc -l 4000 &