From 491f3dce578398a1071d4dccaef64497494c36a0 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 1 Sep 2023 09:19:05 -0700 Subject: [PATCH] WMACRO Update 1. Fix missing updates to wolfSSHd. 2. Fix missing update to scp. --- apps/wolfsshd/auth.c | 4 ++-- apps/wolfsshd/configuration.c | 10 +++++----- apps/wolfsshd/wolfsshd.c | 2 +- src/wolfscp.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/wolfsshd/auth.c b/apps/wolfsshd/auth.c index 4b4040dab..4da1fb8d8 100644 --- a/apps/wolfsshd/auth.c +++ b/apps/wolfsshd/auth.c @@ -511,7 +511,7 @@ static int SearchForPubKey(const char* path, const WS_UserAuthData_PublicKey* pu } if (ret == WSSHD_AUTH_SUCCESS) { - if (WFOPEN(&f, authKeysPath, "rb") != 0) { + if (WFOPEN(NULL, &f, authKeysPath, "rb") != 0) { wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Unable to open %s", authKeysPath); ret = WS_BAD_FILE_E; @@ -554,7 +554,7 @@ static int SearchForPubKey(const char* path, const WS_UserAuthData_PublicKey* pu } if (f != WBADFILE) { - WFCLOSE(f); + WFCLOSE(NULL, f); } if (ret == WSSHD_AUTH_SUCCESS && !foundKey) { diff --git a/apps/wolfsshd/configuration.c b/apps/wolfsshd/configuration.c index 742b3388b..33f2b6ef1 100644 --- a/apps/wolfsshd/configuration.c +++ b/apps/wolfsshd/configuration.c @@ -1114,7 +1114,7 @@ int wolfSSHD_ConfigLoad(WOLFSSHD_CONFIG* conf, const char* filename) if (conf == NULL || filename == NULL) return BAD_FUNC_ARG; - if (WFOPEN(&f, filename, "rb") != 0) { + if (WFOPEN(NULL, &f, filename, "rb") != 0) { wolfSSH_Log(WS_LOG_ERROR, "Unable to open SSHD config file %s", filename); return BAD_FUNC_ARG; @@ -1146,7 +1146,7 @@ int wolfSSHD_ConfigLoad(WOLFSSHD_CONFIG* conf, const char* filename) break; } } - WFCLOSE(f); + WFCLOSE(NULL, f); SetAuthKeysPattern(conf->authKeysFile); @@ -1450,10 +1450,10 @@ void wolfSSHD_ConfigSavePID(const WOLFSSHD_CONFIG* conf) char buf[12]; /* large enough to hold 'int' type with null terminator */ WMEMSET(buf, 0, sizeof(buf)); - if (WFOPEN(&f, conf->pidFile, "wb") == 0) { + if (WFOPEN(NULL, &f, conf->pidFile, "wb") == 0) { WSNPRINTF(buf, sizeof(buf), "%d", getpid()); - WFWRITE(buf, 1, WSTRLEN(buf), f); - WFCLOSE(f); + WFWRITE(NULL, buf, 1, WSTRLEN(buf), f); + WFCLOSE(NULL, f); } } diff --git a/apps/wolfsshd/wolfsshd.c b/apps/wolfsshd/wolfsshd.c index 6ec720618..9692f7663 100644 --- a/apps/wolfsshd/wolfsshd.c +++ b/apps/wolfsshd/wolfsshd.c @@ -1949,7 +1949,7 @@ static int StartSSHD(int argc, char** argv) break; case 'E': - ret = WFOPEN(&logFile, myoptarg, "ab"); + ret = WFOPEN(NULL, &logFile, myoptarg, "ab"); if (ret != 0 || logFile == WBADFILE) { fprintf(stderr, "Unable to open log file %s\n", myoptarg); ret = WS_FATAL_ERROR; diff --git a/src/wolfscp.c b/src/wolfscp.c index c034bb452..c568ed4d0 100644 --- a/src/wolfscp.c +++ b/src/wolfscp.c @@ -2095,7 +2095,7 @@ int wsScpRecvCallback(WOLFSSH* ssh, int state, const char* basePath, return ret; } -static int _GetFileSize(WFILE* fp, word32* fileSz) +static int _GetFileSize(void* fs, WFILE* fp, word32* fileSz) { WOLFSSH_UNUSED(fs);