1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00
Files
libssh2/tests/test_read_algos.test
Viktor Szakats 6036e57720 tests: add tests for signed hostkey: ssh-ed25519-cert-v01@openssh.com
- add host CA keys.
- add ed25519 signed hostkey for tests.
- make hostkey tests recognize it and skip hash checks.
- make existing tests select hostkey algos.
- add `ssh-ed25519-cert-v01@openssh.com` to the list of tested algos.
  (exclude for unsupported backends.)

Ref: #2434
Inspired-by: #2435
Credits-to: Pier Carlo Cadoppi
Follow-up to 65a276e8fe #2064

Closes #2513
2026-08-10 17:00:04 +02:00

42 lines
938 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright (C) Viktor Szakats
# SPDX-License-Identifier: BSD-3-Clause
set -eu
# https://testanything.org/tap-specification.html
testbin="./test_read${EXEEXT:-}"
d="$(dirname "$0")"
algos="$(tr -d $"\r" < "${d}/test_read_algos.txt")"
count=1
total="$(echo "${algos}" | wc -l | tr -d ' ')"
echo "${count}..${total}"
while read -r test; do
if [[ "${test}" = *'mac-'* ]]; then
if FIXTURE_TEST_MAC="${test}" ${LIBSSH2_TEST_EXE_RUNNER:-} "${testbin}"; then
res='ok'
else
res='not ok'
fi
elif [[ "${test}" = *'-cert-'* ]]; then
if FIXTURE_TEST_HOSTKEY="${test}" ${LIBSSH2_TEST_EXE_RUNNER:-} "${testbin}"; then
res='ok'
else
res='not ok'
fi
else
if FIXTURE_TEST_CRYPT="${test}" ${LIBSSH2_TEST_EXE_RUNNER:-} "${testbin}"; then
res='ok'
else
res='not ok'
fi
fi
echo "${res} ${count} - test_read-${test}"
((count++))
done <<< "${algos}"