mirror of https://github.com/wolfSSL/wolfssh.git
Add more wolfSSH CI workflows
parent
567efa5a04
commit
09144d0c7a
|
|
@ -0,0 +1,26 @@
|
|||
name: Codespell
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
codespell:
|
||||
name: Check spelling
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout wolfSSH
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run codespell
|
||||
uses: codespell-project/actions-codespell@v2
|
||||
with:
|
||||
skip: .git,./ide,./keys,./certs,./m4,*.der,*.pem,*.pub
|
||||
ignore_words_list: inout,keypair,nd,parm,ser,rcv,inh,bu,fo,te,ans,pendin,anormal,dne
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
name: Multiple Compilers
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
name: Build wolfSSL
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout wolfSSL
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/wolfssl
|
||||
path: wolfssl
|
||||
|
||||
- name: Build wolfSSL
|
||||
working-directory: ./wolfssl
|
||||
run: |
|
||||
./autogen.sh
|
||||
./configure --enable-wolfssh --enable-keygen --enable-pkcallbacks
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
|
||||
- name: tar build-dir
|
||||
run: tar -zcf wolfssl-install.tgz /usr/local/lib/libwolfssl* /usr/local/include/wolfssl
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolfssl-multi-compiler
|
||||
path: wolfssl-install.tgz
|
||||
retention-days: 5
|
||||
|
||||
compiler_test:
|
||||
name: ${{ matrix.cc }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
needs: build_wolfssl
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- cc: gcc-11
|
||||
cxx: g++-11
|
||||
- cc: gcc-12
|
||||
cxx: g++-12
|
||||
- cc: gcc-13
|
||||
cxx: g++-13
|
||||
- cc: clang-14
|
||||
cxx: clang++-14
|
||||
- cc: clang-15
|
||||
cxx: clang++-15
|
||||
- cc: clang-17
|
||||
cxx: clang++-17
|
||||
|
||||
steps:
|
||||
- name: Install compiler
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ${{ matrix.cc }}
|
||||
|
||||
- name: Checkout wolfSSH
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download wolfSSL
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolfssl-multi-compiler
|
||||
|
||||
- name: Install wolfSSL
|
||||
run: |
|
||||
sudo tar -xzf wolfssl-install.tgz -C /
|
||||
sudo ldconfig
|
||||
|
||||
- name: Build wolfSSH with ${{ matrix.cc }}
|
||||
env:
|
||||
CC: ${{ matrix.cc }}
|
||||
CXX: ${{ matrix.cxx }}
|
||||
run: |
|
||||
./autogen.sh
|
||||
./configure CFLAGS="-Wall -Wextra -Wpedantic"
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Make dist
|
||||
run: make dist
|
||||
|
||||
- name: Show log on errors
|
||||
if: failure()
|
||||
run: cat config.log
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
name: Sanitizer Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_wolfssl:
|
||||
name: Build wolfSSL
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout wolfSSL
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: wolfssl/wolfssl
|
||||
path: wolfssl
|
||||
|
||||
- name: Build wolfSSL
|
||||
working-directory: ./wolfssl
|
||||
run: |
|
||||
./autogen.sh
|
||||
./configure --enable-wolfssh --enable-keygen --enable-pkcallbacks
|
||||
make -j$(nproc)
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
|
||||
- name: tar build-dir
|
||||
run: tar -zcf wolfssl-install.tgz /usr/local/lib/libwolfssl* /usr/local/include/wolfssl
|
||||
|
||||
- name: Upload built lib
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolfssl-sanitizer
|
||||
path: wolfssl-install.tgz
|
||||
retention-days: 5
|
||||
|
||||
sanitizer_test:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
needs: build_wolfssl
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: "ASan"
|
||||
cflags: "-fsanitize=address -fno-omit-frame-pointer -g -O1"
|
||||
ldflags: "-fsanitize=address"
|
||||
- name: "UBSan"
|
||||
cflags: "-fsanitize=undefined -fno-sanitize-recover=all -fno-omit-frame-pointer -g"
|
||||
ldflags: "-fsanitize=undefined"
|
||||
|
||||
steps:
|
||||
- name: Workaround high-entropy ASLR
|
||||
run: sudo sysctl vm.mmap_rnd_bits=28
|
||||
|
||||
- name: Checkout wolfSSH
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download wolfSSL
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wolfssl-sanitizer
|
||||
|
||||
- name: Install wolfSSL
|
||||
run: |
|
||||
sudo tar -xzf wolfssl-install.tgz -C /
|
||||
sudo ldconfig
|
||||
|
||||
- name: Build wolfSSH with ${{ matrix.name }}
|
||||
run: |
|
||||
./autogen.sh
|
||||
./configure --enable-all \
|
||||
CFLAGS="${{ matrix.cflags }}" LDFLAGS="${{ matrix.ldflags }}"
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Run tests
|
||||
run: make check
|
||||
|
||||
- name: Show test logs on failure
|
||||
if: failure()
|
||||
run: |
|
||||
echo "=== test-suite.log ==="
|
||||
cat test-suite.log || true
|
||||
echo ""
|
||||
echo "=== tests/api.log ==="
|
||||
cat tests/api.log || true
|
||||
|
||||
- name: Upload failure logs
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wolfssh-${{ matrix.name }}-logs
|
||||
path: |
|
||||
test-suite.log
|
||||
config.log
|
||||
retention-days: 5
|
||||
|
|
@ -134,7 +134,7 @@
|
|||
|
||||
---
|
||||
|
||||
# wolfSSH v1.4.20 (Feburary 20, 2025)
|
||||
# wolfSSH v1.4.20 (February 20, 2025)
|
||||
|
||||
## New Features
|
||||
|
||||
|
|
@ -733,7 +733,7 @@
|
|||
|
||||
- Added DH Group Exchange with SHA-256 hashing to the key exchange.
|
||||
- Removed the canned banner and provided a function to set a banner string.
|
||||
If no sting is provided, no banner is sent.
|
||||
If no string is provided, no banner is sent.
|
||||
- Expanded the make checking to include an API test.
|
||||
- Added a function that returns session statistics.
|
||||
- When connecting to the echoserver, hitting Ctrl-E will give you some
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ dispatch_semaphore_t windowSem;
|
|||
static sem_t windowSem;
|
||||
#endif
|
||||
|
||||
/* capture window change signales */
|
||||
/* capture window change signals */
|
||||
static void WindowChangeSignal(int sig)
|
||||
{
|
||||
#if (defined(__OSX__) || defined(__APPLE__))
|
||||
|
|
@ -599,7 +599,7 @@ static int wolfSSH_AGENT_DefaultActions(WS_AgentCbAction action, void* vCtx)
|
|||
if (ret == WS_AGENT_SUCCESS) {
|
||||
WMEMSET(name, 0, sizeof(struct sockaddr_un));
|
||||
name->sun_family = AF_LOCAL;
|
||||
WSTRNCPY(name->sun_path, sockName, sizeof(name->sun_path));
|
||||
WSTRNCPY(name->sun_path, sockName, sizeof(name->sun_path) - 1);
|
||||
name->sun_path[sizeof(name->sun_path) - 1] = '\0';
|
||||
size = WSTRLEN(sockName) +
|
||||
offsetof(struct sockaddr_un, sun_path);
|
||||
|
|
@ -1046,7 +1046,7 @@ static THREAD_RETURN WOLFSSH_THREAD wolfSSH_Client(void* args)
|
|||
|
||||
#if !defined(SINGLE_THREADED) && !defined(WOLFSSL_NUCLEUS)
|
||||
#if 0
|
||||
if (keepOpen) /* set up for psuedo-terminal */
|
||||
if (keepOpen) /* set up for pseudo-terminal */
|
||||
ClientSetEcho(2);
|
||||
#endif
|
||||
|
||||
|
|
@ -1070,7 +1070,7 @@ static THREAD_RETURN WOLFSSH_THREAD wolfSSH_Client(void* args)
|
|||
int err;
|
||||
|
||||
/* exec command does not contain initial terminal size,
|
||||
* unlike pty-req. Send an inital terminal size for recieving
|
||||
* unlike pty-req. Send an initial terminal size for receiving
|
||||
* the results of the command */
|
||||
err = sendCurrentWindowSize(&arg);
|
||||
if (err != WS_SUCCESS) {
|
||||
|
|
@ -1117,7 +1117,7 @@ static THREAD_RETURN WOLFSSH_THREAD wolfSSH_Client(void* args)
|
|||
int err;
|
||||
|
||||
/* exec command does not contain initial terminal size,
|
||||
* unlike pty-req. Send an inital terminal size for recieving
|
||||
* unlike pty-req. Send an initial terminal size for receiving
|
||||
* the results of the command */
|
||||
err = sendCurrentWindowSize(&arg);
|
||||
if (err != WS_SUCCESS) {
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ struct WOLFSSHD_AUTH {
|
|||
#endif
|
||||
|
||||
#if 0
|
||||
/* this could potentially be useful in a deeply embeded future port */
|
||||
/* this could potentially be useful in a deeply embedded future port */
|
||||
|
||||
/* Map user names to passwords */
|
||||
/* 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
|
|||
wolfSSH_Log(WS_LOG_ERROR,
|
||||
"[SSHD] Error getting user password info");
|
||||
wolfSSH_Log(WS_LOG_ERROR,
|
||||
"[SSHD] Possibly permisions level error?"
|
||||
"[SSHD] Possibly permissions level error?"
|
||||
" i.e SSHD not ran as sudo");
|
||||
ret = WS_FATAL_ERROR;
|
||||
}
|
||||
|
|
@ -1049,7 +1049,7 @@ static int DoCheckUser(const char* usr, WOLFSSHD_AUTH* auth)
|
|||
|
||||
if (wolfSSHD_ConfigGetPermitRoot(auth->conf) == 0) {
|
||||
if (XSTRCMP(usr, "root") == 0) {
|
||||
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Login as root not permited");
|
||||
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Login as root not permitted");
|
||||
ret = WOLFSSH_USERAUTH_REJECTED;
|
||||
}
|
||||
}
|
||||
|
|
@ -1075,7 +1075,7 @@ static int DoCheckUser(const char* usr, WOLFSSHD_AUTH* auth)
|
|||
|
||||
|
||||
/* @TODO this will take in a pipe or equivalent to talk to a privileged thread
|
||||
* rathar than having WOLFSSHD_AUTH directly with privilege separation */
|
||||
* rather than having WOLFSSHD_AUTH directly with privilege separation */
|
||||
static int RequestAuthentication(WS_UserAuthData* authData,
|
||||
WOLFSSHD_AUTH* authCtx)
|
||||
{
|
||||
|
|
@ -1423,7 +1423,7 @@ static int SetDefualtUserID(WOLFSSHD_AUTH* auth)
|
|||
|
||||
|
||||
/* Sets the default functions to be used for authentication of peer.
|
||||
* Later the default functions could be overriden if needed.
|
||||
* Later the default functions could be overridden if needed.
|
||||
* returns a newly created WOLFSSHD_AUTH struct success */
|
||||
WOLFSSHD_AUTH* wolfSSHD_AuthCreateUser(void* heap, const WOLFSSHD_CONFIG* conf)
|
||||
{
|
||||
|
|
@ -1501,12 +1501,12 @@ int wolfSSHD_AuthRaisePermissions(WOLFSSHD_AUTH* auth)
|
|||
#ifndef WIN32
|
||||
if (auth) {
|
||||
if (setegid(auth->sGid) != 0) {
|
||||
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Error rasing gid");
|
||||
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Error raising gid");
|
||||
ret = WS_FATAL_ERROR;
|
||||
}
|
||||
|
||||
if (seteuid(auth->sUid) != 0) {
|
||||
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Error rasing uid");
|
||||
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Error raising uid");
|
||||
ret = WS_FATAL_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -898,7 +898,7 @@ static int HandleMatch(WOLFSSHD_CONFIG** conf, const char* value, int valueSz)
|
|||
&newConf->groupAppliesTo);
|
||||
}
|
||||
|
||||
/* @TODO handle , seperated user/group list */
|
||||
/* @TODO handle , separated user/group list */
|
||||
|
||||
/* update current config being processed */
|
||||
if (ret == WS_SUCCESS) {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ typedef struct WOLFSSHD_CONFIG WOLFSSHD_CONFIG;
|
|||
|
||||
#include "auth.h"
|
||||
|
||||
/* 0 so that privilage seperation is default on after struct memset'd on init */
|
||||
/* 0 so that privilege separation is default on after struct memset'd on init */
|
||||
#define WOLFSSHD_PRIV_SEPARAT 0
|
||||
#define WOLFSSHD_PRIV_SANDBOX 1
|
||||
#define WOLFSSHD_PRIV_OFF 2
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# wolfSSHd Tests
|
||||
|
||||
These are seprate from the tests in scripts directory because of the need for
|
||||
These are separate from the tests in scripts directory because of the need for
|
||||
'sudo' when starting up an SSHd server to test against.
|
||||
|
||||
## Running Tests
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ else
|
|||
#run_test "error_return.sh"
|
||||
#run_test "sshd_login_grace_test.sh"
|
||||
|
||||
# add aditional tests here, check on var USING_LOCAL_HOST if can make sshd
|
||||
# add additional tests here, check on var USING_LOCAL_HOST if can make sshd
|
||||
# server start/restart with changes
|
||||
|
||||
if [ "$USING_LOCAL_HOST" == 1 ]; then
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ HAVE_P521=$SUPPORTED
|
|||
printf "\n"
|
||||
|
||||
|
||||
# Looks through the variable OUTPUT for the block of text containg the server
|
||||
# Looks through the variable OUTPUT for the block of text containing the server
|
||||
# host key algorithms sent.
|
||||
find_substring_of_algos() {
|
||||
# Extract the substring between start and end lines
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ static void ShowUsage(void)
|
|||
}
|
||||
|
||||
|
||||
/* catch if interupted */
|
||||
/* catch if interrupted */
|
||||
static void interruptCatch(int in)
|
||||
{
|
||||
(void)in;
|
||||
|
|
@ -1148,7 +1148,7 @@ static int SHELL_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh,
|
|||
|
||||
if (wolfSSH_SetExitStatus(ssh, processState) !=
|
||||
WS_SUCCESS) {
|
||||
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Issue sending childs exit "
|
||||
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Issue sending child's exit "
|
||||
"status");
|
||||
}
|
||||
|
||||
|
|
@ -1739,17 +1739,17 @@ static int SHELL_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh,
|
|||
|
||||
do {
|
||||
rc = waitpid(childPid, &waitStatus, 0);
|
||||
/* if the waitpid experinced an interupt then try again */
|
||||
/* if the waitpid experienced an interrupt then try again */
|
||||
} while (rc < 0 && errno == EINTR);
|
||||
|
||||
if (rc < 0) {
|
||||
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Issue waiting for childs exit "
|
||||
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Issue waiting for child's exit "
|
||||
"status");
|
||||
}
|
||||
else {
|
||||
if (wolfSSH_SetExitStatus(ssh, (word32)WEXITSTATUS(waitStatus)) !=
|
||||
WS_SUCCESS) {
|
||||
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Issue setting childs exit "
|
||||
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Issue setting child's exit "
|
||||
"status");
|
||||
}
|
||||
}
|
||||
|
|
@ -2026,7 +2026,7 @@ static void* HandleConnection(void* arg)
|
|||
ret = wolfSSH_worker(ssh, NULL);
|
||||
error = wolfSSH_get_error(ssh);
|
||||
|
||||
/* peer succesfully closed down gracefully */
|
||||
/* peer successfully closed down gracefully */
|
||||
if (ret == WS_CHANNEL_CLOSED) {
|
||||
ret = 0;
|
||||
break;
|
||||
|
|
@ -2052,7 +2052,7 @@ static void* HandleConnection(void* arg)
|
|||
|
||||
if (attempt == maxAttempt) {
|
||||
wolfSSH_Log(WS_LOG_INFO,
|
||||
"[SSHD] Gave up on gracefull shutdown, closing the socket");
|
||||
"[SSHD] Gave up on graceful shutdown, closing the socket");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2155,7 +2155,7 @@ static int PendingConnection(WS_SOCKET_T fd)
|
|||
errno = 0;
|
||||
ret = select((int)nfds, &r, &w, &e, &t);
|
||||
if (ret < 0) {
|
||||
/* a socket level issue happend, could just be a system call int. */
|
||||
/* a socket level issue happened, could just be a system call int. */
|
||||
if (errno != EINTR) {
|
||||
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] TCP socket error on select()");
|
||||
quit = 1;
|
||||
|
|
@ -2792,7 +2792,7 @@ static int SetupConsole(char* inCmd)
|
|||
WaitForInputIdle(processInfo.hProcess, 1000);
|
||||
|
||||
do {
|
||||
/* wait indefinitly for console process to exit */
|
||||
/* wait indefinitely for console process to exit */
|
||||
if (ava == 0) {
|
||||
if (WaitForSingleObject(processInfo.hProcess, INFINITE) == WAIT_FAILED) {
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ static void ShowUsage(void)
|
|||
printf(" -N use non-blocking sockets\n");
|
||||
#endif
|
||||
#ifdef WOLFSSH_TERM
|
||||
printf(" -t use psuedo terminal\n");
|
||||
printf(" -t use pseudo terminal\n");
|
||||
#endif
|
||||
#if !defined(SINGLE_THREADED) && !defined(WOLFSSL_NUCLEUS)
|
||||
printf(" -c <command> executes remote command and pipe stdin/stdout\n");
|
||||
|
|
@ -248,7 +248,7 @@ dispatch_semaphore_t windowSem;
|
|||
static sem_t windowSem;
|
||||
#endif
|
||||
|
||||
/* capture window change signales */
|
||||
/* capture window change signals */
|
||||
static void WindowChangeSignal(int sig)
|
||||
{
|
||||
#if (defined(__OSX__) || defined(__APPLE__))
|
||||
|
|
@ -572,7 +572,7 @@ static int wolfSSH_AGENT_DefaultActions(WS_AgentCbAction action, void* vCtx)
|
|||
if (ret == WS_AGENT_SUCCESS) {
|
||||
WMEMSET(name, 0, sizeof(struct sockaddr_un));
|
||||
name->sun_family = AF_LOCAL;
|
||||
strncpy(name->sun_path, sockName, sizeof(name->sun_path));
|
||||
strncpy(name->sun_path, sockName, sizeof(name->sun_path) - 1);
|
||||
name->sun_path[sizeof(name->sun_path) - 1] = '\0';
|
||||
size = strlen(sockName) +
|
||||
offsetof(struct sockaddr_un, sun_path);
|
||||
|
|
@ -1020,7 +1020,7 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
|
|||
|
||||
#if !defined(SINGLE_THREADED) && !defined(WOLFSSL_NUCLEUS) && \
|
||||
defined(WOLFSSH_TERM) && !defined(NO_FILESYSTEM)
|
||||
if (keepOpen) /* set up for psuedo-terminal */
|
||||
if (keepOpen) /* set up for pseudo-terminal */
|
||||
ClientSetEcho(2);
|
||||
|
||||
if (cmd != NULL || keepOpen == 1) {
|
||||
|
|
@ -1042,7 +1042,7 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
|
|||
int err;
|
||||
|
||||
/* exec command does not contain initial terminal size, unlike pty-req.
|
||||
* Send an inital terminal size for recieving the results of the command */
|
||||
* Send an initial terminal size for receiving the results of the command */
|
||||
err = sendCurrentWindowSize(&arg);
|
||||
if (err != WS_SUCCESS) {
|
||||
fprintf(stderr, "Issue sending exec initial terminal size\n\r");
|
||||
|
|
@ -1085,7 +1085,7 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
|
|||
int err;
|
||||
|
||||
/* exec command does not contain initial terminal size, unlike pty-req.
|
||||
* Send an inital terminal size for recieving the results of the command */
|
||||
* Send an initial terminal size for receiving the results of the command */
|
||||
err = sendCurrentWindowSize(&arg);
|
||||
if (err != WS_SUCCESS) {
|
||||
fprintf(stderr, "Issue sending exec initial terminal size\n\r");
|
||||
|
|
|
|||
|
|
@ -676,7 +676,7 @@ static int termios_show(int fd)
|
|||
typedef WOLFSSL_HEAP_HINT ES_HEAP_HINT;
|
||||
|
||||
/* This static buffer is tuned for building with SFTP only. The static
|
||||
* buffer size is calulated by multiplying the pairs of sizeList items
|
||||
* buffer size is calculated by multiplying the pairs of sizeList items
|
||||
* and distList items and summing (32*64 + 128*118 + ...) and adding
|
||||
* the sum of the distList values times the sizeof wc_Memory (rounded up
|
||||
* to a word, 24). This total was 288kb plus change, rounded up to 289. */
|
||||
|
|
@ -1598,7 +1598,7 @@ static THREAD_RETURN WOLFSSH_THREAD server_worker(void* vArgs)
|
|||
ret = wolfSSH_worker(threadCtx->ssh, NULL);
|
||||
error = wolfSSH_get_error(threadCtx->ssh);
|
||||
|
||||
/* peer succesfully closed down gracefully */
|
||||
/* peer successfully closed down gracefully */
|
||||
if (ret == WS_CHANNEL_CLOSED) {
|
||||
ret = 0;
|
||||
break;
|
||||
|
|
@ -1620,7 +1620,7 @@ static THREAD_RETURN WOLFSSH_THREAD server_worker(void* vArgs)
|
|||
}
|
||||
|
||||
if (attempt == maxAttempt) {
|
||||
printf("Gave up on gracefull shutdown, closing the socket\n");
|
||||
printf("Gave up on graceful shutdown, closing the socket\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2518,7 +2518,7 @@ static void ShowUsage(void)
|
|||
" add password to accept from peer\n");
|
||||
#ifdef WOLFSSH_KEYBOARD_INTERACTIVE
|
||||
printf(" -i <name>:<password>\n"
|
||||
" add passowrd to accept via keyboard-interactive "
|
||||
" add password to accept via keyboard-interactive "
|
||||
"from peer\n");
|
||||
#endif
|
||||
#ifdef WOLFSSH_CERTS
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ static char* workingDir;
|
|||
typedef WOLFSSL_HEAP_HINT SFTPC_HEAP_HINT;
|
||||
|
||||
/* This static buffer is tuned for building with SFTP only. The static
|
||||
* buffer size is calulated by multiplying the pairs of sizeList items
|
||||
* buffer size is calculated by multiplying the pairs of sizeList items
|
||||
* and distList items and summing (32*50 + 128*100 + ...) and adding
|
||||
* the sum of the distList values times the sizeof wc_Memory (rounded up
|
||||
* to a word, 24). This total was 268kb plus change, rounded up to 269. */
|
||||
|
|
@ -1527,7 +1527,7 @@ THREAD_RETURN WOLFSSH_THREAD sftpclient_test(void* args)
|
|||
}
|
||||
|
||||
if (attempt == maxAttempt) {
|
||||
printf("SFTP client gave up on gracefull shutdown,"
|
||||
printf("SFTP client gave up on graceful shutdown,"
|
||||
"closing the socket\n");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -373,6 +373,7 @@ static int PostLock(WOLFSSH_AGENT_CTX* agent,
|
|||
char pp[32];
|
||||
word32 ppSz;
|
||||
|
||||
(void)agent;
|
||||
WLOG(WS_LOG_AGENT, "Posting lock to agent %p", agent);
|
||||
WOLFSSH_UNUSED(agent);
|
||||
|
||||
|
|
@ -395,6 +396,7 @@ static int PostUnlock(WOLFSSH_AGENT_CTX* agent,
|
|||
char pp[32];
|
||||
word32 ppSz;
|
||||
|
||||
(void)agent;
|
||||
WLOG(WS_LOG_AGENT, "Posting unlock to agent %p", agent);
|
||||
WOLFSSH_UNUSED(agent);
|
||||
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ enum {
|
|||
#endif
|
||||
|
||||
/* if handling a chain it is expected to be the leaf cert first followed by
|
||||
* intermediates and CA last (CA may be ommited) */
|
||||
* intermediates and CA last (CA may be omitted) */
|
||||
int wolfSSH_CERTMAN_VerifyCerts_buffer(WOLFSSH_CERTMAN* cm,
|
||||
const unsigned char* certs, word32 certSz, word32 certsCount)
|
||||
{
|
||||
|
|
@ -310,7 +310,7 @@ int wolfSSH_CERTMAN_VerifyCerts_buffer(WOLFSSH_CERTMAN* cm,
|
|||
|
||||
/* verified successfully, add intermideate as trusted */
|
||||
if (ret == WS_SUCCESS && certIdx > 0) {
|
||||
WLOG(WS_LOG_CERTMAN, "adding intermidiate cert as trusted");
|
||||
WLOG(WS_LOG_CERTMAN, "adding intermediate cert as trusted");
|
||||
ret = wolfSSH_CERTMAN_LoadRootCA_buffer(cm, certLoc[certIdx],
|
||||
certLen[certIdx]);
|
||||
}
|
||||
|
|
@ -392,7 +392,7 @@ static int CheckProfile(DecodedCert* cert, int profile)
|
|||
if (valid) {
|
||||
valid = WSTRCMP(cert->countryOfCitizenship, "US") == 0;
|
||||
if (valid != 1)
|
||||
WLOG(WS_LOG_CERTMAN, "cert contry of citizenship invalid");
|
||||
WLOG(WS_LOG_CERTMAN, "cert country of citizenship invalid");
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
|
|
@ -493,12 +493,12 @@ static int CheckProfile(DecodedCert* cert, int profile)
|
|||
/* all must have UUID and worksheet 6 must have FASC-N in addition to
|
||||
* UUID */
|
||||
if (profile == PROFILE_FPKI_WORKSHEET_6 && hasFascN == 0) {
|
||||
WLOG(WS_LOG_CERTMAN, "cert did not inclue a FASC-N");
|
||||
WLOG(WS_LOG_CERTMAN, "cert did not include a FASC-N");
|
||||
valid = 0;
|
||||
}
|
||||
|
||||
if (valid && hasUUID == 0) {
|
||||
WLOG(WS_LOG_CERTMAN, "cert did not inclue a UUID");
|
||||
WLOG(WS_LOG_CERTMAN, "cert did not include a UUID");
|
||||
valid = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -513,7 +513,7 @@ static int CheckProfile(DecodedCert* cert, int profile)
|
|||
((cert->extExtKeyUsageSsh & extKeyUsageSsh)
|
||||
== extKeyUsageSsh));
|
||||
if (valid != 1) {
|
||||
WLOG(WS_LOG_CERTMAN, "cert did not inclue all ext. key usage");
|
||||
WLOG(WS_LOG_CERTMAN, "cert did not include all ext. key usage");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -688,7 +688,7 @@ INLINE static int IsMessageAllowedServer(WOLFSSH *ssh, byte msg)
|
|||
* it should not accept the other user auth messages, it sends
|
||||
* them. (>50) */
|
||||
/* Explicitly check for messages not allowed before user
|
||||
* authentication has comleted. */
|
||||
* authentication has completed. */
|
||||
if (MSGIDLIMIT_POST_USERAUTH(msg)) {
|
||||
WLOG(WS_LOG_DEBUG, "Message ID %u not allowed by %s %s",
|
||||
msg, "server", "before user authentication is complete");
|
||||
|
|
@ -3809,7 +3809,7 @@ static int GetNameList(byte* idList, word32* idListSz,
|
|||
|
||||
/*
|
||||
* This iterates across a name list and finds names that end in either the
|
||||
* comma delimeter or with the end of the list.
|
||||
* comma delimiter or with the end of the list.
|
||||
*/
|
||||
|
||||
if (ret == WS_SUCCESS) {
|
||||
|
|
@ -8938,7 +8938,7 @@ int wolfSSH_DoModes(const byte* modes, word32 modesSz, int fd)
|
|||
* Modes is a list of opcode-argument pairs. The opcodes are
|
||||
* bytes and the arguments are uint32s. TTY_OP_END is an opcode
|
||||
* that terminates the list. Of course, it isn't clear if
|
||||
* TTY_OP_END has an arguement or note. The RFC doesn't say,
|
||||
* TTY_OP_END has an argument or not. The RFC doesn't say,
|
||||
* but in operation it usually doesn't. Allow for an odd single
|
||||
* byte left over.
|
||||
*/
|
||||
|
|
@ -10975,7 +10975,7 @@ struct wolfSSH_sigKeyBlockFull {
|
|||
|
||||
#ifdef WOLFSSH_CERTS
|
||||
/* places RFC6187 style cert + ocsp into output buffer and advances idx
|
||||
* [size of stiring] [string] [cert count] [cert size] [cert] [...]
|
||||
* [size of string] [string] [cert count] [cert size] [cert] [...]
|
||||
* [ocsp count] [ocsp size] [ocsp] [...]
|
||||
* returns WS_SUCCESS on success
|
||||
* returns LENGTH_ONLY_E if output is null, and updates outputSz with required
|
||||
|
|
@ -12403,7 +12403,7 @@ static int SignH(WOLFSSH* ssh, byte* sig, word32* sigSz,
|
|||
|
||||
|
||||
/* SendKexDhReply()
|
||||
* It is also the funciton used for MSGID_KEXECDH_REPLY. The parameters
|
||||
* It is also the function used for MSGID_KEXECDH_REPLY. The parameters
|
||||
* are analogous between the two messages. Where MSGID_KEXDH_REPLY has
|
||||
* server's public host key (K_S), f, and the signature of H;
|
||||
* MSGID_KEXECDH_REPLY has K_S, the server'e ephemeral public key (Q_S),
|
||||
|
|
@ -15349,14 +15349,14 @@ int SendUserAuthKeyboardResponse(WOLFSSH* ssh)
|
|||
authData.usernameSz = ssh->userNameSz;
|
||||
authData.sf.keyboard.promptCount = ssh->kbAuth.promptCount;
|
||||
authData.sf.keyboard.promptName = ssh->kbAuth.promptName;
|
||||
authData.sf.keyboard.promptNameSz =
|
||||
(word32)WSTRLEN((char*)ssh->kbAuth.promptName);
|
||||
authData.sf.keyboard.promptNameSz = ssh->kbAuth.promptName ?
|
||||
(word32)WSTRLEN((char*)ssh->kbAuth.promptName) : 0;
|
||||
authData.sf.keyboard.promptInstruction = ssh->kbAuth.promptInstruction;
|
||||
authData.sf.keyboard.promptInstructionSz =
|
||||
(word32)WSTRLEN((char*)ssh->kbAuth.promptInstruction);
|
||||
authData.sf.keyboard.promptInstructionSz = ssh->kbAuth.promptInstruction ?
|
||||
(word32)WSTRLEN((char*)ssh->kbAuth.promptInstruction) : 0;
|
||||
authData.sf.keyboard.promptLanguage = ssh->kbAuth.promptLanguage;
|
||||
authData.sf.keyboard.promptLanguageSz =
|
||||
(word32)WSTRLEN((char*)ssh->kbAuth.promptLanguage);
|
||||
authData.sf.keyboard.promptLanguageSz = ssh->kbAuth.promptLanguage ?
|
||||
(word32)WSTRLEN((char*)ssh->kbAuth.promptLanguage) : 0;
|
||||
authData.sf.keyboard.prompts = ssh->kbAuth.prompts;
|
||||
authData.sf.keyboard.promptEcho = ssh->kbAuth.promptEcho;
|
||||
authData.sf.keyboard.responseCount = 0;
|
||||
|
|
@ -15673,7 +15673,7 @@ int SendUserAuthFailure(WOLFSSH* ssh, byte partialSuccess)
|
|||
if (ret == WS_SUCCESS) {
|
||||
authSz = GetAllowedAuth(ssh, authStr);
|
||||
if (authSz < 0) {
|
||||
ret = authSz; /* propogate error value */
|
||||
ret = authSz; /* propagate error value */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -17295,7 +17295,7 @@ int wolfSSH_CleanPath(WOLFSSH* ssh, char* in, int inSz)
|
|||
#endif
|
||||
sz = (long)WSTRLEN(path);
|
||||
|
||||
/* remove any /./ patterns, direcotries, exclude cases like ./ok./test */
|
||||
/* remove any /./ patterns, directories, exclude cases like ./ok./test */
|
||||
for (i = 1; i + 1 < sz; i++) {
|
||||
if (path[i] == '.' && path[i - 1] == WS_DELIM && path[i + 1] == WS_DELIM) {
|
||||
WMEMMOVE(path + (i-1), path + (i+1), sz - i);
|
||||
|
|
|
|||
|
|
@ -1026,7 +1026,7 @@ int wolfSSH_shutdown(WOLFSSH* ssh)
|
|||
ret = SendChannelEof(ssh, ssh->channelList->peerChannel);
|
||||
}
|
||||
|
||||
/* continue on success and in case where queing up send packets */
|
||||
/* continue on success and in case where queueing up send packets */
|
||||
if (ret == WS_SUCCESS ||
|
||||
(ret != WS_BAD_ARGUMENT && ssh->error == WS_WANT_WRITE)) {
|
||||
ret = SendChannelExit(ssh, ssh->channelList->peerChannel,
|
||||
|
|
@ -1037,7 +1037,7 @@ int wolfSSH_shutdown(WOLFSSH* ssh)
|
|||
#endif
|
||||
}
|
||||
|
||||
/* continue on success and in case where queing up send packets */
|
||||
/* continue on success and in case where queueing up send packets */
|
||||
if (ret == WS_SUCCESS ||
|
||||
(ret != WS_BAD_ARGUMENT && ssh->error == WS_WANT_WRITE))
|
||||
ret = SendChannelClose(ssh, ssh->channelList->peerChannel);
|
||||
|
|
@ -1150,7 +1150,7 @@ int wolfSSH_stream_read(WOLFSSH* ssh, byte* buf, word32 bufSz)
|
|||
WLOG(WS_LOG_DEBUG, " Stream read ava data %u", inputBuffer->length);
|
||||
while (inputBuffer->length - inputBuffer->idx == 0) {
|
||||
WLOG(WS_LOG_DEBUG,
|
||||
"Starting to recieve data at current index of %u",
|
||||
"Starting to receive data at current index of %u",
|
||||
inputBuffer->idx);
|
||||
ret = DoReceive(ssh);
|
||||
if (ssh->channelList == NULL || ssh->channelList->eofRxd)
|
||||
|
|
@ -2456,7 +2456,7 @@ int wolfSSH_CTX_UseCert_buffer(WOLFSSH_CTX* ctx,
|
|||
}
|
||||
|
||||
|
||||
/* Add a CA for verifiying the peer's certificate with.
|
||||
/* Add a CA for verifying the peer's certificate with.
|
||||
* returns WS_SUCCESS on success
|
||||
*/
|
||||
int wolfSSH_CTX_AddRootCert_buffer(WOLFSSH_CTX* ctx,
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ int DoScpSink(WOLFSSH* ssh)
|
|||
|
||||
if ( (ret = ReceiveScpMessage(ssh)) < WS_SUCCESS) {
|
||||
if (ret == WS_EOF) {
|
||||
ret = WS_SUCCESS; /* successfully recieved message */
|
||||
ret = WS_SUCCESS; /* successfully received message */
|
||||
ssh->scpState = SCP_DONE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1032,7 +1032,7 @@ static int GetScpFileName(WOLFSSH* ssh, byte* buf, word32 bufSz,
|
|||
*
|
||||
* T<modification_secs> 0 <access_secs> 0
|
||||
*
|
||||
* Places modifiation time in ssh->scpMTime and access time in
|
||||
* Places modification time in ssh->scpMTime and access time in
|
||||
* ssh->scpATime variables.
|
||||
*
|
||||
* buf - buffer containing size string
|
||||
|
|
@ -1606,7 +1606,7 @@ int ReceiveScpConfirmation(WOLFSSH* ssh)
|
|||
msg[0]);
|
||||
ret = WS_FATAL_ERROR;
|
||||
|
||||
/* SCP peer signaled a failure, propogate the error back
|
||||
/* SCP peer signaled a failure, propagate the error back
|
||||
* to the caller. If not set here WS_CHAN_RXD could be
|
||||
* returned. */
|
||||
ssh->error = ret;
|
||||
|
|
@ -1886,7 +1886,7 @@ static int SetTimestampInfo(const char* fileName, word64 mTime, word64 aTime)
|
|||
}
|
||||
|
||||
/* Default SCP receive callback, called by wolfSSH when application has called
|
||||
* wolfSSH_accept() and a new SCP request has been received for an incomming
|
||||
* wolfSSH_accept() and a new SCP request has been received for an incoming
|
||||
* file or directory.
|
||||
*
|
||||
* Handles accepting recursive directories by having wolfSSH tell the callback
|
||||
|
|
@ -1915,7 +1915,7 @@ static int SetTimestampInfo(const char* fileName, word64 mTime, word64 aTime)
|
|||
*
|
||||
* ssh - pointer to active WOLFSSH session
|
||||
* state - current state of operation, can be one of:
|
||||
* WOLFSSH_SCP_NEW_FILE - new incomming file, no data yet, but size
|
||||
* WOLFSSH_SCP_NEW_FILE - new incoming file, no data yet, but size
|
||||
* and name
|
||||
* WOLFSSH_SCP_FILE_PART - new file data, or continuation of
|
||||
* existing file
|
||||
|
|
@ -1923,15 +1923,15 @@ static int SetTimestampInfo(const char* fileName, word64 mTime, word64 aTime)
|
|||
* WOLFSSH_SCP_NEW_DIR - indicates new directory, name in fileName
|
||||
* WOLFSSH_SCP_END_DIR - indicates leaving directory, up recursively
|
||||
* basePath - base directory path peer is requesting that file be written to
|
||||
* fileName - name of incomming file or directory
|
||||
* fileMode - mode/permission of incomming file or directory
|
||||
* fileName - name of incoming file or directory
|
||||
* fileMode - mode/permission of incoming file or directory
|
||||
* mTime - file modification time, if sent by peer in seconds since
|
||||
* Unix epoch (00:00:00 UTC, Jan. 1, 1970). mTime is 0 if
|
||||
* peer did not send time value.
|
||||
* aTime - file access time, if sent by peer in seconds since Unix
|
||||
* epoch (00:00:00 UTC, Jan. 1, 1970). aTime is 0 if peer did
|
||||
* not send time value.
|
||||
* totalFileSz - total size of incomming file (directory size may list zero)
|
||||
* totalFileSz - total size of incoming file (directory size may list zero)
|
||||
* buf - file or file chunk
|
||||
* bufSz - size of buf, bytes
|
||||
* fileOffset - offset into total file size, where buf should be placed
|
||||
|
|
@ -2141,7 +2141,7 @@ int wsScpRecvCallback(WOLFSSH* ssh, int state, const char* basePath,
|
|||
#else
|
||||
if (WCHDIR(ssh->fs, fileName) != 0) {
|
||||
WLOG(WS_LOG_ERROR,
|
||||
"scp: unable to cd into direcotry, abort");
|
||||
"scp: unable to cd into directory, abort");
|
||||
wolfSSH_SetScpErrorMsg(ssh, "unable to cd into directory");
|
||||
ret = WS_SCP_ABORT;
|
||||
}
|
||||
|
|
@ -2158,7 +2158,7 @@ int wsScpRecvCallback(WOLFSSH* ssh, int state, const char* basePath,
|
|||
#else
|
||||
if (WCHDIR(ssh->fs, "..") != 0) {
|
||||
WLOG(WS_LOG_ERROR,
|
||||
"scp: unable to cd out of direcotry, abort");
|
||||
"scp: unable to cd out of directory, abort");
|
||||
wolfSSH_SetScpErrorMsg(ssh, "unable to cd out of directory");
|
||||
ret = WS_SCP_ABORT;
|
||||
}
|
||||
|
|
@ -2606,7 +2606,7 @@ static int ScpProcessEntry(WOLFSSH* ssh, char* fileName, word64* mTime,
|
|||
|
||||
} else if (ScpFileIsFile(sendCtx)) {
|
||||
if (WFOPEN(ssh->fs, &(sendCtx->fp), filePath, "rb") != 0) {
|
||||
WLOG(WS_LOG_ERROR, "scp: Error with oepning file, abort");
|
||||
WLOG(WS_LOG_ERROR, "scp: Error with opening file, abort");
|
||||
wolfSSH_SetScpErrorMsg(ssh, "unable to open file "
|
||||
"for reading");
|
||||
ret = WS_SCP_ABORT;
|
||||
|
|
|
|||
|
|
@ -2640,7 +2640,7 @@ int wolfSSH_SFTP_RecvOpenDir(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz)
|
|||
#define WS_DATE_SIZE 12
|
||||
|
||||
#if defined(XGMTIME) && defined(XSNPRINTF)
|
||||
/* converts epoch time to recommended calender time from
|
||||
/* converts epoch time to recommended calendar time from
|
||||
* draft-ietf-secsh-filexfer-02.txt */
|
||||
static void getDate(char* buf, int len, struct tm* t)
|
||||
{
|
||||
|
|
@ -3250,7 +3250,7 @@ static int wolfSSH_SFTPNAME_readdir(WOLFSSH* ssh, WDIR* dir, WS_SFTPNAME* out,
|
|||
stat.fname[0] == '\0') {
|
||||
return WS_FATAL_ERROR;
|
||||
}
|
||||
WLOG(WS_LOG_SFTP, "READ dir got nam %s", stat.fname);
|
||||
WLOG(WS_LOG_SFTP, "READ dir got name %s", stat.fname);
|
||||
|
||||
sz = (int)WSTRLEN(stat.fname);
|
||||
out->fName = (char*)WMALLOC(sz + 1, out->heap, DYNTYPE_SFTP);
|
||||
|
|
@ -4547,7 +4547,7 @@ static word32 TimeTo32(word16 d, word16 t)
|
|||
#endif /* NO_WOLFSSH_MKTIME */
|
||||
|
||||
|
||||
/* @TODO can be overriden by user for portability
|
||||
/* @TODO can be overridden by user for portability
|
||||
* NOTE: if atr->flags is set to a value of 0 then no attributes are set.
|
||||
* Fills out a WS_SFTP_FILEATRB structure
|
||||
* returns WS_SUCCESS on success
|
||||
|
|
@ -4623,7 +4623,7 @@ int SFTP_GetAttributes(void* fs, const char* fileName, WS_SFTP_FILEATRB* atr,
|
|||
}
|
||||
|
||||
|
||||
/* @TODO can be overriden by user for portability
|
||||
/* @TODO can be overridden by user for portability
|
||||
* Gets attributes based on file descriptor
|
||||
* NOTE: if atr->flags is set to a value of 0 then no attributes are set.
|
||||
* Fills out a WS_SFTP_FILEATRB structure
|
||||
|
|
@ -4680,7 +4680,7 @@ int SFTP_GetAttributes_Handle(WOLFSSH* ssh, byte* handle, int handleSz,
|
|||
|
||||
#elif defined(USE_WINDOWS_API)
|
||||
|
||||
/* @TODO can be overriden by user for portability
|
||||
/* @TODO can be overridden by user for portability
|
||||
* NOTE: if atr->flags is set to a value of 0 then no attributes are set.
|
||||
* Fills out a WS_SFTP_FILEATRB structure
|
||||
* returns WS_SUCCESS on success
|
||||
|
|
@ -4727,7 +4727,7 @@ int SFTP_GetAttributes(void* fs, const char* fileName, WS_SFTP_FILEATRB* atr,
|
|||
|
||||
#elif defined(FREESCALE_MQX)
|
||||
|
||||
/* @TODO can be overriden by user for portability
|
||||
/* @TODO can be overridden by user for portability
|
||||
* NOTE: if atr->flags is set to a value of 0 then no attributes are set.
|
||||
* Fills out a WS_SFTP_FILEATRB structure
|
||||
* returns WS_SUCCESS on success */
|
||||
|
|
@ -4786,7 +4786,7 @@ int SFTP_GetAttributes(void* fs, const char* fileName, WS_SFTP_FILEATRB* atr,
|
|||
return WS_SUCCESS;
|
||||
}
|
||||
|
||||
/* @TODO can be overriden by user for portability
|
||||
/* @TODO can be overridden by user for portability
|
||||
* Gets attributes based on file descriptor
|
||||
* NOTE: if atr->flags is set to a value of 0 then no attributes are set.
|
||||
* Fills out a WS_SFTP_FILEATRB structure
|
||||
|
|
@ -5069,7 +5069,7 @@ static int SFTP_GetAttributesHelper(WS_SFTP_FILEATRB* atr, const char* fName)
|
|||
}
|
||||
|
||||
|
||||
/* @TODO can be overriden by user for portability
|
||||
/* @TODO can be overridden by user for portability
|
||||
* NOTE: if atr->flags is set to a value of 0 then no attributes are set.
|
||||
* Fills out a WS_SFTP_FILEATRB structure
|
||||
* returns WS_SUCCESS on success
|
||||
|
|
@ -5084,7 +5084,7 @@ int SFTP_GetAttributes(void* fs, const char* fileName, WS_SFTP_FILEATRB* atr,
|
|||
}
|
||||
|
||||
|
||||
/* @TODO can be overriden by user for portability
|
||||
/* @TODO can be overridden by user for portability
|
||||
* Gets attributes based on file descriptor
|
||||
* NOTE: if atr->flags is set to a value of 0 then no attributes are set.
|
||||
* Fills out a WS_SFTP_FILEATRB structure
|
||||
|
|
@ -5147,7 +5147,7 @@ int SFTP_GetAttributes(void* fs, const char* fileName, WS_SFTP_FILEATRB* atr,
|
|||
}
|
||||
|
||||
|
||||
/* @TODO can be overriden by user for portability
|
||||
/* @TODO can be overridden by user for portability
|
||||
* Gets attributes based on file descriptor
|
||||
* NOTE: if atr->flags is set to a value of 0 then no attributes are set.
|
||||
* Fills out a WS_SFTP_FILEATRB structure
|
||||
|
|
@ -6361,7 +6361,7 @@ int SFTP_ParseAtributes(WOLFSSH* ssh, WS_SFTP_FILEATRB* atr)
|
|||
* for count times:
|
||||
* string filename
|
||||
* string longname
|
||||
* ATTRS atributes
|
||||
* ATTRS attributes
|
||||
* }
|
||||
*
|
||||
* A pointer to a malloc'd WS_SFTPNAME list is returned on success and NULL is
|
||||
|
|
|
|||
|
|
@ -464,12 +464,12 @@ static int wolfSSH_DoControlSeq(WOLFSSH* ssh, WOLFSSH_HANDLE handle, byte* buf,
|
|||
}
|
||||
|
||||
switch (c) {
|
||||
case 'H': /* move curser to indicated row and column -1 to account
|
||||
case 'H': /* move cursor to indicated row and column -1 to account
|
||||
* for 1,1 on linux vs 0,0 on windows */
|
||||
wolfSSH_CursorMove(handle, args[1] - OFST, args[0] - OFST, 1);
|
||||
break;
|
||||
|
||||
case 'C': /* move curser right */
|
||||
case 'C': /* move cursor right */
|
||||
wolfSSH_CursorMove(handle, args[0], 0, 0);
|
||||
break;
|
||||
|
||||
|
|
|
|||
17
tests/api.c
17
tests/api.c
|
|
@ -1115,7 +1115,7 @@ static int sftpUserAuth(byte authType, WS_UserAuthData* authData, void* ctx)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* preforms connection to port, sets WOLFSSH_CTX and WOLFSSH on success
|
||||
/* performs connection to port, sets WOLFSSH_CTX and WOLFSSH on success
|
||||
* caller needs to free ctx and ssh when done
|
||||
*/
|
||||
static void sftp_client_connect(WOLFSSH_CTX** ctx, WOLFSSH** ssh, int port)
|
||||
|
|
@ -1240,7 +1240,12 @@ static void test_wolfSSH_SFTP_SendReadPacket(void)
|
|||
}
|
||||
|
||||
if (tmp != NULL) {
|
||||
out = (byte*)malloc(tmp->atrb.sz[0]);
|
||||
/* Allocate buffer large enough for maximum read size */
|
||||
word32 allocSz = tmp->atrb.sz[0];
|
||||
if (allocSz < WOLFSSH_MAX_SFTP_RW)
|
||||
allocSz = WOLFSSH_MAX_SFTP_RW;
|
||||
out = (byte*)malloc(allocSz);
|
||||
AssertNotNull(out);
|
||||
AssertIntEQ(wolfSSH_SFTP_Open(ssh, tmp->fName, WOLFSSH_FXF_READ,
|
||||
NULL, handle, &handleSz), WS_SUCCESS);
|
||||
|
||||
|
|
@ -1281,8 +1286,8 @@ static void test_wolfSSH_SFTP_SendReadPacket(void)
|
|||
|
||||
free(out);
|
||||
wolfSSH_SFTP_Close(ssh, handle, handleSz);
|
||||
wolfSSH_SFTPNAME_list_free(current);
|
||||
}
|
||||
wolfSSH_SFTPNAME_list_free(current);
|
||||
}
|
||||
|
||||
/* take care of re-keying state before shutdown call */
|
||||
|
|
@ -1804,12 +1809,14 @@ static word32 kbResponseLength = 4;
|
|||
|
||||
static int keyboardUserAuth(byte authType, WS_UserAuthData* authData, void* ctx)
|
||||
{
|
||||
(void) ctx;
|
||||
int ret = WOLFSSH_USERAUTH_INVALID_AUTHTYPE;
|
||||
|
||||
(void)ctx;
|
||||
|
||||
if (authType == WOLFSSH_USERAUTH_KEYBOARD) {
|
||||
AssertIntEQ(1, authData->sf.keyboard.promptCount);
|
||||
AssertStrEQ("KB Auth Password: ", authData->sf.keyboard.prompts[0]);
|
||||
AssertStrEQ("KB Auth Password: ",
|
||||
(const char*)authData->sf.keyboard.prompts[0]);
|
||||
|
||||
authData->sf.keyboard.responseCount = 1;
|
||||
authData->sf.keyboard.responseLengths = &kbResponseLength;
|
||||
|
|
|
|||
|
|
@ -574,7 +574,7 @@ static void test_multi_prompt_KeyboardInteractive(void)
|
|||
|
||||
static void test_multi_round_KeyboardInteractive(void)
|
||||
{
|
||||
printf("Testing mutliple prompt rounds\n");
|
||||
printf("Testing multiple prompt rounds\n");
|
||||
kbResponses[0] = (byte*)testText1;
|
||||
kbResponseLengths[0] = 4;
|
||||
kbResponseCount = 1;
|
||||
|
|
|
|||
|
|
@ -742,7 +742,7 @@ struct WOLFSSH {
|
|||
byte highwaterFlag; /* Set when highwater CB called */
|
||||
void* highwaterCtx; /* Highwater CB context */
|
||||
void* globalReqCtx; /* Global Request CB context */
|
||||
void* reqSuccessCtx; /* Global Request Sucess CB context */
|
||||
void* reqSuccessCtx; /* Global Request Success CB context */
|
||||
void* reqFailureCtx; /* Global Request Failure CB context */
|
||||
void* channelOpenCtx; /* Channel Open CB context */
|
||||
void* channelReqCtx; /* Channel Request CB context */
|
||||
|
|
|
|||
|
|
@ -579,8 +579,16 @@ extern "C" {
|
|||
#endif
|
||||
#define WSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n))
|
||||
#define WSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
|
||||
/* suppress clang warning for GNU extension ##__VA_ARGS__ */
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
|
||||
#endif
|
||||
#define WSNPRINTF(s,n,f,...) snprintf((s),(n),(f),##__VA_ARGS__)
|
||||
#define WVSNPRINTF(s,n,f,...) vsnprintf((s),(n),(f),##__VA_ARGS__)
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#define WSTRTOK(s1,s2,s3) strtok_r((s1),(s2),(s3))
|
||||
#endif
|
||||
#endif /* WSTRING_USER */
|
||||
|
|
|
|||
Loading…
Reference in New Issue