From fecd27f47940febcdcfa405fa0033fbd9021a2e7 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 11 Nov 2026 09:06:20 -0800 Subject: [PATCH 1/2] wolfsshd: free usrW in SetupUserTokenWin SetupUserTokenWin frees its WCHAR copy of the user name in the common cleanup with authInfo and the LSA handle, so a public key probe no longer leaks it on Windows. Issue: F-8854 --- apps/wolfsshd/auth.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/wolfsshd/auth.c b/apps/wolfsshd/auth.c index 1690587d1..0790eb2ef 100644 --- a/apps/wolfsshd/auth.c +++ b/apps/wolfsshd/auth.c @@ -2472,6 +2472,10 @@ static int SetupUserTokenWin(const char* usr, WFREE(authInfo, NULL, DYNTYPE_SSHD); } + if (usrW != NULL) { + WFREE(usrW, NULL, DYNTYPE_SSHD); + } + if (lsaHandle != NULL) { LsaDeregisterLogonProcess(lsaHandle); } From 2b56099fef333c423bed64e7e3982ebc11f36540 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 11 Nov 2026 09:06:28 -0800 Subject: [PATCH 2/2] wolfsshd: match CheckPasswordPAM to the callback CheckPasswordPAM takes the WOLFSSHD_AUTH argument that CallbackCheckPassword requires, so a --with-pam build compiles again. It is still a stub and returns WSSHD_AUTH_FAILURE for every password. Issue: F-11676 --- apps/wolfsshd/auth.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/wolfsshd/auth.c b/apps/wolfsshd/auth.c index 0790eb2ef..94bc3331e 100644 --- a/apps/wolfsshd/auth.c +++ b/apps/wolfsshd/auth.c @@ -746,12 +746,15 @@ void wolfSSHD_AuthInit(void) #ifndef _WIN32 #ifdef WOLFSSH_USE_PAM -static int CheckPasswordPAM(const char* usr, const byte* pw, word32 pwSz) +/* Stub: PAM is not implemented, so every password is refused. */ +static int CheckPasswordPAM(const char* usr, const byte* pw, word32 pwSz, + WOLFSSHD_AUTH* authCtx) { (void)usr; (void)pw; (void)pwSz; - return 0; + (void)authCtx; + return WSSHD_AUTH_FAILURE; } #else