forked from wolfSSL/wolfssh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/wolfSSL/wolfssh into comp…
…onent-manager
- Loading branch information
Showing
24 changed files
with
800 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Windows Build Test | ||
|
||
on: | ||
push: | ||
branches: [ '*' ] | ||
pull_request: | ||
branches: [ '*' ] | ||
|
||
env: | ||
WOLFSSL_SOLUTION_FILE_PATH: wolfssl64.sln | ||
SOLUTION_FILE_PATH: wolfssh.sln | ||
USER_SETTINGS_H_NEW: wolfssh/ide/winvs/user_settings.h | ||
USER_SETTINGS_H: wolfssl/IDE/WIN/user_settings.h | ||
INCLUDE_DIR: wolfssh | ||
|
||
# Configuration type to build. | ||
# You can convert this to a build matrix if you need coverage of multiple configuration types. | ||
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
WOLFSSL_BUILD_CONFIGURATION: Release | ||
WOLFSSH_BUILD_CONFIGURATION: Release | ||
BUILD_PLATFORM: x64 | ||
TARGET_PLATFORM: 10 | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: wolfssl/wolfssl | ||
path: wolfssl | ||
|
||
- uses: actions/checkout@master | ||
with: | ||
path: wolfssh | ||
|
||
- name: Add MSBuild to PATH | ||
uses: microsoft/setup-msbuild@v1 | ||
|
||
- name: Restore wolfSSL NuGet packages | ||
working-directory: ${{env.GITHUB_WORKSPACE}}wolfssl | ||
run: nuget restore ${{env.WOLFSSL_SOLUTION_FILE_PATH}} | ||
|
||
- name: updated user_settings.h for sshd and x509 | ||
working-directory: ${{env.GITHUB_WORKSPACE}} | ||
run: cp ${{env.USER_SETTINGS_H_NEW}} ${{env.USER_SETTINGS_H}} | ||
|
||
- name: replace wolfSSL user_settings.h with wolfSSH user_settings.h | ||
working-directory: ${{env.GITHUB_WORKSPACE}} | ||
run: get-content ${{env.USER_SETTINGS_H_NEW}} | %{$_ -replace "if 0","if 1"} | ||
|
||
- name: Build wolfssl library | ||
working-directory: ${{env.GITHUB_WORKSPACE}}wolfssl | ||
run: msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:Configuration=${{env.WOLFSSL_BUILD_CONFIGURATION}} /t:wolfssl ${{env.WOLFSSL_SOLUTION_FILE_PATH}} | ||
|
||
- name: Restore NuGet packages | ||
working-directory: ${{env.GITHUB_WORKSPACE}}wolfssh\ide\winvs | ||
run: nuget restore ${{env.SOLUTION_FILE_PATH}} | ||
|
||
- name: Build wolfssh | ||
working-directory: ${{env.GITHUB_WORKSPACE}}wolfssh\ide\winvs | ||
# Add additional options to the MSBuild command line here (like platform or verbosity level). | ||
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference | ||
run: msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:WindowsTargetPlatformVersion=${{env.TARGET_PLATFORM}} /p:Configuration=${{env.WOLFSSH_BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
|
||
# sshd local test | ||
|
||
PWD=`pwd` | ||
cd ../../.. | ||
|
||
TEST_CLIENT="./examples/client/client" | ||
USER=`whoami` | ||
PRIVATE_KEY="./keys/hansel-key-ecc.der" | ||
PUBLIC_KEY="./keys/hansel-key-ecc.pub" | ||
|
||
if [ -z "$1" ] || [ -z "$2" ]; then | ||
echo "expecting host and port as arguments" | ||
echo "./error_return.sh 127.0.0.1 22222" | ||
exit 1 | ||
fi | ||
|
||
echo "$TEST_CLIENT -c 'bash -c \"(exit 2)\"' -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h \"$1\" -p \"$2\"" | ||
$TEST_CLIENT -c 'bash -c "(exit 2)"' -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -h "$1" -p "$2" | ||
RESULT=$? | ||
if [ "$RESULT" != 2 ]; then | ||
echo "Expecting error return value of 2 for failed ls command, found $RESULT" | ||
cd $PWD | ||
exit 1 | ||
fi | ||
|
||
cd $PWD | ||
exit 0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh | ||
|
||
# sshd local test | ||
|
||
PWD=`pwd` | ||
cd ../../.. | ||
|
||
TEST_SFTP_CLIENT="./examples/sftpclient/wolfsftp" | ||
USER=`whoami` | ||
PRIVATE_KEY="./keys/hansel-key-ecc.der" | ||
PUBLIC_KEY="./keys/hansel-key-ecc.pub" | ||
|
||
if [ -z "$1" ] || [ -z "$2" ]; then | ||
echo "expecting host and port as arguments" | ||
echo "./sshd_exec_test.sh 127.0.0.1 22222" | ||
exit 1 | ||
fi | ||
|
||
|
||
# create a large file with random data (larger than word32 max value) | ||
head -c 4400000010 < /dev/random > large-random.txt | ||
|
||
set -e | ||
echo "$TEST_SFTP_CLIENT -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -g -l large-random.txt -r `pwd`/large-random-2.txt -h \"$1\" -p \"$2\"" | ||
$TEST_SFTP_CLIENT -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -g -l large-random.txt -r `pwd`/large-random-2.txt -h "$1" -p "$2" | ||
|
||
cmp large-random.txt large-random-2.txt | ||
RESULT=$? | ||
if [ "$RESULT" != "0" ]; then | ||
echo "files did not match when compared" | ||
exit 1 | ||
fi | ||
rm -f large-random.txt | ||
rm -f large-random-2.txt | ||
|
||
set +e | ||
|
||
cd $PWD | ||
exit 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
# sshd local test | ||
|
||
PWD=`pwd` | ||
cd ../../.. | ||
|
||
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then | ||
echo "expecting host, port and user as arguments" | ||
echo "./sshd_x509_text.sh 127.0.0.1 22222 user" | ||
exit 1 | ||
fi | ||
|
||
TEST_CLIENT="./examples/client/client" | ||
PRIVATE_KEY="./keys/$3-key.der" | ||
PUBLIC_KEY="./keys/$3-cert.der" | ||
CA_CERT="./keys/ca-cert-ecc.der" | ||
|
||
set -e | ||
echo "$TEST_CLIENT -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" | ||
set +e | ||
|
||
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" | ||
$TEST_CLIENT -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 | ||
if [ ! -s error.txt ]; then | ||
echo "No stderr data was found when expected!!" | ||
cd $PWD | ||
exit 1 | ||
fi | ||
rm -f error.txt | ||
|
||
cd $PWD | ||
exit 0 | ||
|
||
|
Oops, something went wrong.