1
0
mirror of https://github.com/5im-0n/sshenc.sh.git synced 2025-08-03 03:40:14 +02:00

add a test with multiple pubkeys

This commit is contained in:
s2
2019-11-25 16:15:52 +01:00
parent 82fe18f321
commit a7c3e85125
6 changed files with 110 additions and 52 deletions

33
tests/test.sh Executable file
View File

@@ -0,0 +1,33 @@
cleanup() {
rm -rf "$tempfile"
}
trap cleanup EXIT
tempfile=$(tempfile)
plaintext=$(cat sometext)
echo -n 'testing multiple pubkeys: '
../sshenc.sh -p id_rsa-1.pub -p id_rsa-2.pub -p id_rsa-3.pub < sometext > $tempfile
cyph=$(../sshenc.sh -s id_rsa-1 < $tempfile)
if [ "$cyph" == "$plaintext" ]; then
echo -n "key1: ✓ "
else
echo -n "key1: ⛝ "
fi
cyph=$(../sshenc.sh -s id_rsa-2 < $tempfile)
if [ "$cyph" == "$plaintext" ]; then
echo -n "key2: ✓ "
else
echo -n "key2: ⛝ "
fi
cyph=$(../sshenc.sh -s id_rsa-3 < $tempfile)
if [ "$cyph" == "$plaintext" ]; then
echo -n "key3: ✓ "
else
echo -n "key4: ⛝ "
fi
echo
echo done.