1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

Improve ssh_userauth_kbdint_getprompt.

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@645 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
Andreas Schneider
2009-04-29 10:53:23 +00:00
parent 5fdcd4df7b
commit 3024e3652f

View File

@@ -1366,22 +1366,32 @@ char *ssh_userauth_kbdint_getinstruction(SSH_SESSION *session) {
return session->kbdint->instruction;
}
/** You have called ssh_userauth_kbdint() and got SSH_AUTH_INFO. this
* function returns the questions from the server
* \brief get a prompt from a message block
* \param session ssh session
* \param i index number of the ith prompt
* \param echo when different of NULL, it will obtain a boolean meaning that the
* resulting user input should be echoed or not (like passwords)
* \returns pointer to the prompt. Do not free it
/**
* @brief Get a prompt from a message block.
*
* You have called ssh_userauth_kbdint() and got SSH_AUTH_INFO. This
* function returns the questions from the server.
*
* @param session The ssh session to use.
*
* @param i The inndex number of the i'th prompt.
*
* @param echo When different of NULL, it will obtain a boolean meaning
* that the resulting user input should be echoed or not
* (like passwords).
*
* @returns A pointer to the prompt. Do not free it.
*/
char *ssh_userauth_kbdint_getprompt(SSH_SESSION *session, unsigned int i,
char *echo) {
if(i > session->kbdint->nprompts)
if (i > session->kbdint->nprompts) {
return NULL;
if(echo)
}
if (echo) {
*echo = session->kbdint->echo[i];
}
return session->kbdint->prompts[i];
}