aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-08-19 19:51:18 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-08-19 19:51:18 +0200
commit1e75841036719b50683452b4a47185e7b87e8e3e (patch)
tree895132b5572f31109051adb7fbaec26e51a2d73b /libssh
parent32bf28e7effc009ad4f76f4c75b2b216cf2b4d4f (diff)
downloadlibssh-1e75841036719b50683452b4a47185e7b87e8e3e.tar.gz
libssh-1e75841036719b50683452b4a47185e7b87e8e3e.tar.xz
libssh-1e75841036719b50683452b4a47185e7b87e8e3e.zip
Obsoletes ssh_auth_list, comment ssh_userauth_list
Diffstat (limited to 'libssh')
-rw-r--r--libssh/auth.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/libssh/auth.c b/libssh/auth.c
index 6045c12..dfc7b0f 100644
--- a/libssh/auth.c
+++ b/libssh/auth.c
@@ -248,28 +248,38 @@ static int wait_auth_status(ssh_session session) {
return rc;
}
+/**
+ * @brief retrieves available authentication methods for this session
+ * @obsolete
+ * @see ssh_userauth_list
+ */
int ssh_auth_list(ssh_session session) {
+ return ssh_userauth_list(session, NULL);
+}
+
+/**
+ * @brief retrieves available authentication methods for this session
+ * @param[in] session the SSH session
+ * @param[in] username set to NULL
+ * @returns A bitfield of values SSH_AUTH_METHOD_NONE, SSH_AUTH_METHOD_PASSWORD,
+ SSH_AUTH_METHOD_PUBLICKEY, SSH_AUTH_METHOD_HOSTBASED,
+ SSH_AUTH_METHOD_INTERACTIVE.
+ @warning Other reserved flags may appear in future versions.
+ */
+int ssh_userauth_list(ssh_session session, const char *username) {
if (session == NULL) {
- return -1;
+ return SSH_AUTH_ERROR;
}
+
#ifdef WITH_SSH1
if(session->version==1){
return SSH_AUTH_METHOD_PASSWORD;
}
#endif
- return session->auth_methods;
-}
-
-int ssh_userauth_list(ssh_session session, const char *username) {
- if (session == NULL || username == NULL) {
- return SSH_AUTH_ERROR;
- }
-
if (session->auth_methods == 0) {
ssh_userauth_none(session, username);
}
-
- return ssh_auth_list(session);
+ return session->auth_methods;
}
/* use the "none" authentication question */