Skip to content

Commit

Permalink
Merge pull request wolfSSL#635 from ejohnstown/release-v1.4.15
Browse files Browse the repository at this point in the history
Release v1.4.15
  • Loading branch information
douzzer authored Dec 22, 2023
2 parents 7f5f929 + 948b545 commit 51cce7b
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 26 deletions.
73 changes: 73 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,74 @@
# wolfSSH v1.4.15 (December 22, 2023)

## Vulnerabilities

* Fixes a potential vulnerability described in the paper "Passive SSH Key
Compromise via Lattices". While the misbehavior described hasn't
been observed in wolfSSH, the fix is now implemented. The RSA signature
is verified before sending to the peer.
- Keegan Ryan, Kaiwen He, George Arnold Sullivan, and Nadia Heninger. 2023.
Passive SSH Key Compormise via Lattices. Cryptology ePrint Archive,
Report 2023/1711. https://eprint.iacr.org/2023/1711.

## Notes

* When building wolfSSL/wolfCrypt versions before v5.6.6 with CMake,
wolfSSH may have a problem with RSA keys. This is due to wolfSSH not
checking on the size of `___uint128_t`. wolfSSH sees the RSA structure
as the wrong size. You will have to define `HAVE___UINT128_T` if you
know you have it and are using it in wolfSSL. wolfSSL v5.6.6 exports that
define in options.h when using CMake.

## New Features

* Added wolfSSH client application.
* Added support for OpenSSH-style private keys, like those made by ssh-keygen.
* Added support for the Zephyr RTOS.
* Added support for multiple authentication schemes in the userauth callback
with the error response `WOLFSSH_USERAUTH_PARTIAL_SUCCESS`.

## Improvements

* Allow override of default sshd user name at build.
* Do not attempt to copy device files. The client won't ask, and the server
won't do it.
* More wolfSSHd testing.
* Portability updates.
* Terminal updates for shell connections to wolfSSHd, including window size
updates.
* QNX support updates.
* Windows file support updates for SFTP and SCP.
* Allow for longer command strings in wolfSSHd.
* Tweaked some select timeouts in the echoserver.
* Add some type size checks to configure.
* Update for changes in wolfSSL's threading wrappers.
* Updates for Espressif support and testing.
* Speed improvements for SFTP. (Fixed unnecessary waiting.)
* Windows wolfSSHd improvements.
* The functions `wolfSSH_ReadKey_file()` and `wolfSSH_ReadKey_buffer()`
handles more encodings.
* Add function to supply new protocol ID string.
* Support larger RSA keys.
* MinGW support updates.
* Update file use W-macro wrappers with a filesystem parameter.

## Fixes

* When setting the file permissions for a file in Zephyr, use the correct
permission constants.
* Fix buffer issue in `DoReceive()` on some edge failure conditions.
* Prevent wolfSSHd zombie processes.
* Fixed a few references to the heap variable for user supplied memory
allocation functions.
* Fixed an index update when verifying the server's RSA signature during KEX.
* Fixed some of the guards around optional code.
* Fixed some would-block cases when using non-blocking sockets in the
examples.
* Fixed some compile issues with liboqs.
* Fix for interop issue with OpenSSH when using AES-CTR.

---

# wolfSSH v1.4.14 (July 7, 2023)

## New Feature Additions and Improvements
Expand All @@ -22,6 +93,8 @@
- Fix for support with secondary groups with wolfSSHd
- Fixes for SFTP edge cases when used with LWiP

---

# wolfSSH v1.4.13 (Apr 3, 2023)

## New Feature Additions and Improvements
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,3 +497,9 @@ john-cert.der would be:

$ ./examples/client/client -u john -J ./keys/john-cert.der -i ./keys/john-key.der


WOLFSSH APPLICATIONS
====================

wolfSSH comes with a server daemon and a command line shell tool. Check out
the apps directory for more information.
3 changes: 3 additions & 0 deletions apps/wolfsshd/configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
#ifdef WIN32
#include <process.h>
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif

struct WOLFSSHD_CONFIG {
void* heap;
Expand Down
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# All right reserved.

AC_COPYRIGHT([Copyright (C) 2014-2023 wolfSSL Inc.])
AC_INIT([wolfssh],[1.4.14],[[email protected]],[wolfssh],[https://www.wolfssl.com])
AC_INIT([wolfssh],[1.4.15],[[email protected]],[wolfssh],[https://www.wolfssl.com])
AC_PREREQ([2.63])
AC_CONFIG_AUX_DIR([build-aux])

Expand All @@ -18,7 +18,7 @@ AC_ARG_PROGRAM
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])

WOLFSSH_LIBRARY_VERSION=15:1:7
WOLFSSH_LIBRARY_VERSION=15:2:7
# | | |
# +------+ | +---+
# | | |
Expand Down Expand Up @@ -55,7 +55,7 @@ AC_TYPE_UINT8_T
AC_TYPE_UINTPTR_T

# Check headers/libs
AC_CHECK_HEADERS([sys/select.h sys/time.h sys/ioctl.h pty.h util.h termios.h])
AC_CHECK_HEADERS([limits.h sys/select.h sys/time.h sys/ioctl.h pty.h util.h termios.h])
AC_CHECK_LIB([network],[socket])
AC_CHECK_LIB([util],[forkpty])

Expand Down
22 changes: 11 additions & 11 deletions examples/sftpclient/sftpclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,37 +714,37 @@ static int doCmds(func_args* args)
}

if ((pt = WSTRNSTR(msg, "chmod", MAX_CMD_SZ)) != NULL) {
int sz;
word32 sz, idx;
char* f = NULL;
char mode[WOLFSSH_MAX_OCTET_LEN];

pt += sizeof("chmod");
sz = (int)WSTRLEN(pt);
sz = (word32)WSTRLEN(pt);

if (pt[sz - 1] == '\n') pt[sz - 1] = '\0';

/* advance pointer to first location of non space character */
for (i = 0; i < sz && pt[0] == ' '; i++, pt++);
sz = (int)WSTRLEN(pt);
for (idx = 0; idx < sz && pt[0] == ' '; idx++, pt++);
sz = (word32)WSTRLEN(pt);

/* get mode */
sz = (sz < WOLFSSH_MAX_OCTET_LEN - 1)? sz :
WOLFSSH_MAX_OCTET_LEN -1;
WMEMCPY(mode, pt, sz);
mode[WOLFSSH_MAX_OCTET_LEN - 1] = '\0';
for (i = 0; i < sz; i++) {
if (mode[i] == ' ') {
mode[i] = '\0';
for (idx = 0; idx < sz; idx++) {
if (mode[idx] == ' ') {
mode[idx] = '\0';
break;
}
}
if (i == 0) {
if (idx == 0) {
printf("error with getting mode\r\n");
continue;
}
pt += (int)WSTRLEN(mode);
sz = (int)WSTRLEN(pt);
for (i = 0; i < sz && pt[0] == ' '; i++, pt++);
pt += (word32)WSTRLEN(mode);
sz = (word32)WSTRLEN(pt);
for (idx = 0; idx < sz && pt[0] == ' '; idx++, pt++);

if (pt[0] != '/') {
int maxSz = (int)WSTRLEN(workingDir) + sz + 2;
Expand Down
20 changes: 10 additions & 10 deletions src/wolfsftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2699,12 +2699,12 @@ static int wolfSSH_SFTPNAME_readdir(WOLFSSH* ssh, WDIR* dir, WS_SFTPNAME* out,
char s[WOLFSSH_MAX_FILENAME];

if (!special) { /* do not add dir name in special case */
if (WSTRLEN(dirName) + out->fSz + 2 > (sizeof r)) {
if (WSNPRINTF(r, sizeof(r), "%s/%s", dirName, out->fName)
>= (int)sizeof(r)) {
WLOG(WS_LOG_SFTP, "Path length too large");
WFREE(out->fName, out->heap, DYNTYPE_SFTP);
return WS_FATAL_ERROR;
}
WSNPRINTF(r, sizeof(r), "%s/%s", dirName, out->fName);
}
else {
if (out->fSz + 1 > (sizeof r)) {
Expand Down Expand Up @@ -2789,12 +2789,12 @@ static int wolfSSH_SFTPNAME_readdir(WOLFSSH* ssh, WDIR* dir, WS_SFTPNAME* out,
char r[WOLFSSH_MAX_FILENAME];
char s[WOLFSSH_MAX_FILENAME];

if ((WSTRLEN(dirName) + WSTRLEN(out->fName) + 2) > sizeof(r)) {
if (WSNPRINTF(r, sizeof(r), "%s/%s", dirName, out->fName)
>= (int)sizeof(r)) {
WLOG(WS_LOG_SFTP, "Path length too large");
WFREE(out->fName, out->heap, DYNTYPE_SFTP);
return WS_FATAL_ERROR;
}
WSNPRINTF(r, sizeof(r), "%s/%s", dirName, out->fName);

if (wolfSSH_RealPath(ssh->sftpDefaultPath, r, s, sizeof(s)) < 0) {
WLOG(WS_LOG_SFTP, "Error cleaning path to get attributes");
Expand Down Expand Up @@ -2954,12 +2954,12 @@ static int wolfSSH_SFTPNAME_readdir(WOLFSSH* ssh, WDIR* dir, WS_SFTPNAME* out,
char r[WOLFSSH_MAX_FILENAME];
char s[WOLFSSH_MAX_FILENAME];

if ((WSTRLEN(dirName) + WSTRLEN(out->fName) + 2) > sizeof(r)) {
if (WSNPRINTF(r, sizeof(r), "%s/%s", dirName, out->fName)
>= (int)sizeof(r)) {
WLOG(WS_LOG_SFTP, "Path length too large");
WFREE(out->fName, out->heap, DYNTYPE_SFTP);
return WS_FATAL_ERROR;
}
WSNPRINTF(r, sizeof(r), "%s/%s", dirName, out->fName);

if (wolfSSH_RealPath(ssh->sftpDefaultPath, r, s, sizeof(s)) < 0) {
WLOG(WS_LOG_SFTP, "Error cleaning path to get attributes");
Expand Down Expand Up @@ -3020,12 +3020,12 @@ static int wolfSSH_SFTPNAME_readdir(WOLFSSH* ssh, WDIR* dir, WS_SFTPNAME* out,
char r[WOLFSSH_MAX_FILENAME];
char s[WOLFSSH_MAX_FILENAME];

if ((WSTRLEN(dirName) + WSTRLEN(out->fName) + 2) > sizeof(r)) {
if (WSNPRINTF(r, sizeof(r), "%s/%s", dirName, out->fName)
>= (int)sizeof(r)) {
WLOG(WS_LOG_SFTP, "Path length too large");
WFREE(out->fName, out->heap, DYNTYPE_SFTP);
return WS_FATAL_ERROR;
}
WSNPRINTF(r, sizeof(r), "%s/%s", dirName, out->fName);

if (wolfSSH_RealPath(ssh->sftpDefaultPath, r, s, sizeof(s)) < 0) {
WFREE(out->fName, out->heap, DYNTYPE_SFTP);
Expand Down Expand Up @@ -3087,12 +3087,12 @@ static int wolfSSH_SFTPNAME_readdir(WOLFSSH* ssh, WDIR* dir, WS_SFTPNAME* out,
char r[WOLFSSH_MAX_FILENAME];
char s[WOLFSSH_MAX_FILENAME];

if ((WSTRLEN(dirName) + WSTRLEN(out->fName) + 2) > sizeof(r)) {
if (WSNPRINTF(r, sizeof(r), "%s/%s", dirName, out->fName)
>= (int)sizeof(r)) {
WLOG(WS_LOG_SFTP, "Path length too large");
WFREE(out->fName, out->heap, DYNTYPE_SFTP);
return WS_FATAL_ERROR;
}
WSNPRINTF(r, sizeof(r), "%s/%s", dirName, out->fName);

if (wolfSSH_RealPath(ssh->sftpDefaultPath, r, s, sizeof(s)) < 0) {
WFREE(out->fName, out->heap, DYNTYPE_SFTP);
Expand Down
4 changes: 2 additions & 2 deletions wolfssh/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
extern "C" {
#endif

#define LIBWOLFSSH_VERSION_STRING "1.4.14"
#define LIBWOLFSSH_VERSION_HEX 0x01004014
#define LIBWOLFSSH_VERSION_STRING "1.4.15"
#define LIBWOLFSSH_VERSION_HEX 0x01004015

#ifdef __cplusplus
}
Expand Down

0 comments on commit 51cce7b

Please sign in to comment.