aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-08-23 16:11:46 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-08-23 21:54:01 +0200
commit058bb0439682b72ae0f929566beb04218fc08001 (patch)
tree0bf6cc99e797bff4ae8a8daafc045962b04adb9c
parentdc9feec0051c9c07ec2a2ea3bbc5b7ad4c8eae06 (diff)
downloadlibssh-058bb0439682b72ae0f929566beb04218fc08001.tar.gz
libssh-058bb0439682b72ae0f929566beb04218fc08001.tar.xz
libssh-058bb0439682b72ae0f929566beb04218fc08001.zip
auth: Rename ask_userauth.
-rw-r--r--src/auth.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/auth.c b/src/auth.c
index 3b7632f..7422577 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -62,10 +62,10 @@
* @returns SSH_AGAIN on nonblocking mode, if calling that function
* again is necessary
*/
-static int ask_userauth(ssh_session session) {
- int rc = 0;
+static int ssh_userauth_request_service(ssh_session session)
+{
+ int rc = SSH_OK;
- enter_function();
do {
rc = ssh_service_request(session,"ssh-userauth");
if (ssh_is_blocking(session)) {
@@ -78,7 +78,7 @@ static int ask_userauth(ssh_session session) {
break;
}
} while (rc == SSH_AGAIN);
- leave_function();
+
return rc;
}
@@ -402,7 +402,7 @@ int ssh_userauth_none(ssh_session session, const char *username) {
rc=SSH_ERROR;
}
- err = ask_userauth(session);
+ err = ssh_userauth_request_service(session);
if(err == SSH_AGAIN){
rc=SSH_AUTH_AGAIN;
ssh_string_free(user);
@@ -542,7 +542,7 @@ int ssh_userauth_offer_pubkey(ssh_session session, const char *username,
rc=SSH_ERROR;
}
- rc = ask_userauth(session);
+ rc = ssh_userauth_request_service(session);
if(rc == SSH_AGAIN){
rc=SSH_AUTH_AGAIN;
ssh_string_free(user);
@@ -692,7 +692,8 @@ int ssh_userauth_pubkey(ssh_session session, const char *username,
rc=SSH_ERROR;
}
- if (ask_userauth(session) < 0) {
+ rc = ssh_userauth_request_service(session);
+ if (rc < 0) {
ssh_string_free(user);
leave_function();
return rc;
@@ -873,7 +874,8 @@ int ssh_userauth_pki_pubkey(ssh_session session, const char *username,
rc = SSH_ERROR;
}
- if (ask_userauth(session) < 0) {
+ rc = ssh_userauth_request_service(session);
+ if (rc < 0) {
ssh_string_free(user);
leave_function();
return rc;
@@ -1096,7 +1098,8 @@ int ssh_userauth_agent_pubkey(ssh_session session, const char *username,
return rc;
}
- if (ask_userauth(session) < 0) {
+ rc = ssh_userauth_request_service(session);
+ if (rc < 0) {
ssh_string_free(user);
leave_function();
return rc;
@@ -1247,7 +1250,7 @@ int ssh_userauth_password(ssh_session session, const char *username,
rc=SSH_ERROR;
}
- err = ask_userauth(session);
+ err = ssh_userauth_request_service(session);
if(err == SSH_AGAIN){
rc=SSH_AUTH_AGAIN;
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();
return SSH_AUTH_ERROR;
}