www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: libssh2_userauth_password return value

libssh2_userauth_password return value

From: <cosmin_at_5ivestars.net>
Date: Wed, 17 Apr 2013 01:00:04 -0700

If the authentication fails for a couple of times (libssh2_userauth_password() returns LIBSSH2_ERROR_AUTHENTICATION_FAILED) and the server closes the connection because of too many authentication failures libssh2_userauth_password() returns LIBSSH2_ERROR_TIMEOUT but in this case it should return LIBSSH2_ERROR_SOCKET_DISCONNECT.


        if (session->userauth_pswd_state == libssh2_NB_state_sent) {
            rc = _libssh2_packet_requirev(session, reply_codes,
                                          0, NULL, 0,
            if (rc == LIBSSH2_ERROR_EAGAIN) {
                return _libssh2_error(session, LIBSSH2_ERROR_EAGAIN,
                                      "Would block waiting");
            } else if (rc) {
                session->userauth_pswd_state = libssh2_NB_state_idle;
                return _libssh2_error(session, LIBSSH2_ERROR_TIMEOUT,
                                      "Would block waiting");

I think it should return the actual error from the transport layer and not a "general" LIBSSH2_ERROR_TIMEOUT error.

libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2013-04-17

the libssh2 team