aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-08-19 19:53:16 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-08-19 19:53:16 +0200
commitb3067e362c68210c65bed6d4bd17214a0db0da91 (patch)
tree23d97bd873fb7cafbf0a4a39213239507f82a3aa
parent5f99fed07c8dbd6fe93b3bf1f11a5e3fd01e325a (diff)
downloadlibssh-b3067e362c68210c65bed6d4bd17214a0db0da91.tar.gz
libssh-b3067e362c68210c65bed6d4bd17214a0db0da91.tar.xz
libssh-b3067e362c68210c65bed6d4bd17214a0db0da91.zip
Obsoletes ssh_auth_list, comment ssh_userauth_list
Conflicts: libssh/auth.c
-rw-r--r--libssh/auth.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/libssh/auth.c b/libssh/auth.c
index b4755f47..b4705204 100644
--- a/libssh/auth.c
+++ b/libssh/auth.c
@@ -170,24 +170,33 @@ static int wait_auth_status(ssh_session session, int kbdint) {
return rc;
}
+/**
+ * @brief retrieves available authentication methods for this session
+ * @obsolete
+ * @see ssh_userauth_list
+ */
int ssh_auth_list(ssh_session session) {
- if (session == NULL) {
- return -1;
- }
-
- return session->auth_methods;
+ 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 || username == NULL) {
+ if (session == 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 */