Skip to content

Commit 99319bf

Browse files
committed
Fix wrong variable checked in DoCheckUser auth callback
In DoCheckUser, after calling auth->checkUserCb(usr) into rc, the failure check on line 1063 compared ret instead of rc against WSSHD_AUTH_FAILURE. Since ret is WOLFSSH_USERAUTH_SUCCESS at that point, the condition was always false, causing callback failures to fall through to the generic error branch with WOLFSSH_USERAUTH_FAILURE instead of returning WOLFSSH_USERAUTH_INVALID_USER.
1 parent eab0488 commit 99319bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/wolfsshd/auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ static int DoCheckUser(const char* usr, WOLFSSHD_AUTH* auth)
10601060
wolfSSH_Log(WS_LOG_INFO, "[SSHD] User ok.");
10611061
ret = WOLFSSH_USERAUTH_SUCCESS;
10621062
}
1063-
else if (ret == WSSHD_AUTH_FAILURE) {
1063+
else if (rc == WSSHD_AUTH_FAILURE) {
10641064
wolfSSH_Log(WS_LOG_INFO, "[SSHD] User %s doesn't exist.", usr);
10651065
ret = WOLFSSH_USERAUTH_INVALID_USER;
10661066
}

0 commit comments

Comments
 (0)