Merge pull request #520 from JacobBarthelmeh/auth

fix empty password support regression
pull/517/head
John Safranek 2023-06-01 11:17:55 -07:00 committed by GitHub
commit f41135dbd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -298,6 +298,13 @@ static int CheckPasswordHashUnix(const char* input, char* stored)
ret = WS_BAD_ARGUMENT;
}
/* empty password case */
if (stored[0] == 0 && WSTRLEN(input) == 0) {
wolfSSH_Log(WS_LOG_INFO,
"[SSHD] User logged in with empty password");
return ret;
}
if (ret == WSSHD_AUTH_SUCCESS) {
hashedInput = crypt(input, stored);
if (hashedInput == NULL) {