lavf/libssh: call ssh_userauth_none before ssh_userauth_list
authorLukasz Marek <lukasz.m.luki2@gmail.com>
Fri, 4 Jul 2014 17:50:13 +0000 (19:50 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 4 Jul 2014 18:30:48 +0000 (20:30 +0200)
According to doc, ssh_userauth_none must be called before ssh_userauth_list.
It solves login issue for new versions of libssh.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/libssh.c

index b20e93b..87a2a7f 100644 (file)
@@ -71,6 +71,9 @@ static av_cold int libssh_authentication(LIBSSHContext *libssh, const char *user
     if (user)
         ssh_options_set(libssh->session, SSH_OPTIONS_USER, user);
 
+    if (ssh_userauth_none(libssh->session, NULL) == SSH_AUTH_SUCCESS)
+        return 0;
+
     auth_methods = ssh_userauth_list(libssh->session, NULL);
 
     if (auth_methods & SSH_AUTH_METHOD_PUBLICKEY) {