mirror of https://github.com/wolfSSL/wolfssh.git
Fix keyboard-interactive without TERM
Keyboard-interactive was unusable in builds with WOLFSSH_KEYBOARD_INTERACTIVE but no WOLFSSH_TERM, in two ways. - ClientFreeBuffers declared 'entry' under TERM && KBI but used it under KBI alone, so KBI-without-TERM failed to compile; widen the declaration guard to match the use - ClientUserAuth's keyboard-interactive branch is guarded on TERM && KBI, so without TERM a keyboard-interactive request fell past every branch and returned the initial WOLFSSH_USERAUTH_SUCCESS with no responses populated. There is no terminal to prompt on, so answer WOLFSSH_USERAUTH_FAILURE instead of claiming success.pull/1051/head
parent
a2a78da28a
commit
ac762368ac
|
|
@ -606,6 +606,12 @@ int ClientUserAuth(byte authType,
|
|||
}
|
||||
}
|
||||
}
|
||||
#elif defined(WOLFSSH_KEYBOARD_INTERACTIVE)
|
||||
else if (authType == WOLFSSH_USERAUTH_KEYBOARD) {
|
||||
/* Without a terminal there is nowhere to prompt for the responses, so
|
||||
* this build cannot answer a keyboard-interactive request. */
|
||||
ret = WOLFSSH_USERAUTH_FAILURE;
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -1118,7 +1124,7 @@ int ClientLoadCA(WOLFSSH_CTX* ctx, const char* caCert)
|
|||
void ClientFreeBuffers(const char* pubKeyName, const char* privKeyName,
|
||||
void* heap)
|
||||
{
|
||||
#if defined(WOLFSSH_TERM) && defined(WOLFSSH_KEYBOARD_INTERACTIVE)
|
||||
#ifdef WOLFSSH_KEYBOARD_INTERACTIVE
|
||||
word32 entry;
|
||||
#endif
|
||||
#ifdef WOLFSSH_TPM
|
||||
|
|
|
|||
Loading…
Reference in New Issue