summaryrefslogtreecommitdiffstats
path: root/libssh/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'libssh/auth.c')
-rw-r--r--libssh/auth.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/libssh/auth.c b/libssh/auth.c
index 9349cc72..409917fa 100644
--- a/libssh/auth.c
+++ b/libssh/auth.c
@@ -45,19 +45,23 @@
/** \addtogroup ssh_auth
* @{ */
+/**
+ * @internal
+ * @brief ask access to the ssh-userauth service
+ * @param session SSH session handle
+ * @returns SSH_OK on success
+ * @returns SSH_ERROR on error
+ * @bug current implementation is blocking
+ */
static int ask_userauth(ssh_session session) {
int rc = 0;
enter_function();
-
- if (session->auth_service_asked) {
- rc = 0;
- } else if (ssh_service_request(session,"ssh-userauth")) {
- rc = -1;
- } else {
- session->auth_service_asked++;
- }
-
+ do {
+ rc=ssh_service_request(session,"ssh-userauth");
+ if(rc==SSH_AGAIN)
+ ssh_handle_packets(session);
+ } while(rc==SSH_AGAIN);
leave_function();
return rc;
}