Skip to content

Commit 9efdb7e

Browse files
authored
Merge pull request #884 from aidangarske/add-ci-workflows
Add more CI workflows for wolfSSH
2 parents 567efa5 + 09144d0 commit 9efdb7e

File tree

26 files changed

+340
-94
lines changed

26 files changed

+340
-94
lines changed

.github/workflows/codespell.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Codespell
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
codespell:
15+
name: Check spelling
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 5
18+
steps:
19+
- name: Checkout wolfSSH
20+
uses: actions/checkout@v4
21+
22+
- name: Run codespell
23+
uses: codespell-project/actions-codespell@v2
24+
with:
25+
skip: .git,./ide,./keys,./certs,./m4,*.der,*.pem,*.pub
26+
ignore_words_list: inout,keypair,nd,parm,ser,rcv,inh,bu,fo,te,ans,pendin,anormal,dne
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Multiple Compilers
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build_wolfssl:
15+
name: Build wolfSSL
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 5
18+
steps:
19+
- name: Checkout wolfSSL
20+
uses: actions/checkout@v4
21+
with:
22+
repository: wolfssl/wolfssl
23+
path: wolfssl
24+
25+
- name: Build wolfSSL
26+
working-directory: ./wolfssl
27+
run: |
28+
./autogen.sh
29+
./configure --enable-wolfssh --enable-keygen --enable-pkcallbacks
30+
make -j$(nproc)
31+
sudo make install
32+
sudo ldconfig
33+
34+
- name: tar build-dir
35+
run: tar -zcf wolfssl-install.tgz /usr/local/lib/libwolfssl* /usr/local/include/wolfssl
36+
37+
- name: Upload built lib
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: wolfssl-multi-compiler
41+
path: wolfssl-install.tgz
42+
retention-days: 5
43+
44+
compiler_test:
45+
name: ${{ matrix.cc }}
46+
runs-on: ubuntu-latest
47+
timeout-minutes: 10
48+
needs: build_wolfssl
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
include:
53+
- cc: gcc-11
54+
cxx: g++-11
55+
- cc: gcc-12
56+
cxx: g++-12
57+
- cc: gcc-13
58+
cxx: g++-13
59+
- cc: clang-14
60+
cxx: clang++-14
61+
- cc: clang-15
62+
cxx: clang++-15
63+
- cc: clang-17
64+
cxx: clang++-17
65+
66+
steps:
67+
- name: Install compiler
68+
run: |
69+
sudo apt-get update
70+
sudo apt-get install -y ${{ matrix.cc }}
71+
72+
- name: Checkout wolfSSH
73+
uses: actions/checkout@v4
74+
75+
- name: Download wolfSSL
76+
uses: actions/download-artifact@v4
77+
with:
78+
name: wolfssl-multi-compiler
79+
80+
- name: Install wolfSSL
81+
run: |
82+
sudo tar -xzf wolfssl-install.tgz -C /
83+
sudo ldconfig
84+
85+
- name: Build wolfSSH with ${{ matrix.cc }}
86+
env:
87+
CC: ${{ matrix.cc }}
88+
CXX: ${{ matrix.cxx }}
89+
run: |
90+
./autogen.sh
91+
./configure CFLAGS="-Wall -Wextra -Wpedantic"
92+
make -j$(nproc)
93+
94+
- name: Make dist
95+
run: make dist
96+
97+
- name: Show log on errors
98+
if: failure()
99+
run: cat config.log

.github/workflows/sanitizer.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Sanitizer Tests
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build_wolfssl:
15+
name: Build wolfSSL
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 5
18+
steps:
19+
- name: Checkout wolfSSL
20+
uses: actions/checkout@v4
21+
with:
22+
repository: wolfssl/wolfssl
23+
path: wolfssl
24+
25+
- name: Build wolfSSL
26+
working-directory: ./wolfssl
27+
run: |
28+
./autogen.sh
29+
./configure --enable-wolfssh --enable-keygen --enable-pkcallbacks
30+
make -j$(nproc)
31+
sudo make install
32+
sudo ldconfig
33+
34+
- name: tar build-dir
35+
run: tar -zcf wolfssl-install.tgz /usr/local/lib/libwolfssl* /usr/local/include/wolfssl
36+
37+
- name: Upload built lib
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: wolfssl-sanitizer
41+
path: wolfssl-install.tgz
42+
retention-days: 5
43+
44+
sanitizer_test:
45+
name: ${{ matrix.name }}
46+
runs-on: ubuntu-latest
47+
timeout-minutes: 15
48+
needs: build_wolfssl
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
include:
53+
- name: "ASan"
54+
cflags: "-fsanitize=address -fno-omit-frame-pointer -g -O1"
55+
ldflags: "-fsanitize=address"
56+
- name: "UBSan"
57+
cflags: "-fsanitize=undefined -fno-sanitize-recover=all -fno-omit-frame-pointer -g"
58+
ldflags: "-fsanitize=undefined"
59+
60+
steps:
61+
- name: Workaround high-entropy ASLR
62+
run: sudo sysctl vm.mmap_rnd_bits=28
63+
64+
- name: Checkout wolfSSH
65+
uses: actions/checkout@v4
66+
67+
- name: Download wolfSSL
68+
uses: actions/download-artifact@v4
69+
with:
70+
name: wolfssl-sanitizer
71+
72+
- name: Install wolfSSL
73+
run: |
74+
sudo tar -xzf wolfssl-install.tgz -C /
75+
sudo ldconfig
76+
77+
- name: Build wolfSSH with ${{ matrix.name }}
78+
run: |
79+
./autogen.sh
80+
./configure --enable-all \
81+
CFLAGS="${{ matrix.cflags }}" LDFLAGS="${{ matrix.ldflags }}"
82+
make -j$(nproc)
83+
84+
- name: Run tests
85+
run: make check
86+
87+
- name: Show test logs on failure
88+
if: failure()
89+
run: |
90+
echo "=== test-suite.log ==="
91+
cat test-suite.log || true
92+
echo ""
93+
echo "=== tests/api.log ==="
94+
cat tests/api.log || true
95+
96+
- name: Upload failure logs
97+
if: failure()
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: wolfssh-${{ matrix.name }}-logs
101+
path: |
102+
test-suite.log
103+
config.log
104+
retention-days: 5

ChangeLog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134

135135
---
136136

137-
# wolfSSH v1.4.20 (Feburary 20, 2025)
137+
# wolfSSH v1.4.20 (February 20, 2025)
138138

139139
## New Features
140140

@@ -733,7 +733,7 @@
733733

734734
- Added DH Group Exchange with SHA-256 hashing to the key exchange.
735735
- Removed the canned banner and provided a function to set a banner string.
736-
If no sting is provided, no banner is sent.
736+
If no string is provided, no banner is sent.
737737
- Expanded the make checking to include an API test.
738738
- Added a function that returns session statistics.
739739
- When connecting to the echoserver, hitting Ctrl-E will give you some

apps/wolfssh/wolfssh.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ dispatch_semaphore_t windowSem;
280280
static sem_t windowSem;
281281
#endif
282282

283-
/* capture window change signales */
283+
/* capture window change signals */
284284
static void WindowChangeSignal(int sig)
285285
{
286286
#if (defined(__OSX__) || defined(__APPLE__))
@@ -599,7 +599,7 @@ static int wolfSSH_AGENT_DefaultActions(WS_AgentCbAction action, void* vCtx)
599599
if (ret == WS_AGENT_SUCCESS) {
600600
WMEMSET(name, 0, sizeof(struct sockaddr_un));
601601
name->sun_family = AF_LOCAL;
602-
WSTRNCPY(name->sun_path, sockName, sizeof(name->sun_path));
602+
WSTRNCPY(name->sun_path, sockName, sizeof(name->sun_path) - 1);
603603
name->sun_path[sizeof(name->sun_path) - 1] = '\0';
604604
size = WSTRLEN(sockName) +
605605
offsetof(struct sockaddr_un, sun_path);
@@ -1046,7 +1046,7 @@ static THREAD_RETURN WOLFSSH_THREAD wolfSSH_Client(void* args)
10461046

10471047
#if !defined(SINGLE_THREADED) && !defined(WOLFSSL_NUCLEUS)
10481048
#if 0
1049-
if (keepOpen) /* set up for psuedo-terminal */
1049+
if (keepOpen) /* set up for pseudo-terminal */
10501050
ClientSetEcho(2);
10511051
#endif
10521052

@@ -1070,7 +1070,7 @@ static THREAD_RETURN WOLFSSH_THREAD wolfSSH_Client(void* args)
10701070
int err;
10711071

10721072
/* exec command does not contain initial terminal size,
1073-
* unlike pty-req. Send an inital terminal size for recieving
1073+
* unlike pty-req. Send an initial terminal size for receiving
10741074
* the results of the command */
10751075
err = sendCurrentWindowSize(&arg);
10761076
if (err != WS_SUCCESS) {
@@ -1117,7 +1117,7 @@ static THREAD_RETURN WOLFSSH_THREAD wolfSSH_Client(void* args)
11171117
int err;
11181118

11191119
/* exec command does not contain initial terminal size,
1120-
* unlike pty-req. Send an inital terminal size for recieving
1120+
* unlike pty-req. Send an initial terminal size for receiving
11211121
* the results of the command */
11221122
err = sendCurrentWindowSize(&arg);
11231123
if (err != WS_SUCCESS) {

apps/wolfsshd/auth.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ struct WOLFSSHD_AUTH {
107107
#endif
108108

109109
#if 0
110-
/* this could potentially be useful in a deeply embeded future port */
110+
/* this could potentially be useful in a deeply embedded future port */
111111

112112
/* Map user names to passwords */
113113
/* Use arrays for username and p. The password or public key can
@@ -397,7 +397,7 @@ static int CheckPasswordUnix(const char* usr, const byte* pw, word32 pwSz, WOLFS
397397
wolfSSH_Log(WS_LOG_ERROR,
398398
"[SSHD] Error getting user password info");
399399
wolfSSH_Log(WS_LOG_ERROR,
400-
"[SSHD] Possibly permisions level error?"
400+
"[SSHD] Possibly permissions level error?"
401401
" i.e SSHD not ran as sudo");
402402
ret = WS_FATAL_ERROR;
403403
}
@@ -1049,7 +1049,7 @@ static int DoCheckUser(const char* usr, WOLFSSHD_AUTH* auth)
10491049

10501050
if (wolfSSHD_ConfigGetPermitRoot(auth->conf) == 0) {
10511051
if (XSTRCMP(usr, "root") == 0) {
1052-
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Login as root not permited");
1052+
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Login as root not permitted");
10531053
ret = WOLFSSH_USERAUTH_REJECTED;
10541054
}
10551055
}
@@ -1075,7 +1075,7 @@ static int DoCheckUser(const char* usr, WOLFSSHD_AUTH* auth)
10751075

10761076

10771077
/* @TODO this will take in a pipe or equivalent to talk to a privileged thread
1078-
* rathar than having WOLFSSHD_AUTH directly with privilege separation */
1078+
* rather than having WOLFSSHD_AUTH directly with privilege separation */
10791079
static int RequestAuthentication(WS_UserAuthData* authData,
10801080
WOLFSSHD_AUTH* authCtx)
10811081
{
@@ -1423,7 +1423,7 @@ static int SetDefualtUserID(WOLFSSHD_AUTH* auth)
14231423

14241424

14251425
/* Sets the default functions to be used for authentication of peer.
1426-
* Later the default functions could be overriden if needed.
1426+
* Later the default functions could be overridden if needed.
14271427
* returns a newly created WOLFSSHD_AUTH struct success */
14281428
WOLFSSHD_AUTH* wolfSSHD_AuthCreateUser(void* heap, const WOLFSSHD_CONFIG* conf)
14291429
{
@@ -1501,12 +1501,12 @@ int wolfSSHD_AuthRaisePermissions(WOLFSSHD_AUTH* auth)
15011501
#ifndef WIN32
15021502
if (auth) {
15031503
if (setegid(auth->sGid) != 0) {
1504-
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Error rasing gid");
1504+
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Error raising gid");
15051505
ret = WS_FATAL_ERROR;
15061506
}
15071507

15081508
if (seteuid(auth->sUid) != 0) {
1509-
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Error rasing uid");
1509+
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Error raising uid");
15101510
ret = WS_FATAL_ERROR;
15111511
}
15121512
}

apps/wolfsshd/configuration.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ static int HandleMatch(WOLFSSHD_CONFIG** conf, const char* value, int valueSz)
898898
&newConf->groupAppliesTo);
899899
}
900900

901-
/* @TODO handle , seperated user/group list */
901+
/* @TODO handle , separated user/group list */
902902

903903
/* update current config being processed */
904904
if (ret == WS_SUCCESS) {

apps/wolfsshd/configuration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ typedef struct WOLFSSHD_CONFIG WOLFSSHD_CONFIG;
2525

2626
#include "auth.h"
2727

28-
/* 0 so that privilage seperation is default on after struct memset'd on init */
28+
/* 0 so that privilege separation is default on after struct memset'd on init */
2929
#define WOLFSSHD_PRIV_SEPARAT 0
3030
#define WOLFSSHD_PRIV_SANDBOX 1
3131
#define WOLFSSHD_PRIV_OFF 2

apps/wolfsshd/test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# wolfSSHd Tests
22

3-
These are seprate from the tests in scripts directory because of the need for
3+
These are separate from the tests in scripts directory because of the need for
44
'sudo' when starting up an SSHd server to test against.
55

66
## Running Tests

apps/wolfsshd/test/run_all_sshd_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ else
134134
#run_test "error_return.sh"
135135
#run_test "sshd_login_grace_test.sh"
136136

137-
# add aditional tests here, check on var USING_LOCAL_HOST if can make sshd
137+
# add additional tests here, check on var USING_LOCAL_HOST if can make sshd
138138
# server start/restart with changes
139139

140140
if [ "$USING_LOCAL_HOST" == 1 ]; then

0 commit comments

Comments
 (0)