mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
auth: Rename ask_userauth.
This commit is contained in:
26
src/auth.c
26
src/auth.c
@@ -62,10 +62,10 @@
|
|||||||
* @returns SSH_AGAIN on nonblocking mode, if calling that function
|
* @returns SSH_AGAIN on nonblocking mode, if calling that function
|
||||||
* again is necessary
|
* again is necessary
|
||||||
*/
|
*/
|
||||||
static int ask_userauth(ssh_session session) {
|
static int ssh_userauth_request_service(ssh_session session)
|
||||||
int rc = 0;
|
{
|
||||||
|
int rc = SSH_OK;
|
||||||
|
|
||||||
enter_function();
|
|
||||||
do {
|
do {
|
||||||
rc = ssh_service_request(session,"ssh-userauth");
|
rc = ssh_service_request(session,"ssh-userauth");
|
||||||
if (ssh_is_blocking(session)) {
|
if (ssh_is_blocking(session)) {
|
||||||
@@ -78,7 +78,7 @@ static int ask_userauth(ssh_session session) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (rc == SSH_AGAIN);
|
} while (rc == SSH_AGAIN);
|
||||||
leave_function();
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,7 +402,7 @@ int ssh_userauth_none(ssh_session session, const char *username) {
|
|||||||
rc=SSH_ERROR;
|
rc=SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ask_userauth(session);
|
err = ssh_userauth_request_service(session);
|
||||||
if(err == SSH_AGAIN){
|
if(err == SSH_AGAIN){
|
||||||
rc=SSH_AUTH_AGAIN;
|
rc=SSH_AUTH_AGAIN;
|
||||||
ssh_string_free(user);
|
ssh_string_free(user);
|
||||||
@@ -542,7 +542,7 @@ int ssh_userauth_offer_pubkey(ssh_session session, const char *username,
|
|||||||
rc=SSH_ERROR;
|
rc=SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = ask_userauth(session);
|
rc = ssh_userauth_request_service(session);
|
||||||
if(rc == SSH_AGAIN){
|
if(rc == SSH_AGAIN){
|
||||||
rc=SSH_AUTH_AGAIN;
|
rc=SSH_AUTH_AGAIN;
|
||||||
ssh_string_free(user);
|
ssh_string_free(user);
|
||||||
@@ -692,7 +692,8 @@ int ssh_userauth_pubkey(ssh_session session, const char *username,
|
|||||||
rc=SSH_ERROR;
|
rc=SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ask_userauth(session) < 0) {
|
rc = ssh_userauth_request_service(session);
|
||||||
|
if (rc < 0) {
|
||||||
ssh_string_free(user);
|
ssh_string_free(user);
|
||||||
leave_function();
|
leave_function();
|
||||||
return rc;
|
return rc;
|
||||||
@@ -873,7 +874,8 @@ int ssh_userauth_pki_pubkey(ssh_session session, const char *username,
|
|||||||
rc = SSH_ERROR;
|
rc = SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ask_userauth(session) < 0) {
|
rc = ssh_userauth_request_service(session);
|
||||||
|
if (rc < 0) {
|
||||||
ssh_string_free(user);
|
ssh_string_free(user);
|
||||||
leave_function();
|
leave_function();
|
||||||
return rc;
|
return rc;
|
||||||
@@ -1096,7 +1098,8 @@ int ssh_userauth_agent_pubkey(ssh_session session, const char *username,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ask_userauth(session) < 0) {
|
rc = ssh_userauth_request_service(session);
|
||||||
|
if (rc < 0) {
|
||||||
ssh_string_free(user);
|
ssh_string_free(user);
|
||||||
leave_function();
|
leave_function();
|
||||||
return rc;
|
return rc;
|
||||||
@@ -1247,7 +1250,7 @@ int ssh_userauth_password(ssh_session session, const char *username,
|
|||||||
rc=SSH_ERROR;
|
rc=SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ask_userauth(session);
|
err = ssh_userauth_request_service(session);
|
||||||
if(err == SSH_AGAIN){
|
if(err == SSH_AGAIN){
|
||||||
rc=SSH_AUTH_AGAIN;
|
rc=SSH_AUTH_AGAIN;
|
||||||
ssh_string_free(user);
|
ssh_string_free(user);
|
||||||
@@ -1931,7 +1934,8 @@ int ssh_userauth_kbdint(ssh_session session, const char *user,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ask_userauth(session)) {
|
rc = ssh_userauth_request_service(session);
|
||||||
|
if (rc != SSH_OK) {
|
||||||
leave_function();
|
leave_function();
|
||||||
return SSH_AUTH_ERROR;
|
return SSH_AUTH_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user