diff --git a/ChangeLog.md b/ChangeLog.md index bc844a85..2157351b 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -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) ## New Feature Additions and Improvements diff --git a/configure.ac b/configure.ac index ca64bc98..a9dd7a0f 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ # All right reserved. 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_CONFIG_AUX_DIR([build-aux]) @@ -18,7 +18,7 @@ AC_ARG_PROGRAM AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([src/config.h]) -WOLFSSH_LIBRARY_VERSION=12:2:3 +WOLFSSH_LIBRARY_VERSION=12:3:3 # | | | # +------+ | +---+ # | | | diff --git a/examples/client/client.c b/examples/client/client.c index 610f2b81..acb57171 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -1,6 +1,6 @@ /* client.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/examples/client/client.h b/examples/client/client.h index 29faac11..2fec33dc 100644 --- a/examples/client/client.h +++ b/examples/client/client.h @@ -1,6 +1,6 @@ /* client.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/examples/echoserver/echoserver.c b/examples/echoserver/echoserver.c index 6c34f8f4..906b89f7 100644 --- a/examples/echoserver/echoserver.c +++ b/examples/echoserver/echoserver.c @@ -1,6 +1,6 @@ /* echoserver.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * @@ -606,7 +606,7 @@ static int ssh_worker(thread_ctx_t* threadCtx) #ifdef WOLFSSH_SHELL const char *userName; struct passwd *p_passwd; - WS_SOCKET_T childFd; + WS_SOCKET_T childFd = 0; pid_t childPid; #endif #if defined(WOLFSSL_PTHREADS) && defined(WOLFSSL_TEST_GLOBAL_REQ) diff --git a/examples/echoserver/echoserver.h b/examples/echoserver/echoserver.h index 99e40801..36731601 100644 --- a/examples/echoserver/echoserver.h +++ b/examples/echoserver/echoserver.h @@ -1,6 +1,6 @@ /* echoserver.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/examples/portfwd/portfwd.c b/examples/portfwd/portfwd.c index 4ea84a06..bb146c9f 100644 --- a/examples/portfwd/portfwd.c +++ b/examples/portfwd/portfwd.c @@ -1,6 +1,6 @@ /* portfwd.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/examples/portfwd/wolfssh_portfwd.h b/examples/portfwd/wolfssh_portfwd.h index 35377b37..dfcf2545 100644 --- a/examples/portfwd/wolfssh_portfwd.h +++ b/examples/portfwd/wolfssh_portfwd.h @@ -1,6 +1,6 @@ /* wolfssh_portfwd.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/examples/scpclient/scpclient.c b/examples/scpclient/scpclient.c index 786a6f56..1dc65bea 100644 --- a/examples/scpclient/scpclient.c +++ b/examples/scpclient/scpclient.c @@ -1,6 +1,6 @@ /* scpclient.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/examples/scpclient/scpclient.h b/examples/scpclient/scpclient.h index a4a3f4e6..4905de4c 100644 --- a/examples/scpclient/scpclient.h +++ b/examples/scpclient/scpclient.h @@ -1,6 +1,6 @@ /* scpclient.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/examples/server/server.c b/examples/server/server.c index 2abd7744..f28fd1f5 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -1,6 +1,6 @@ /* server.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/examples/server/server.h b/examples/server/server.h index f7732c96..b709a3b8 100644 --- a/examples/server/server.h +++ b/examples/server/server.h @@ -1,6 +1,6 @@ /* server.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/examples/sftpclient/sftpclient.c b/examples/sftpclient/sftpclient.c index 9642c038..42eb1f6e 100644 --- a/examples/sftpclient/sftpclient.c +++ b/examples/sftpclient/sftpclient.c @@ -1,6 +1,6 @@ /* sftpclient.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * @@ -689,7 +689,7 @@ static int doCmds(func_args* args) continue; } - if ((pt = WSTRNSTR(msg, "reget", MAX_CMD_SZ)) != NULL) { + if (WSTRNSTR(msg, "reget", MAX_CMD_SZ) != NULL) { 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; } @@ -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* current; @@ -1201,7 +1201,7 @@ static int doCmds(func_args* args) } /* 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 || SFTP_FPUTS(args, "\n") < 0) { err_msg("fputs error"); diff --git a/examples/sftpclient/sftpclient.h b/examples/sftpclient/sftpclient.h index 95ac2910..64f186e2 100644 --- a/examples/sftpclient/sftpclient.h +++ b/examples/sftpclient/sftpclient.h @@ -1,6 +1,6 @@ /* sftpclient.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/ide/IAR-EWARM/Projects/lib/myFilesystem.h b/ide/IAR-EWARM/Projects/lib/myFilesystem.h index ce70f1df..1097b815 100644 --- a/ide/IAR-EWARM/Projects/lib/myFilesystem.h +++ b/ide/IAR-EWARM/Projects/lib/myFilesystem.h @@ -1,6 +1,6 @@ /* dummy_filesystem.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/ide/Renesas/cs+/common/strings.h b/ide/Renesas/cs+/common/strings.h index fd2cf86e..bc767f21 100644 --- a/ide/Renesas/cs+/common/strings.h +++ b/ide/Renesas/cs+/common/strings.h @@ -1,22 +1,21 @@ /* 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 - * 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. * - * 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 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + * along with wolfSSH. If not, see . */ int strncasecmp(const char *s1, const char * s2, unsigned int sz); diff --git a/ide/Renesas/cs+/common/unistd.h b/ide/Renesas/cs+/common/unistd.h index d91dd479..6b411deb 100644 --- a/ide/Renesas/cs+/common/unistd.h +++ b/ide/Renesas/cs+/common/unistd.h @@ -1,22 +1,21 @@ /* 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 - * 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. * - * 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 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + * along with wolfSSH. If not, see . */ /* DUMMY Header */ diff --git a/ide/Renesas/cs+/common/user_settings.h b/ide/Renesas/cs+/common/user_settings.h index a6d3c43d..c7d0dfe4 100644 --- a/ide/Renesas/cs+/common/user_settings.h +++ b/ide/Renesas/cs+/common/user_settings.h @@ -1,22 +1,21 @@ /* 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 - * 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. * - * 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 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + * along with wolfSSH. If not, see . */ #define WOLFCRYPT_ONLY #define NO_ERROR_STRINGS diff --git a/ide/Renesas/cs+/common/wolfssh_csplus_usersettings.h b/ide/Renesas/cs+/common/wolfssh_csplus_usersettings.h index 03141d51..7ee02b0d 100644 --- a/ide/Renesas/cs+/common/wolfssh_csplus_usersettings.h +++ b/ide/Renesas/cs+/common/wolfssh_csplus_usersettings.h @@ -1,22 +1,21 @@ /* 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 - * 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. * - * 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 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + * along with wolfSSH. If not, see . */ #define RENESAS_CSPLUS diff --git a/ide/Renesas/cs+/demo_server/wolfssh_demo.c b/ide/Renesas/cs+/demo_server/wolfssh_demo.c index f648d089..26bf4ffc 100644 --- a/ide/Renesas/cs+/demo_server/wolfssh_demo.c +++ b/ide/Renesas/cs+/demo_server/wolfssh_demo.c @@ -1,6 +1,6 @@ /* wolfssh_demo.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/ide/Renesas/cs+/demo_server/wolfssh_demo.h b/ide/Renesas/cs+/demo_server/wolfssh_demo.h index 5e467e6d..90152c01 100644 --- a/ide/Renesas/cs+/demo_server/wolfssh_demo.h +++ b/ide/Renesas/cs+/demo_server/wolfssh_demo.h @@ -1,6 +1,6 @@ /* wolfssh_demo.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/ide/Renesas/cs+/demo_server/wolfssh_dummy.c b/ide/Renesas/cs+/demo_server/wolfssh_dummy.c index f555cfb3..4fd0693b 100644 --- a/ide/Renesas/cs+/demo_server/wolfssh_dummy.c +++ b/ide/Renesas/cs+/demo_server/wolfssh_dummy.c @@ -1,6 +1,6 @@ /* wolfssh_dummy.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/src/agent.c b/src/agent.c index 4e1ada3f..50c89c32 100644 --- a/src/agent.c +++ b/src/agent.c @@ -1,6 +1,6 @@ /* agent.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/src/internal.c b/src/internal.c index 636bc414..0968be5d 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1,6 +1,6 @@ /* internal.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * @@ -768,7 +768,8 @@ int wolfSSH_ProcessBuffer(WOLFSSH_CTX* ctx, } 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) { WFREE(der, heap, dynamicType); return WS_MEMORY_E; @@ -3115,14 +3116,17 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx) } 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) { ret = WS_MEMORY_E; } #ifdef WOLFSSH_SMALL_STACK #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) { ret = WS_MEMORY_E; } @@ -4061,14 +4065,15 @@ static int DoUserAuthRequestRsa(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk, if (ret == WS_SUCCESS) { #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); if (checkDigest == NULL) ret = WS_MEMORY_E; #else checkDigest = s_checkDigest; #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) ret = WS_MEMORY_E; } @@ -4154,7 +4159,8 @@ static int DoUserAuthRequestRsa(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk, volatile int compare; volatile int sizeCompare; #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) ret = WS_MEMORY_E; #else @@ -4222,9 +4228,10 @@ static int DoUserAuthRequestEcc(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk, if (ret == WS_SUCCESS) { #ifdef WOLFSSH_SMALL_STACK - key_ptr = WMALLOC(sizeof(ecc_key), ssh->ctx->heap, DYNTYPE_PUBKEY); - sig_r_ptr = WMALLOC(sizeof(mp_int), ssh->ctx->heap, DYNTYPE_MPINT); - sig_s_ptr = WMALLOC(sizeof(mp_int), ssh->ctx->heap, DYNTYPE_MPINT); + key_ptr = (ecc_key*)WMALLOC(sizeof(ecc_key), ssh->ctx->heap, + DYNTYPE_PUBKEY); + 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) ret = WS_MEMORY_E; #else @@ -6806,6 +6813,7 @@ struct wolfSSH_sigKeyBlockFull { int SendKexDhReply(WOLFSSH* ssh) { int ret = WS_SUCCESS; + void *heap = NULL; byte *f_ptr = NULL, *sig_ptr = NULL; #ifndef WOLFSSH_NO_ECDH byte *r_ptr = NULL, *s_ptr = NULL; @@ -6831,12 +6839,7 @@ int SendKexDhReply(WOLFSSH* ssh) word32 generatorSz = 0; #endif struct wolfSSH_sigKeyBlockFull *sigKeyBlock_ptr = NULL; -#ifdef 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 +#ifndef WOLFSSH_SMALL_STACK byte f_s[KEX_F_SIZE]; byte sig_s[KEX_SIG_SIZE]; @@ -6846,13 +6849,24 @@ int SendKexDhReply(WOLFSSH* ssh) WLOG(WS_LOG_DEBUG, "Entering SendKexDhReply()"); if (ret == WS_SUCCESS) { - if (ssh == NULL || ssh->handshake == NULL) { + if (ssh == NULL || ssh->ctx == NULL || ssh->handshake == NULL) { ret = WS_BAD_ARGUMENT; } } - sigKeyBlock_ptr = WMALLOC(sizeof(struct wolfSSH_sigKeyBlockFull), - ssh->ctx->heap, DYNTYPE_PRIVKEY); + if (ret == WS_SUCCESS) { + 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) ret = WS_MEMORY_E; @@ -6926,7 +6940,7 @@ int SendKexDhReply(WOLFSSH* ssh) /* Decode the user-configured RSA private key. */ sigKeyBlock_ptr->sk.rsa.eSz = sizeof(sigKeyBlock_ptr->sk.rsa.e); 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) ret = wc_RsaPrivateKeyDecode(ssh->ctx->privateKey, &scratch, &sigKeyBlock_ptr->sk.rsa.key, @@ -7032,8 +7046,8 @@ int SendKexDhReply(WOLFSSH* ssh) /* Decode the user-configured ECDSA private key. */ sigKeyBlock_ptr->sk.ecc.qSz = sizeof(sigKeyBlock_ptr->sk.ecc.q); - ret = wc_ecc_init_ex(&sigKeyBlock_ptr->sk.ecc.key, ssh->ctx->heap, - INVALID_DEVID); + ret = wc_ecc_init_ex(&sigKeyBlock_ptr->sk.ecc.key, heap, + INVALID_DEVID); scratch = 0; if (ret == 0) ret = wc_EccPrivateKeyDecode(ssh->ctx->privateKey, &scratch, @@ -7201,7 +7215,7 @@ int SendKexDhReply(WOLFSSH* ssh) DhKey privKey; word32 ySz = MAX_KEX_KEY_SZ; #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) ret = WS_MEMORY_E; #else @@ -7235,11 +7249,9 @@ int SendKexDhReply(WOLFSSH* ssh) ret = WS_INVALID_PRIME_CURVE; if (ret == 0) - ret = wc_ecc_init_ex(&pubKey, ssh->ctx->heap, - INVALID_DEVID); + ret = wc_ecc_init_ex(&pubKey, heap, INVALID_DEVID); if (ret == 0) - ret = wc_ecc_init_ex(&privKey, ssh->ctx->heap, - INVALID_DEVID); + ret = wc_ecc_init_ex(&privKey, heap, INVALID_DEVID); #ifdef HAVE_WC_ECC_SET_RNG if (ret == 0) ret = wc_ecc_set_rng(&privKey, ssh->rng); @@ -7383,8 +7395,8 @@ int SendKexDhReply(WOLFSSH* ssh) byte rPad; byte sPad; #ifdef WOLFSSH_SMALL_STACK - r_ptr = WMALLOC(rSz, ssh->ctx->heap, DYNTYPE_BUFFER); - s_ptr = WMALLOC(sSz, ssh->ctx->heap, DYNTYPE_BUFFER); + r_ptr = (byte*)WMALLOC(rSz, heap, DYNTYPE_BUFFER); + s_ptr = (byte*)WMALLOC(sSz, heap, DYNTYPE_BUFFER); if (r_ptr == NULL || r_ptr == NULL) ret = WS_MEMORY_E; #else @@ -7524,20 +7536,20 @@ int SendKexDhReply(WOLFSSH* ssh) WLOG(WS_LOG_DEBUG, "Leaving SendKexDhReply(), ret = %d", ret); if (sigKeyBlock_ptr) - WFREE(sigKeyBlock_ptr, ssh->ctx->heap, DYNTYPE_PRIVKEY); + WFREE(sigKeyBlock_ptr, heap, DYNTYPE_PRIVKEY); #ifdef WOLFSSH_SMALL_STACK if (f_ptr) - WFREE(f_ptr, ssh->ctx->heap, DYNTYPE_BUFFER); + WFREE(f_ptr, heap, DYNTYPE_BUFFER); if (sig_ptr) - WFREE(sig_ptr, ssh->ctx->heap, DYNTYPE_BUFFER); + WFREE(sig_ptr, heap, DYNTYPE_BUFFER); #ifndef WOLFSSH_NO_DH if (y_ptr) - WFREE(r_ptr, ssh->ctx->heap, DYNTYPE_PRIVKEY); + WFREE(y_ptr, heap, DYNTYPE_PRIVKEY); #endif if (r_ptr) - WFREE(r_ptr, ssh->ctx->heap, DYNTYPE_BUFFER); + WFREE(r_ptr, heap, DYNTYPE_BUFFER); if (s_ptr) - WFREE(s_ptr, ssh->ctx->heap, DYNTYPE_BUFFER); + WFREE(s_ptr, heap, DYNTYPE_BUFFER); #endif return ret; } @@ -8783,7 +8795,7 @@ int SendUserAuthRequest(WOLFSSH* ssh, byte authId, int addSig) ret = WS_BAD_ARGUMENT; if (ret == WS_SUCCESS) { - keySig_ptr = WMALLOC(sizeof(WS_KeySignature), + keySig_ptr = (WS_KeySignature*)WMALLOC(sizeof(WS_KeySignature), ssh->ctx->heap, DYNTYPE_BUFFER); if (!keySig_ptr) ret = WS_MEMORY_E; diff --git a/src/io.c b/src/io.c index 0f75a6e3..f62250ef 100644 --- a/src/io.c +++ b/src/io.c @@ -1,6 +1,6 @@ /* io.c * - * Copyright (C) 2014-2016 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/src/keygen.c b/src/keygen.c index 9beaf77c..a7988dec 100644 --- a/src/keygen.c +++ b/src/keygen.c @@ -1,6 +1,6 @@ /* keygen.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/src/log.c b/src/log.c index 2fbef7cc..45621f1d 100644 --- a/src/log.c +++ b/src/log.c @@ -1,6 +1,6 @@ /* log.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/src/misc.c b/src/misc.c index 69a47378..0834e0db 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1,6 +1,6 @@ /* misc.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/src/port.c b/src/port.c index c8734292..f21ba153 100644 --- a/src/port.c +++ b/src/port.c @@ -1,6 +1,6 @@ /* port.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/src/ssh.c b/src/ssh.c index d2d2b237..33936bfd 100644 --- a/src/ssh.c +++ b/src/ssh.c @@ -1,6 +1,6 @@ /* ssh.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * @@ -1482,7 +1482,8 @@ int wolfSSH_ReadKey_buffer(const byte* in, word32 inSz, int format, word32 scratch = 0; 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) { return WS_MEMORY_E; } diff --git a/src/wolfscp.c b/src/wolfscp.c index 43c42f18..732acd2d 100644 --- a/src/wolfscp.c +++ b/src/wolfscp.c @@ -1,6 +1,6 @@ /* wolfscp.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/src/wolfsftp.c b/src/wolfsftp.c index 903be324..331474f4 100644 --- a/src/wolfsftp.c +++ b/src/wolfsftp.c @@ -1,6 +1,6 @@ /* wolfsftp.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * 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) { #ifndef USE_WINDOWS_API - if ((ret = WREMOVE(ssh->fs, name)) < 0) + if (WREMOVE(ssh->fs, name) < 0) #else /* USE_WINDOWS_API */ if (WS_DeleteFileA(name, ssh->ctx->heap) == 0) #endif /* USE_WINDOWS_API */ diff --git a/src/wolfterm.c b/src/wolfterm.c index 502c849b..851e132a 100644 --- a/src/wolfterm.c +++ b/src/wolfterm.c @@ -1,6 +1,6 @@ /* wolfterm.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/tests/api.c b/tests/api.c index 1d2a9159..19021fd2 100644 --- a/tests/api.c +++ b/tests/api.c @@ -1,6 +1,6 @@ /* api.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/tests/sftp.c b/tests/sftp.c index d7f4de0a..66b7698d 100644 --- a/tests/sftp.c +++ b/tests/sftp.c @@ -1,6 +1,6 @@ /* sftp.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/tests/testsuite.c b/tests/testsuite.c index a5a0751e..ab69c2eb 100644 --- a/tests/testsuite.c +++ b/tests/testsuite.c @@ -1,6 +1,6 @@ /* testsuite.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/tests/testsuite.h b/tests/testsuite.h index 5e45d26e..4e95ccd9 100644 --- a/tests/testsuite.h +++ b/tests/testsuite.h @@ -1,6 +1,6 @@ /* testsuite.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/tests/unit.c b/tests/unit.c index c8f9db9f..1c6e9312 100644 --- a/tests/unit.c +++ b/tests/unit.c @@ -1,6 +1,6 @@ /* unit.c * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/agent.h b/wolfssh/agent.h index a3a4951d..b06e1601 100644 --- a/wolfssh/agent.h +++ b/wolfssh/agent.h @@ -1,6 +1,6 @@ /* agent.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/certs_test.h b/wolfssh/certs_test.h index c313b76a..628eb8a4 100644 --- a/wolfssh/certs_test.h +++ b/wolfssh/certs_test.h @@ -1,6 +1,6 @@ /* certs_test.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/error.h b/wolfssh/error.h index dd192298..0de420b5 100644 --- a/wolfssh/error.h +++ b/wolfssh/error.h @@ -1,6 +1,6 @@ /* error.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/internal.h b/wolfssh/internal.h index d7dea9c2..46bfb37c 100644 --- a/wolfssh/internal.h +++ b/wolfssh/internal.h @@ -1,6 +1,6 @@ /* internal.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/keygen.h b/wolfssh/keygen.h index 5e8c53d5..92aa7bb5 100644 --- a/wolfssh/keygen.h +++ b/wolfssh/keygen.h @@ -1,6 +1,6 @@ /* keygen.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/log.h b/wolfssh/log.h index d8dfaafd..b26da4b8 100644 --- a/wolfssh/log.h +++ b/wolfssh/log.h @@ -1,6 +1,6 @@ /* log.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/misc.h b/wolfssh/misc.h index 04fa68e6..9480db9e 100644 --- a/wolfssh/misc.h +++ b/wolfssh/misc.h @@ -1,6 +1,6 @@ /* misc.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/port.h b/wolfssh/port.h index 7e24a9a5..7efb1e25 100644 --- a/wolfssh/port.h +++ b/wolfssh/port.h @@ -1,6 +1,6 @@ /* port.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/settings.h b/wolfssh/settings.h index 4a07f9bc..464417d9 100644 --- a/wolfssh/settings.h +++ b/wolfssh/settings.h @@ -1,6 +1,6 @@ /* settings.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/ssh.h b/wolfssh/ssh.h index ff910a1e..cf1366ec 100644 --- a/wolfssh/ssh.h +++ b/wolfssh/ssh.h @@ -1,6 +1,6 @@ /* ssh.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/test.h b/wolfssh/test.h index 27707f07..1447974e 100644 --- a/wolfssh/test.h +++ b/wolfssh/test.h @@ -1,6 +1,6 @@ /* test.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/version.h b/wolfssh/version.h index f81e55eb..e56a19c2 100644 --- a/wolfssh/version.h +++ b/wolfssh/version.h @@ -1,6 +1,6 @@ /* version.h.in * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * @@ -35,8 +35,8 @@ extern "C" { #endif -#define LIBWOLFSSH_VERSION_STRING "1.4.7" -#define LIBWOLFSSH_VERSION_HEX 0x01004007 +#define LIBWOLFSSH_VERSION_STRING "1.4.8" +#define LIBWOLFSSH_VERSION_HEX 0x01004008 #ifdef __cplusplus } diff --git a/wolfssh/version.h.in b/wolfssh/version.h.in index 37738c59..bb119e55 100644 --- a/wolfssh/version.h.in +++ b/wolfssh/version.h.in @@ -1,6 +1,6 @@ /* version.h.in * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/visibility.h b/wolfssh/visibility.h index dc48375b..5a39c452 100644 --- a/wolfssh/visibility.h +++ b/wolfssh/visibility.h @@ -1,6 +1,6 @@ /* visibility.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/wolfscp.h b/wolfssh/wolfscp.h index 270584af..1b361389 100644 --- a/wolfssh/wolfscp.h +++ b/wolfssh/wolfscp.h @@ -1,6 +1,6 @@ /* wolfscp.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. * diff --git a/wolfssh/wolfsftp.h b/wolfssh/wolfsftp.h index 402b33c1..647021ac 100644 --- a/wolfssh/wolfsftp.h +++ b/wolfssh/wolfsftp.h @@ -1,6 +1,6 @@ /* wolfsftp.h * - * Copyright (C) 2014-2020 wolfSSL Inc. + * Copyright (C) 2014-2021 wolfSSL Inc. * * This file is part of wolfSSH. *