mirror of
https://github.com/Noratrieb/cluelessh.git
synced 2026-01-14 16:35:06 +01:00
add tests and fixes
This commit is contained in:
parent
688394cac9
commit
a59bcb069d
10 changed files with 202 additions and 37 deletions
3
bin/cluelesshd/tests/openssh-client/command.sh
Normal file
3
bin/cluelesshd/tests/openssh-client/command.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
ssh -p "$PORT" "$HOST" echo jdklfsjdöklfd | grep "jdklfsjdöklfd"
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# KEX
|
||||
printf $"exit\r" | ssh -oKexAlgorithms=curve25519-sha256 -p "$PORT" "$HOST"
|
||||
printf $"exit\r" | ssh -oKexAlgorithms=ecdh-sha2-nistp256 -p "$PORT" "$HOST"
|
||||
ssh -oKexAlgorithms=curve25519-sha256 -p "$PORT" "$HOST" true
|
||||
ssh -oKexAlgorithms=ecdh-sha2-nistp256 -p "$PORT" "$HOST" true
|
||||
|
||||
# Encryption
|
||||
printf $"exit\r" | ssh -oCiphers=chacha20-poly1305@openssh.com -p "$PORT" "$HOST"
|
||||
printf $"exit\r" | ssh -oCiphers=aes256-gcm@openssh.com -p "$PORT" "$HOST"
|
||||
ssh -oCiphers=chacha20-poly1305@openssh.com -p "$PORT" "$HOST" true
|
||||
ssh -oCiphers=aes256-gcm@openssh.com -p "$PORT" "$HOST" true
|
||||
|
||||
# Host Key
|
||||
printf $"exit\r" | ssh -oHostKeyAlgorithms=ssh-ed25519 -p "$PORT" "$HOST"
|
||||
ssh -oHostKeyAlgorithms=ssh-ed25519 -p "$PORT" "$HOST" true
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# disabled, TODO
|
||||
exit 0
|
||||
|
||||
echo | ssh -p "$PORT" "$HOST"
|
||||
printf $"echo jdklfsjdöklfd" | ssh -p "$PORT" "$HOST" | grep jdklfsjdöklfd
|
||||
|
|
|
|||
|
|
@ -19,7 +19,30 @@ kill_server() {
|
|||
|
||||
trap kill_server EXIT
|
||||
|
||||
failures=()
|
||||
|
||||
export PORT=2223
|
||||
export HOST=localhost
|
||||
|
||||
for script in "$script_dir"/openssh-client/*.sh; do
|
||||
echo "-------------- Running $script"
|
||||
PORT=2223 HOST=localhost bash -euo pipefail "$script"
|
||||
|
||||
echo "-------------- Running PORT=$PORT HOST=$HOST bash $script"
|
||||
|
||||
set +e
|
||||
bash -euo pipefail "$script"
|
||||
result=$?
|
||||
set -e
|
||||
if [ "$result" -ne "0" ]; then
|
||||
echo "Test $script failed!"
|
||||
|
||||
failures+=("$script")
|
||||
fi
|
||||
done
|
||||
|
||||
if (( ${#failures[@]} )); then
|
||||
echo "FAILED"
|
||||
for failure in "${failures[@]}"; do
|
||||
echo " failed: PORT=$PORT HOST=$HOST bash $failure"
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue