Merge pull request #374 from JacobBarthelmeh/release

pull/345/head
John Safranek 2021-11-04 13:39:39 -07:00 committed by GitHub
commit bb6e6e2ba8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 151 additions and 122 deletions

View File

@ -1,3 +1,23 @@
# wolfSSH v1.4.8 (Nov 4, 2021)
## New Feature Additions and Improvements
- Add remote port forwarding
- Make loading user created keys into the examples easier
- Add --with-wolfssl and use --prefix to look for wolfSSL
- Updated the unsupported GlobalReq response
## Fixes
- Fix for RSA public key auth
- When decoding SFTP messages, fix the size checks so they don't wrap
- Fix an issue where the testsuite and echoserver a socket failure
- SFTP fix for getting attribute header
- Fix for possible null dereference in SendKexDhReply
- Remove reference to udp from test.h
- Fixes to local port forwarding
# wolfSSH v1.4.7 (July 23, 2021) # wolfSSH v1.4.7 (July 23, 2021)
## New Feature Additions and Improvements ## New Feature Additions and Improvements

View File

@ -3,7 +3,7 @@
# All right reserved. # All right reserved.
AC_COPYRIGHT([Copyright (C) 2014-2020 wolfSSL Inc.]) AC_COPYRIGHT([Copyright (C) 2014-2020 wolfSSL Inc.])
AC_INIT([wolfssh],[1.4.7],[support@wolfssl.com],[wolfssh],[https://www.wolfssl.com]) AC_INIT([wolfssh],[1.4.8],[support@wolfssl.com],[wolfssh],[https://www.wolfssl.com])
AC_PREREQ([2.63]) AC_PREREQ([2.63])
AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_AUX_DIR([build-aux])
@ -18,7 +18,7 @@ AC_ARG_PROGRAM
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([src/config.h]) AC_CONFIG_HEADERS([src/config.h])
WOLFSSH_LIBRARY_VERSION=12:2:3 WOLFSSH_LIBRARY_VERSION=12:3:3
# | | | # | | |
# +------+ | +---+ # +------+ | +---+
# | | | # | | |

View File

@ -1,6 +1,6 @@
/* client.c /* client.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* client.h /* client.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* echoserver.c /* echoserver.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *
@ -606,7 +606,7 @@ static int ssh_worker(thread_ctx_t* threadCtx)
#ifdef WOLFSSH_SHELL #ifdef WOLFSSH_SHELL
const char *userName; const char *userName;
struct passwd *p_passwd; struct passwd *p_passwd;
WS_SOCKET_T childFd; WS_SOCKET_T childFd = 0;
pid_t childPid; pid_t childPid;
#endif #endif
#if defined(WOLFSSL_PTHREADS) && defined(WOLFSSL_TEST_GLOBAL_REQ) #if defined(WOLFSSL_PTHREADS) && defined(WOLFSSL_TEST_GLOBAL_REQ)

View File

@ -1,6 +1,6 @@
/* echoserver.h /* echoserver.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* portfwd.c /* portfwd.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* wolfssh_portfwd.h /* wolfssh_portfwd.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* scpclient.c /* scpclient.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* scpclient.h /* scpclient.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* server.c /* server.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* server.h /* server.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* sftpclient.c /* sftpclient.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *
@ -689,7 +689,7 @@ static int doCmds(func_args* args)
continue; continue;
} }
if ((pt = WSTRNSTR(msg, "reget", MAX_CMD_SZ)) != NULL) { if (WSTRNSTR(msg, "reget", MAX_CMD_SZ) != NULL) {
resume = 1; resume = 1;
} }
@ -782,7 +782,7 @@ static int doCmds(func_args* args)
} }
if ((pt = WSTRNSTR(msg, "reput", MAX_CMD_SZ)) != NULL) { if (WSTRNSTR(msg, "reput", MAX_CMD_SZ) != NULL) {
resume = 1; resume = 1;
} }
@ -1175,7 +1175,7 @@ static int doCmds(func_args* args)
} }
if ((pt = WSTRNSTR(msg, "ls", MAX_CMD_SZ)) != NULL) { if (WSTRNSTR(msg, "ls", MAX_CMD_SZ) != NULL) {
WS_SFTPNAME* tmp; WS_SFTPNAME* tmp;
WS_SFTPNAME* current; WS_SFTPNAME* current;
@ -1201,7 +1201,7 @@ static int doCmds(func_args* args)
} }
/* display current working directory */ /* display current working directory */
if ((pt = WSTRNSTR(msg, "pwd", MAX_CMD_SZ)) != NULL) { if (WSTRNSTR(msg, "pwd", MAX_CMD_SZ) != NULL) {
if (SFTP_FPUTS(args, workingDir) < 0 || if (SFTP_FPUTS(args, workingDir) < 0 ||
SFTP_FPUTS(args, "\n") < 0) { SFTP_FPUTS(args, "\n") < 0) {
err_msg("fputs error"); err_msg("fputs error");

View File

@ -1,6 +1,6 @@
/* sftpclient.h /* sftpclient.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* dummy_filesystem.h /* dummy_filesystem.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,22 +1,21 @@
/* strings.h /* strings.h
* *
* Copyright (C) 2006-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSL. * This file is part of wolfSSH.
* *
* wolfSSL is free software; you can redistribute it and/or modify * wolfSSH is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* wolfSSL is distributed in the hope that it will be useful, * wolfSSH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with wolfSSH. If not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/ */
int strncasecmp(const char *s1, const char * s2, unsigned int sz); int strncasecmp(const char *s1, const char * s2, unsigned int sz);

View File

@ -1,22 +1,21 @@
/* unistd.h /* unistd.h
* *
* Copyright (C) 2006-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSL. * This file is part of wolfSSH.
* *
* wolfSSL is free software; you can redistribute it and/or modify * wolfSSH is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* wolfSSL is distributed in the hope that it will be useful, * wolfSSH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with wolfSSH. If not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/ */
/* DUMMY Header */ /* DUMMY Header */

View File

@ -1,22 +1,21 @@
/* user_settings.h /* user_settings.h
* *
* Copyright (C) 2006-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSL. * This file is part of wolfSSH.
* *
* wolfSSL is free software; you can redistribute it and/or modify * wolfSSH is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* wolfSSL is distributed in the hope that it will be useful, * wolfSSH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with wolfSSH. If not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/ */
#define WOLFCRYPT_ONLY #define WOLFCRYPT_ONLY
#define NO_ERROR_STRINGS #define NO_ERROR_STRINGS

View File

@ -1,22 +1,21 @@
/* wolfssh_csplus_usersettings..h /* wolfssh_csplus_usersettings..h
* *
* Copyright (C) 2006-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSL. * This file is part of wolfSSH.
* *
* wolfSSL is free software; you can redistribute it and/or modify * wolfSSH is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* wolfSSL is distributed in the hope that it will be useful, * wolfSSH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with wolfSSH. If not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/ */
#define RENESAS_CSPLUS #define RENESAS_CSPLUS

View File

@ -1,6 +1,6 @@
/* wolfssh_demo.c /* wolfssh_demo.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* wolfssh_demo.h /* wolfssh_demo.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* wolfssh_dummy.c /* wolfssh_dummy.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* agent.c /* agent.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* internal.c /* internal.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *
@ -768,7 +768,8 @@ int wolfSSH_ProcessBuffer(WOLFSSH_CTX* ctx,
} }
if (type == BUFTYPE_PRIVKEY && format != WOLFSSH_FORMAT_RAW) { if (type == BUFTYPE_PRIVKEY && format != WOLFSSH_FORMAT_RAW) {
key_ptr = WMALLOC(sizeof(union wolfSSH_key), heap, dynamicType); key_ptr = (union wolfSSH_key*)WMALLOC(sizeof(union wolfSSH_key), heap,
dynamicType);
if (key_ptr == NULL) { if (key_ptr == NULL) {
WFREE(der, heap, dynamicType); WFREE(der, heap, dynamicType);
return WS_MEMORY_E; return WS_MEMORY_E;
@ -3115,14 +3116,17 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
} }
if (ret == WS_SUCCESS) { if (ret == WS_SUCCESS) {
sigKeyBlock_ptr = WMALLOC(sizeof(struct wolfSSH_sigKeyBlock), ssh->ctx->heap, DYNTYPE_PRIVKEY); sigKeyBlock_ptr = (struct wolfSSH_sigKeyBlock*)WMALLOC(
sizeof(struct wolfSSH_sigKeyBlock), ssh->ctx->heap,
DYNTYPE_PRIVKEY);
if (sigKeyBlock_ptr == NULL) { if (sigKeyBlock_ptr == NULL) {
ret = WS_MEMORY_E; ret = WS_MEMORY_E;
} }
#ifdef WOLFSSH_SMALL_STACK #ifdef WOLFSSH_SMALL_STACK
#ifndef WOLFSSH_NO_ECDSA #ifndef WOLFSSH_NO_ECDSA
key_ptr = WMALLOC(sizeof(ecc_key), ssh->ctx->heap, DYNTYPE_PRIVKEY); key_ptr = (ecc_key*)WMALLOC(sizeof(ecc_key), ssh->ctx->heap,
DYNTYPE_PRIVKEY);
if (key_ptr == NULL) { if (key_ptr == NULL) {
ret = WS_MEMORY_E; ret = WS_MEMORY_E;
} }
@ -4061,14 +4065,15 @@ static int DoUserAuthRequestRsa(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk,
if (ret == WS_SUCCESS) { if (ret == WS_SUCCESS) {
#ifdef WOLFSSH_SMALL_STACK #ifdef WOLFSSH_SMALL_STACK
checkDigest = WMALLOC(MAX_ENCODED_SIG_SZ, ssh->ctx->heap, checkDigest = (byte*)WMALLOC(MAX_ENCODED_SIG_SZ, ssh->ctx->heap,
DYNTYPE_BUFFER); DYNTYPE_BUFFER);
if (checkDigest == NULL) if (checkDigest == NULL)
ret = WS_MEMORY_E; ret = WS_MEMORY_E;
#else #else
checkDigest = s_checkDigest; checkDigest = s_checkDigest;
#endif #endif
key_ptr = WMALLOC(sizeof(RsaKey), ssh->ctx->heap, DYNTYPE_PUBKEY); key_ptr = (RsaKey*)WMALLOC(sizeof(RsaKey), ssh->ctx->heap,
DYNTYPE_PUBKEY);
if (key_ptr == NULL) if (key_ptr == NULL)
ret = WS_MEMORY_E; ret = WS_MEMORY_E;
} }
@ -4154,7 +4159,8 @@ static int DoUserAuthRequestRsa(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk,
volatile int compare; volatile int compare;
volatile int sizeCompare; volatile int sizeCompare;
#ifdef WOLFSSH_SMALL_STACK #ifdef WOLFSSH_SMALL_STACK
encDigest = WMALLOC(MAX_ENCODED_SIG_SZ, ssh->ctx->heap, DYNTYPE_BUFFER); encDigest = (byte*)WMALLOC(MAX_ENCODED_SIG_SZ, ssh->ctx->heap,
DYNTYPE_BUFFER);
if (encDigest == NULL) if (encDigest == NULL)
ret = WS_MEMORY_E; ret = WS_MEMORY_E;
#else #else
@ -4222,9 +4228,10 @@ static int DoUserAuthRequestEcc(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk,
if (ret == WS_SUCCESS) { if (ret == WS_SUCCESS) {
#ifdef WOLFSSH_SMALL_STACK #ifdef WOLFSSH_SMALL_STACK
key_ptr = WMALLOC(sizeof(ecc_key), ssh->ctx->heap, DYNTYPE_PUBKEY); key_ptr = (ecc_key*)WMALLOC(sizeof(ecc_key), ssh->ctx->heap,
sig_r_ptr = WMALLOC(sizeof(mp_int), ssh->ctx->heap, DYNTYPE_MPINT); DYNTYPE_PUBKEY);
sig_s_ptr = WMALLOC(sizeof(mp_int), ssh->ctx->heap, DYNTYPE_MPINT); sig_r_ptr = (mp_int*)WMALLOC(sizeof(mp_int), ssh->ctx->heap, DYNTYPE_MPINT);
sig_s_ptr = (mp_int*)WMALLOC(sizeof(mp_int), ssh->ctx->heap, DYNTYPE_MPINT);
if (key_ptr == NULL || sig_r_ptr == NULL || sig_s_ptr == NULL) if (key_ptr == NULL || sig_r_ptr == NULL || sig_s_ptr == NULL)
ret = WS_MEMORY_E; ret = WS_MEMORY_E;
#else #else
@ -6806,6 +6813,7 @@ struct wolfSSH_sigKeyBlockFull {
int SendKexDhReply(WOLFSSH* ssh) int SendKexDhReply(WOLFSSH* ssh)
{ {
int ret = WS_SUCCESS; int ret = WS_SUCCESS;
void *heap = NULL;
byte *f_ptr = NULL, *sig_ptr = NULL; byte *f_ptr = NULL, *sig_ptr = NULL;
#ifndef WOLFSSH_NO_ECDH #ifndef WOLFSSH_NO_ECDH
byte *r_ptr = NULL, *s_ptr = NULL; byte *r_ptr = NULL, *s_ptr = NULL;
@ -6831,12 +6839,7 @@ int SendKexDhReply(WOLFSSH* ssh)
word32 generatorSz = 0; word32 generatorSz = 0;
#endif #endif
struct wolfSSH_sigKeyBlockFull *sigKeyBlock_ptr = NULL; struct wolfSSH_sigKeyBlockFull *sigKeyBlock_ptr = NULL;
#ifdef WOLFSSH_SMALL_STACK #ifndef WOLFSSH_SMALL_STACK
f_ptr = WMALLOC(KEX_F_SIZE, ssh->ctx->heap, DYNTYPE_BUFFER);
sig_ptr = WMALLOC(KEX_SIG_SIZE, ssh->ctx->heap, DYNTYPE_BUFFER);
if (f_ptr == NULL || sig_ptr == NULL)
ret = WS_MEMORY_E;
#else
byte f_s[KEX_F_SIZE]; byte f_s[KEX_F_SIZE];
byte sig_s[KEX_SIG_SIZE]; byte sig_s[KEX_SIG_SIZE];
@ -6846,13 +6849,24 @@ int SendKexDhReply(WOLFSSH* ssh)
WLOG(WS_LOG_DEBUG, "Entering SendKexDhReply()"); WLOG(WS_LOG_DEBUG, "Entering SendKexDhReply()");
if (ret == WS_SUCCESS) { if (ret == WS_SUCCESS) {
if (ssh == NULL || ssh->handshake == NULL) { if (ssh == NULL || ssh->ctx == NULL || ssh->handshake == NULL) {
ret = WS_BAD_ARGUMENT; ret = WS_BAD_ARGUMENT;
} }
} }
sigKeyBlock_ptr = WMALLOC(sizeof(struct wolfSSH_sigKeyBlockFull), if (ret == WS_SUCCESS) {
ssh->ctx->heap, DYNTYPE_PRIVKEY); heap = ssh->ctx->heap;
}
#ifdef WOLFSSH_SMALL_STACK
f_ptr = (byte*)WMALLOC(KEX_F_SIZE, heap, DYNTYPE_BUFFER);
sig_ptr = (byte*)WMALLOC(KEX_SIG_SIZE, heap, DYNTYPE_BUFFER);
if (f_ptr == NULL || sig_ptr == NULL)
ret = WS_MEMORY_E;
#endif
sigKeyBlock_ptr = (struct wolfSSH_sigKeyBlockFull*)WMALLOC(
sizeof(struct wolfSSH_sigKeyBlockFull), heap, DYNTYPE_PRIVKEY);
if (sigKeyBlock_ptr == NULL) if (sigKeyBlock_ptr == NULL)
ret = WS_MEMORY_E; ret = WS_MEMORY_E;
@ -6926,7 +6940,7 @@ int SendKexDhReply(WOLFSSH* ssh)
/* Decode the user-configured RSA private key. */ /* Decode the user-configured RSA private key. */
sigKeyBlock_ptr->sk.rsa.eSz = sizeof(sigKeyBlock_ptr->sk.rsa.e); sigKeyBlock_ptr->sk.rsa.eSz = sizeof(sigKeyBlock_ptr->sk.rsa.e);
sigKeyBlock_ptr->sk.rsa.nSz = sizeof(sigKeyBlock_ptr->sk.rsa.n); sigKeyBlock_ptr->sk.rsa.nSz = sizeof(sigKeyBlock_ptr->sk.rsa.n);
ret = wc_InitRsaKey(&sigKeyBlock_ptr->sk.rsa.key, ssh->ctx->heap); ret = wc_InitRsaKey(&sigKeyBlock_ptr->sk.rsa.key, heap);
if (ret == 0) if (ret == 0)
ret = wc_RsaPrivateKeyDecode(ssh->ctx->privateKey, &scratch, ret = wc_RsaPrivateKeyDecode(ssh->ctx->privateKey, &scratch,
&sigKeyBlock_ptr->sk.rsa.key, &sigKeyBlock_ptr->sk.rsa.key,
@ -7032,7 +7046,7 @@ int SendKexDhReply(WOLFSSH* ssh)
/* Decode the user-configured ECDSA private key. */ /* Decode the user-configured ECDSA private key. */
sigKeyBlock_ptr->sk.ecc.qSz = sizeof(sigKeyBlock_ptr->sk.ecc.q); sigKeyBlock_ptr->sk.ecc.qSz = sizeof(sigKeyBlock_ptr->sk.ecc.q);
ret = wc_ecc_init_ex(&sigKeyBlock_ptr->sk.ecc.key, ssh->ctx->heap, ret = wc_ecc_init_ex(&sigKeyBlock_ptr->sk.ecc.key, heap,
INVALID_DEVID); INVALID_DEVID);
scratch = 0; scratch = 0;
if (ret == 0) if (ret == 0)
@ -7201,7 +7215,7 @@ int SendKexDhReply(WOLFSSH* ssh)
DhKey privKey; DhKey privKey;
word32 ySz = MAX_KEX_KEY_SZ; word32 ySz = MAX_KEX_KEY_SZ;
#ifdef WOLFSSH_SMALL_STACK #ifdef WOLFSSH_SMALL_STACK
y_ptr = WMALLOC(ySz, ssh->ctx->heap, DYNTYPE_PRIVKEY); y_ptr = (byte*)WMALLOC(ySz, heap, DYNTYPE_PRIVKEY);
if (y_ptr == NULL) if (y_ptr == NULL)
ret = WS_MEMORY_E; ret = WS_MEMORY_E;
#else #else
@ -7235,11 +7249,9 @@ int SendKexDhReply(WOLFSSH* ssh)
ret = WS_INVALID_PRIME_CURVE; ret = WS_INVALID_PRIME_CURVE;
if (ret == 0) if (ret == 0)
ret = wc_ecc_init_ex(&pubKey, ssh->ctx->heap, ret = wc_ecc_init_ex(&pubKey, heap, INVALID_DEVID);
INVALID_DEVID);
if (ret == 0) if (ret == 0)
ret = wc_ecc_init_ex(&privKey, ssh->ctx->heap, ret = wc_ecc_init_ex(&privKey, heap, INVALID_DEVID);
INVALID_DEVID);
#ifdef HAVE_WC_ECC_SET_RNG #ifdef HAVE_WC_ECC_SET_RNG
if (ret == 0) if (ret == 0)
ret = wc_ecc_set_rng(&privKey, ssh->rng); ret = wc_ecc_set_rng(&privKey, ssh->rng);
@ -7383,8 +7395,8 @@ int SendKexDhReply(WOLFSSH* ssh)
byte rPad; byte rPad;
byte sPad; byte sPad;
#ifdef WOLFSSH_SMALL_STACK #ifdef WOLFSSH_SMALL_STACK
r_ptr = WMALLOC(rSz, ssh->ctx->heap, DYNTYPE_BUFFER); r_ptr = (byte*)WMALLOC(rSz, heap, DYNTYPE_BUFFER);
s_ptr = WMALLOC(sSz, ssh->ctx->heap, DYNTYPE_BUFFER); s_ptr = (byte*)WMALLOC(sSz, heap, DYNTYPE_BUFFER);
if (r_ptr == NULL || r_ptr == NULL) if (r_ptr == NULL || r_ptr == NULL)
ret = WS_MEMORY_E; ret = WS_MEMORY_E;
#else #else
@ -7524,20 +7536,20 @@ int SendKexDhReply(WOLFSSH* ssh)
WLOG(WS_LOG_DEBUG, "Leaving SendKexDhReply(), ret = %d", ret); WLOG(WS_LOG_DEBUG, "Leaving SendKexDhReply(), ret = %d", ret);
if (sigKeyBlock_ptr) if (sigKeyBlock_ptr)
WFREE(sigKeyBlock_ptr, ssh->ctx->heap, DYNTYPE_PRIVKEY); WFREE(sigKeyBlock_ptr, heap, DYNTYPE_PRIVKEY);
#ifdef WOLFSSH_SMALL_STACK #ifdef WOLFSSH_SMALL_STACK
if (f_ptr) if (f_ptr)
WFREE(f_ptr, ssh->ctx->heap, DYNTYPE_BUFFER); WFREE(f_ptr, heap, DYNTYPE_BUFFER);
if (sig_ptr) if (sig_ptr)
WFREE(sig_ptr, ssh->ctx->heap, DYNTYPE_BUFFER); WFREE(sig_ptr, heap, DYNTYPE_BUFFER);
#ifndef WOLFSSH_NO_DH #ifndef WOLFSSH_NO_DH
if (y_ptr) if (y_ptr)
WFREE(r_ptr, ssh->ctx->heap, DYNTYPE_PRIVKEY); WFREE(y_ptr, heap, DYNTYPE_PRIVKEY);
#endif #endif
if (r_ptr) if (r_ptr)
WFREE(r_ptr, ssh->ctx->heap, DYNTYPE_BUFFER); WFREE(r_ptr, heap, DYNTYPE_BUFFER);
if (s_ptr) if (s_ptr)
WFREE(s_ptr, ssh->ctx->heap, DYNTYPE_BUFFER); WFREE(s_ptr, heap, DYNTYPE_BUFFER);
#endif #endif
return ret; return ret;
} }
@ -8783,7 +8795,7 @@ int SendUserAuthRequest(WOLFSSH* ssh, byte authId, int addSig)
ret = WS_BAD_ARGUMENT; ret = WS_BAD_ARGUMENT;
if (ret == WS_SUCCESS) { if (ret == WS_SUCCESS) {
keySig_ptr = WMALLOC(sizeof(WS_KeySignature), keySig_ptr = (WS_KeySignature*)WMALLOC(sizeof(WS_KeySignature),
ssh->ctx->heap, DYNTYPE_BUFFER); ssh->ctx->heap, DYNTYPE_BUFFER);
if (!keySig_ptr) if (!keySig_ptr)
ret = WS_MEMORY_E; ret = WS_MEMORY_E;

View File

@ -1,6 +1,6 @@
/* io.c /* io.c
* *
* Copyright (C) 2014-2016 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* keygen.c /* keygen.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* log.c /* log.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* misc.c /* misc.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* port.c /* port.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* ssh.c /* ssh.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *
@ -1482,7 +1482,8 @@ int wolfSSH_ReadKey_buffer(const byte* in, word32 inSz, int format,
word32 scratch = 0; word32 scratch = 0;
union wolfSSH_key *key_ptr = NULL; union wolfSSH_key *key_ptr = NULL;
key_ptr = WMALLOC(sizeof(union wolfSSH_key), heap, DYNTYPE_PRIVKEY); key_ptr = (union wolfSSH_key*)WMALLOC(sizeof(union wolfSSH_key), heap,
DYNTYPE_PRIVKEY);
if (key_ptr == NULL) { if (key_ptr == NULL) {
return WS_MEMORY_E; return WS_MEMORY_E;
} }

View File

@ -1,6 +1,6 @@
/* wolfscp.c /* wolfscp.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* wolfsftp.c /* wolfsftp.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *
@ -3800,7 +3800,7 @@ int wolfSSH_SFTP_RecvRemove(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz)
if (ret == WS_SUCCESS) { if (ret == WS_SUCCESS) {
#ifndef USE_WINDOWS_API #ifndef USE_WINDOWS_API
if ((ret = WREMOVE(ssh->fs, name)) < 0) if (WREMOVE(ssh->fs, name) < 0)
#else /* USE_WINDOWS_API */ #else /* USE_WINDOWS_API */
if (WS_DeleteFileA(name, ssh->ctx->heap) == 0) if (WS_DeleteFileA(name, ssh->ctx->heap) == 0)
#endif /* USE_WINDOWS_API */ #endif /* USE_WINDOWS_API */

View File

@ -1,6 +1,6 @@
/* wolfterm.c /* wolfterm.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* api.c /* api.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* sftp.c /* sftp.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* testsuite.c /* testsuite.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* testsuite.h /* testsuite.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* unit.c /* unit.c
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* agent.h /* agent.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* certs_test.h /* certs_test.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* error.h /* error.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* internal.h /* internal.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* keygen.h /* keygen.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* log.h /* log.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* misc.h /* misc.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* port.h /* port.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* settings.h /* settings.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* ssh.h /* ssh.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* test.h /* test.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* version.h.in /* version.h.in
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *
@ -35,8 +35,8 @@
extern "C" { extern "C" {
#endif #endif
#define LIBWOLFSSH_VERSION_STRING "1.4.7" #define LIBWOLFSSH_VERSION_STRING "1.4.8"
#define LIBWOLFSSH_VERSION_HEX 0x01004007 #define LIBWOLFSSH_VERSION_HEX 0x01004008
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -1,6 +1,6 @@
/* version.h.in /* version.h.in
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* visibility.h /* visibility.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* wolfscp.h /* wolfscp.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *

View File

@ -1,6 +1,6 @@
/* wolfsftp.h /* wolfsftp.h
* *
* Copyright (C) 2014-2020 wolfSSL Inc. * Copyright (C) 2014-2021 wolfSSL Inc.
* *
* This file is part of wolfSSH. * This file is part of wolfSSH.
* *