From 6462f66777b20b50594dee3670695f437b5989ec Mon Sep 17 00:00:00 2001 From: Sarah Larsen Date: Fri, 6 Mar 2026 18:42:47 +0000 Subject: [PATCH 1/2] Add auth_test shell script --- auth_test.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 auth_test.sh diff --git a/auth_test.sh b/auth_test.sh new file mode 100755 index 000000000..efb0ee6d4 --- /dev/null +++ b/auth_test.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# This is a set of commands to run and verify they work before doing a new release. +# Eventually they should also use the -J flag to generate JSON output, and a program should +# be written to check the output. +# Be sure to test both client and server on Linux, BSD, and OSX +# + +if [ $# -ne 2 ] +then + echo "Usage: `basename "$0"` binary output" + exit $E_BADARGS +fi +# +set -x + +binary=$1 +output=$2 + +#sudo apt-get install libssl-dev +openssl genrsa -out private.pem 2048 +openssl rsa -in private.pem -outform PEM -pubout -out public.pem + +#user,sha256(pwd) +S_USER=mario S_PASSWD=luigi +echo $U_USER +SHA=$(echo -n "{$S_USER}$S_PASSWD" | sha256sum | awk '{ print $1 }') +echo ${S_USER},${SHA} > authorized-user.txt +cat authorized-user.txt + +./src/${binary} -s --rsa-private-key-path=./private.pem --authorized-user=./authorized-user.txt &> ${output} & + +IPERF3_PASSWORD=${S_PASSWD} ./src/${binary} -c localhost --rsa-public-key-path=./public.pem --username=${S_USER} +IPERF3_PASSWORD="very incorrect" ./src/${binary} -c localhost --rsa-public-key-path=./public.pem --username=${S_USER} +IPERF3_PASSWORD="very,very,very, incorrect, and really, really, really, really, really long. Just to check." ./src/${binary} -c localhost --rsa-public-key-path=./public.pem --username=${S_USER} +IPERF3_PASSWORD=${S_PASSWD} ./src/${binary} -c localhost --rsa-public-key-path=./public.pem --username=${S_USER} + +pkill ${binary} + +cat ${output} +rm ${output} From 65900028406f39a9081eeecf5aa0350da7e4c8ad Mon Sep 17 00:00:00 2001 From: Sarah Larsen Date: Fri, 20 Mar 2026 18:48:20 +0000 Subject: [PATCH 2/2] Update to not have arguments --- auth_test.sh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/auth_test.sh b/auth_test.sh index efb0ee6d4..f661784d2 100755 --- a/auth_test.sh +++ b/auth_test.sh @@ -6,16 +6,13 @@ # Be sure to test both client and server on Linux, BSD, and OSX # -if [ $# -ne 2 ] -then - echo "Usage: `basename "$0"` binary output" - exit $E_BADARGS -fi # set -x -binary=$1 -output=$2 +binary=./src/iperf3 +output=/tmp/iperf3_auth_tmp.txt + +# Generate keys and authorized user file #sudo apt-get install libssl-dev openssl genrsa -out private.pem 2048 @@ -28,12 +25,16 @@ SHA=$(echo -n "{$S_USER}$S_PASSWD" | sha256sum | awk '{ print $1 }') echo ${S_USER},${SHA} > authorized-user.txt cat authorized-user.txt -./src/${binary} -s --rsa-private-key-path=./private.pem --authorized-user=./authorized-user.txt &> ${output} & +# Run Server + +${binary} -s --rsa-private-key-path=./private.pem --authorized-user=./authorized-user.txt &> ${output} & + +# Run Client -IPERF3_PASSWORD=${S_PASSWD} ./src/${binary} -c localhost --rsa-public-key-path=./public.pem --username=${S_USER} -IPERF3_PASSWORD="very incorrect" ./src/${binary} -c localhost --rsa-public-key-path=./public.pem --username=${S_USER} -IPERF3_PASSWORD="very,very,very, incorrect, and really, really, really, really, really long. Just to check." ./src/${binary} -c localhost --rsa-public-key-path=./public.pem --username=${S_USER} -IPERF3_PASSWORD=${S_PASSWD} ./src/${binary} -c localhost --rsa-public-key-path=./public.pem --username=${S_USER} +IPERF3_PASSWORD=${S_PASSWD} ${binary} -c localhost --rsa-public-key-path=./public.pem --username=${S_USER} +IPERF3_PASSWORD="very incorrect" ${binary} -c localhost --rsa-public-key-path=./public.pem --username=${S_USER} +IPERF3_PASSWORD="very,very,very, incorrect, and really, really, really, really, really long. Just to check." ${binary} -c localhost --rsa-public-key-path=./public.pem --username=${S_USER} +IPERF3_PASSWORD=${S_PASSWD} ${binary} -c localhost --rsa-public-key-path=./public.pem --username=${S_USER} pkill ${binary}