auth test case account for no null terminator with strings when comparing values

pull/807/head
JacobBarthelmeh 2025-05-29 10:48:44 -06:00
parent 1bee0c19ab
commit b60c599c36
1 changed files with 3 additions and 2 deletions

View File

@ -249,8 +249,9 @@ static int serverUserAuth(byte authType, WS_UserAuthData* authData, void* ctx)
return WOLFSSH_USERAUTH_FAILURE;
}
if (WSTRCMP((const char*)authData->sf.keyboard.responses[resp],
(const char*)kbResponses[resp]) != 0) {
if (WSTRNCMP((const char*)authData->sf.keyboard.responses[resp],
(const char*)kbResponses[resp],
kbResponseLengths[resp]) != 0) {
return WOLFSSH_USERAUTH_FAILURE;
}
}