mirror of https://github.com/wolfSSL/wolfssh.git
test setting different wolfssl version for test
parent
8d1efe9fdf
commit
9e68977945
|
@ -11,12 +11,27 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
create_matrix:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
versions: ${{ steps.json.outputs.versions }}
|
||||||
|
steps:
|
||||||
|
- name: Create wolfSSL version matrix
|
||||||
|
id: json
|
||||||
|
run: |
|
||||||
|
current=`curl -s https://api.github.com/repos/wolfssl/wolfssl/releases | grep tag_name | cut -d : -f 2,3 | tr -d \" | tr -d , | tr -d ' ' | head -1`
|
||||||
|
last=`curl -s https://api.github.com/repos/wolfssl/wolfssl/releases | grep tag_name | cut -d : -f 2,3 | tr -d \" | tr -d , | tr -d ' ' | head -2 | tail -1`
|
||||||
|
VERSIONS=$(echo "[ \"master\", \"$current\", \"$last\" ]")
|
||||||
|
echo "wolfSSL versions found: $VERSIONS"
|
||||||
|
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
build_wolfssl:
|
build_wolfssl:
|
||||||
|
needs: create_matrix
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-latest, macos-latest ]
|
os: [ ubuntu-latest, macos-latest ]
|
||||||
wolfssl: [ v5.7.2-stable, master ]
|
wolfssl: ${{ fromJson(needs.create_matrix.outputs['versions']) }}
|
||||||
name: Build wolfssl
|
name: Build wolfssl
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 4
|
timeout-minutes: 4
|
||||||
|
@ -29,6 +44,9 @@ jobs:
|
||||||
key: wolfssh-os-check-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
|
key: wolfssh-os-check-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
|
||||||
lookup-only: true
|
lookup-only: true
|
||||||
|
|
||||||
|
- name: debug
|
||||||
|
run: echo wolfssl version ${{ matrix.wolfssl }}
|
||||||
|
|
||||||
- name: Checkout, build, and install wolfssl
|
- name: Checkout, build, and install wolfssl
|
||||||
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
|
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
|
||||||
uses: wolfSSL/actions-build-autotools-project@v1
|
uses: wolfSSL/actions-build-autotools-project@v1
|
||||||
|
@ -41,11 +59,14 @@ jobs:
|
||||||
install: true
|
install: true
|
||||||
|
|
||||||
build_wolfssh:
|
build_wolfssh:
|
||||||
|
needs:
|
||||||
|
- build_wolfssl
|
||||||
|
- create_matrix
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-latest, macos-latest ]
|
os: [ ubuntu-latest, macos-latest ]
|
||||||
wolfssl: [ v5.7.2-stable, master ]
|
wolfssl: ${{ fromJson(needs.create_matrix.outputs['versions']) }}
|
||||||
config: [
|
config: [
|
||||||
'',
|
'',
|
||||||
'--enable-all',
|
'--enable-all',
|
||||||
|
@ -56,7 +77,6 @@ jobs:
|
||||||
name: Build wolfssh
|
name: Build wolfssh
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 4
|
timeout-minutes: 4
|
||||||
needs: build_wolfssl
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checking cache for wolfssl
|
- name: Checking cache for wolfssl
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
|
|
@ -11,12 +11,27 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
create_matrix:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
versions: ${{ steps.json.outputs.versions }}
|
||||||
|
steps:
|
||||||
|
- name: Create wolfSSL version matrix
|
||||||
|
id: json
|
||||||
|
run: |
|
||||||
|
current=`curl -s https://api.github.com/repos/wolfssl/wolfssl/releases | grep tag_name | cut -d : -f 2,3 | tr -d \" | tr -d , | tr -d ' ' | head -1`
|
||||||
|
last=`curl -s https://api.github.com/repos/wolfssl/wolfssl/releases | grep tag_name | cut -d : -f 2,3 | tr -d \" | tr -d , | tr -d ' ' | head -2 | tail -1`
|
||||||
|
VERSIONS=$(echo "[ \"master\", \"$current\", \"$last\" ]")
|
||||||
|
echo "wolfSSL versions found: $VERSIONS"
|
||||||
|
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
build_wolfssl:
|
build_wolfssl:
|
||||||
|
needs: create_matrix
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
wolfssl: [ v5.7.2-stable ]
|
wolfssl: ${{ fromJson(needs.create_matrix.outputs['versions']) }}
|
||||||
name: Build wolfssl
|
name: Build wolfssl
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 4
|
timeout-minutes: 4
|
||||||
|
@ -41,15 +56,17 @@ jobs:
|
||||||
install: true
|
install: true
|
||||||
|
|
||||||
build_wolfssh:
|
build_wolfssh:
|
||||||
|
needs:
|
||||||
|
- build_wolfssl
|
||||||
|
- create_matrix
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
wolfssl: [ v5.7.2-stable ]
|
wolfssl: ${{ fromJson(needs.create_matrix.outputs['versions']) }}
|
||||||
name: Build and test wolfsshd
|
name: Build and test wolfsshd
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
needs: build_wolfssl
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checking cache for wolfssl
|
- name: Checking cache for wolfssl
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
@ -58,14 +75,25 @@ jobs:
|
||||||
key: wolfssh-sshd-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
|
key: wolfssh-sshd-wolfssl-${{ matrix.wolfssl }}-${{ matrix.os }}
|
||||||
fail-on-cache-miss: true
|
fail-on-cache-miss: true
|
||||||
|
|
||||||
- name: Checkout and build wolfsshd
|
- uses: actions/checkout@v4
|
||||||
uses: wolfSSL/actions-build-autotools-project@v1
|
|
||||||
with:
|
with:
|
||||||
repository: wolfssl/wolfssh
|
path: wolfssh/
|
||||||
path: wolfssh
|
|
||||||
configure: --enable-debug --enable-all LDFLAGS="-L${{ github.workspace }}/build-dir/lib" CPPFLAGS="-I${{ github.workspace }}/build-dir/include -DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=4000000"
|
- name: autogen
|
||||||
check: true
|
working-directory: ./wolfssh/
|
||||||
|
run: ./autogen.sh
|
||||||
|
|
||||||
|
- name: configure
|
||||||
|
working-directory: ./wolfssh/
|
||||||
|
run : |
|
||||||
|
./configure --enable-all LDFLAGS="-L${{ github.workspace }}/build-dir/lib" CPPFLAGS="-I${{ github.workspace }}/build-dir/include -DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=4000000 -DMAX_PATH_SZ=120"
|
||||||
|
|
||||||
|
- name: make check
|
||||||
|
working-directory: ./wolfssh/
|
||||||
|
run: make check
|
||||||
|
|
||||||
- name: Run wolfSSHd tests
|
- name: Run wolfSSHd tests
|
||||||
working-directory: wolfssh/apps/wolfsshd/test
|
working-directory: ./wolfssh/apps/wolfsshd/test
|
||||||
run: sudo ./run_all_sshd_tests.sh root
|
run: |
|
||||||
|
git log -3
|
||||||
|
sudo ./run_all_sshd_tests.sh
|
||||||
|
|
|
@ -37,8 +37,9 @@ TEST_SFTP="./examples/sftpclient/wolfsftp"
|
||||||
PRIVATE_KEY="./keys/hansel-key-ecc.der"
|
PRIVATE_KEY="./keys/hansel-key-ecc.der"
|
||||||
PUBLIC_KEY="./keys/hansel-key-ecc.pub"
|
PUBLIC_KEY="./keys/hansel-key-ecc.pub"
|
||||||
|
|
||||||
RESULT=`$TEST_CLIENT -c 'echo bob' -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT`
|
RESULT=$( $TEST_CLIENT -c 'echo bob' -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT )
|
||||||
cat $RESULT | grep bob
|
echo $RESULT
|
||||||
|
echo $RESULT | grep bob
|
||||||
RESULT=$?
|
RESULT=$?
|
||||||
if [ "$RESULT" == 0 ]; then
|
if [ "$RESULT" == 0 ]; then
|
||||||
echo "Shell login should fail with forced command"
|
echo "Shell login should fail with forced command"
|
||||||
|
|
|
@ -15,21 +15,36 @@ if [ -z "$1" ] || [ -z "$2" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -e
|
# Check if tmux is available
|
||||||
|
which tmux
|
||||||
|
RESULT=$?
|
||||||
|
if [ ${RESULT} = 1 ]; then
|
||||||
|
echo "tmux is not installed!!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Creating tmux session at $PWD with command :"
|
echo "Creating tmux session at $PWD with command :"
|
||||||
tmux new-session -d -s test "$TEST_CLIENT -t -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h \"$1\" -p \"$2\""
|
echo "tmux new-session -d -s test \"$TEST_CLIENT -q -t -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h \"$1\" -p \"$2\"\""
|
||||||
|
tmux new-session -d -s test "$TEST_CLIENT -q -t -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h \"$1\" -p \"$2\""
|
||||||
|
echo "Result of tmux new-session = $?"
|
||||||
|
|
||||||
# give the command a second to establish SSH connection
|
# give the command a second to establish SSH connection
|
||||||
sleep 0.5
|
sleep 1
|
||||||
|
|
||||||
COL=`tmux display -p -t test '#{pane_width}'`
|
COL=`tmux display -p -t test '#{pane_width}'`
|
||||||
ROW=`tmux display -p -t test '#{pane_height}'`
|
ROW=`tmux display -p -t test '#{pane_height}'`
|
||||||
|
echo "tmux 'test' session has COL = ${COL} and ROW = ${ROW}"
|
||||||
|
|
||||||
# get the terminals columns and lines
|
# get the terminals columns and lines
|
||||||
tmux send-keys -t test 'echo;echo $COLUMNS $LINES;echo'
|
tmux send-keys -t test 'echo;echo $COLUMNS $LINES;echo'
|
||||||
tmux send-keys -t test 'ENTER'
|
tmux send-keys -t test 'ENTER'
|
||||||
|
|
||||||
|
# give the command a second to run
|
||||||
|
sleep 1
|
||||||
|
|
||||||
tmux capture-pane -t test
|
tmux capture-pane -t test
|
||||||
RESULT=$(tmux show-buffer | grep '^[0-9]* [0-9]*$')
|
RESULT=$(tmux show-buffer | grep '^[0-9]* [0-9]*$')
|
||||||
|
tmux show-buffer
|
||||||
|
|
||||||
echo "$RESULT"
|
echo "$RESULT"
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -55,25 +70,32 @@ fi
|
||||||
# close down the SSH session
|
# close down the SSH session
|
||||||
tmux send-keys -t test 'exit'
|
tmux send-keys -t test 'exit'
|
||||||
tmux send-keys -t test 'ENTER'
|
tmux send-keys -t test 'ENTER'
|
||||||
set +e
|
|
||||||
|
|
||||||
# kill off the session if it's still running, but don't error out if the session
|
# kill off the session if it's still running, but don't error out if the session
|
||||||
# has already closed down
|
# has already closed down
|
||||||
tmux kill-session -t test
|
tmux kill-session -t test
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
tmux new-session -d -x 50 -y 10 -s test "$TEST_CLIENT -t -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h \"$1\" -p \"$2\""
|
echo "Starting another session with a smaller window size"
|
||||||
|
echo "tmux new-session -d -x 50 -y 10 -s test \"$TEST_CLIENT -q -t -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h \"$1\" -p \"$2\"\""
|
||||||
|
tmux new-session -d -x 50 -y 10 -s test "$TEST_CLIENT -q -t -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h \"$1\" -p \"$2\""
|
||||||
|
|
||||||
# give the command a second to establish SSH connection
|
# give the command a second to establish SSH connection
|
||||||
sleep 0.5
|
sleep 1
|
||||||
|
|
||||||
|
echo "Sending keys to tmux session for displaying column/rows"
|
||||||
tmux send-keys -t test 'echo;echo $COLUMNS $LINES;echo'
|
tmux send-keys -t test 'echo;echo $COLUMNS $LINES;echo'
|
||||||
tmux send-keys -t test 'ENTER'
|
tmux send-keys -t test 'ENTER'
|
||||||
tmux capture-pane -t test
|
tmux capture-pane -t test
|
||||||
RESULT=$(tmux show-buffer | grep '^[0-9]* [0-9]*$')
|
RESULT=$(tmux show-buffer | grep '^[0-9]* [0-9]*$')
|
||||||
|
|
||||||
ROW_FOUND=$(echo "$RESULT" | sed -e 's/[0-9]* \([0-9]*\)/\1/')
|
ROW_FOUND=$( echo "$RESULT" | sed -e 's/[0-9]* \([0-9]*\)/\1/' )
|
||||||
COL_FOUND=$(echo "$RESULT" | sed -e 's/\([0-9]*\) [0-9]*/\1/')
|
COL_FOUND=$( echo "$RESULT" | sed -e 's/\([0-9]*\) [0-9]*/\1/' )
|
||||||
|
|
||||||
|
#remove any newlines, tabs, or returns
|
||||||
|
ROW_FOUND=$( tr -d '\n\t\r ' <<<"$ROW_FOUND" )
|
||||||
|
COL_FOUND=$( tr -d '\n\t\r ' <<<"$COL_FOUND" )
|
||||||
|
|
||||||
|
|
||||||
if [ "50" != "$COL_FOUND" ]; then
|
if [ "50" != "$COL_FOUND" ]; then
|
||||||
echo "Col found was $COL_FOUND which does not match expected 50"
|
echo "Col found was $COL_FOUND which does not match expected 50"
|
||||||
|
|
|
@ -42,7 +42,11 @@ PUBLIC_KEY="./keys/hansel-key-ecc.pub"
|
||||||
head -c 1G /dev/urandom > random-test.txt
|
head -c 1G /dev/urandom > random-test.txt
|
||||||
|
|
||||||
PWD=`pwd`
|
PWD=`pwd`
|
||||||
$TEST_CLIENT -c "cd $PWD; $TEST_CLIENT -c \"cat $PWD/random-test.txt\" -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT" -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT > random-test-result.txt
|
echo "$TEST_CLIENT -q -c \"cd $PWD; $TEST_CLIENT -q -c \"cat $PWD/random-test.txt\" -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT\" -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT > random-test-result.txt"
|
||||||
|
|
||||||
|
$TEST_CLIENT -q -c "cd $PWD; $TEST_CLIENT -q -c \"cat $PWD/random-test.txt\" -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT" -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h $TEST_HOST -p $TEST_PORT > random-test-result.txt
|
||||||
|
|
||||||
|
ls -la random-test*
|
||||||
|
|
||||||
diff random-test.txt random-test-result.txt
|
diff random-test.txt random-test-result.txt
|
||||||
RESULT=$?
|
RESULT=$?
|
||||||
|
|
|
@ -17,13 +17,13 @@ PUBLIC_KEY="./keys/$3-cert.der"
|
||||||
CA_CERT="./keys/ca-cert-ecc.der"
|
CA_CERT="./keys/ca-cert-ecc.der"
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
echo "$TEST_CLIENT -c 'pwd' -u $3 -i $PRIVATE_KEY -J $PUBLIC_KEY -A $CA_CERT -h \"$1\" -p \"$2\""
|
echo "$TEST_CLIENT -X -c 'pwd' -u $3 -i $PRIVATE_KEY -J $PUBLIC_KEY -A $CA_CERT -h \"$1\" -p \"$2\""
|
||||||
$TEST_CLIENT -c 'pwd' -u $3 -i "$PRIVATE_KEY" -J "$PUBLIC_KEY" -A "$CA_CERT" -h "$1" -p "$2"
|
$TEST_CLIENT -X -c 'pwd' -u $3 -i "$PRIVATE_KEY" -J "$PUBLIC_KEY" -A "$CA_CERT" -h "$1" -p "$2"
|
||||||
set +e
|
set +e
|
||||||
|
|
||||||
rm -f error.txt
|
rm -f error.txt
|
||||||
echo "$TEST_CLIENT -c 'ls error' -u $3 -i $PRIVATE_KEY -J $PUBLIC_KEY -A $CA_CERT -h \"$1\" -p \"$2\" 2> error.txt"
|
echo "$TEST_CLIENT -X -c 'ls error' -u $3 -i $PRIVATE_KEY -J $PUBLIC_KEY -A $CA_CERT -h \"$1\" -p \"$2\" 2> error.txt"
|
||||||
$TEST_CLIENT -c 'ls error' -u $3 -i "$PRIVATE_KEY" -J "$PUBLIC_KEY" -A "$CA_CERT" -h "$1" -p "$2" 2> error.txt
|
$TEST_CLIENT -X -c 'ls error' -u $3 -i "$PRIVATE_KEY" -J "$PUBLIC_KEY" -A "$CA_CERT" -h "$1" -p "$2" 2> error.txt
|
||||||
|
|
||||||
# check stderr output was caught
|
# check stderr output was caught
|
||||||
if [ ! -s error.txt ]; then
|
if [ ! -s error.txt ]; then
|
||||||
|
@ -36,4 +36,3 @@ rm -f error.txt
|
||||||
cd $PWD
|
cd $PWD
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,7 @@ static void ShowUsage(void)
|
||||||
#endif
|
#endif
|
||||||
printf(" -E List all possible algos\n");
|
printf(" -E List all possible algos\n");
|
||||||
printf(" -k set the list of key algos to use\n");
|
printf(" -k set the list of key algos to use\n");
|
||||||
|
printf(" -q turn off debugging output\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -658,7 +659,7 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
|
||||||
|
|
||||||
(void)keepOpen;
|
(void)keepOpen;
|
||||||
|
|
||||||
while ((ch = mygetopt(argc, argv, "?ac:h:i:j:p:tu:xzNP:RJ:A:XeEk:")) != -1) {
|
while ((ch = mygetopt(argc, argv, "?ac:h:i:j:p:tu:xzNP:RJ:A:XeEk:q")) != -1) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'h':
|
case 'h':
|
||||||
host = myoptarg;
|
host = myoptarg;
|
||||||
|
@ -671,6 +672,10 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'q':
|
||||||
|
wolfSSH_Debugging_OFF();
|
||||||
|
break;
|
||||||
|
|
||||||
case 'e':
|
case 'e':
|
||||||
userEcc = 1;
|
userEcc = 1;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -14047,7 +14047,6 @@ int SendUserAuthRequest(WOLFSSH* ssh, byte authType, int addSig)
|
||||||
|
|
||||||
payloadSz = MSG_ID_SZ + (LENGTH_SZ * 3) +
|
payloadSz = MSG_ID_SZ + (LENGTH_SZ * 3) +
|
||||||
ssh->userNameSz + serviceNameSz + authNameSz;
|
ssh->userNameSz + serviceNameSz + authNameSz;
|
||||||
|
|
||||||
if (authId == ID_USERAUTH_PASSWORD)
|
if (authId == ID_USERAUTH_PASSWORD)
|
||||||
ret = PrepareUserAuthRequestPassword(ssh, &payloadSz, &authData);
|
ret = PrepareUserAuthRequestPassword(ssh, &payloadSz, &authData);
|
||||||
else if (authId == ID_USERAUTH_PUBLICKEY && !ssh->userAuthPkDone) {
|
else if (authId == ID_USERAUTH_PUBLICKEY && !ssh->userAuthPkDone) {
|
||||||
|
|
Loading…
Reference in New Issue