test: extend 105-ntpauth test

This commit is contained in:
Miroslav Lichvar 2019-09-19 17:38:22 +02:00
parent e8be384cdf
commit 813ea71b50

View file

@ -23,16 +23,20 @@ EOF
keys=4 keys=4
if check_config_h 'FEAT_SECHASH 1'; then types="MD5"
hashes="MD5 SHA1 SHA256 SHA384 SHA512" check_config_h 'FEAT_SECHASH 1' && types="$types SHA1 SHA256 SHA384 SHA512"
else check_config_h 'HAVE_CMAC 1' && types="$types AES128 AES256"
hashes="MD5"
fi
for hash in $hashes; do for type in $types; do
keys=$[$keys + 1] keys=$[$keys + 1]
key=$(echo $keys $hash HEX:$(tr -c -d '0-9A-F' < /dev/urandom 2> /dev/null | \ case $type in
head -c $[$RANDOM % 64 * 2 + 2])) AES128) length=16;;
AES256) length=32;;
*) length=$[$RANDOM % 32 + 1];;
esac
key=$(echo $keys $type HEX:$(tr -c -d '0-9A-F' < /dev/urandom 2> /dev/null | \
head -c $[$length * 2]))
echo "$key" >> tmp/server.keys echo "$key" >> tmp/server.keys
echo "$key" >> tmp/client.keys echo "$key" >> tmp/client.keys
done done