~ubuntu-branches/ubuntu/quantal/libssh/quantal

« back to all changes in this revision

Viewing changes to libssh/auth.c

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville
  • Date: 2011-03-13 22:06:00 UTC
  • mfrom: (1.1.9 upstream) (4.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110313220600-bbqbkcj8zelnfbbo
Tags: 0.4.8-2
* Upload to unstable
* debian/control: Add texlive-fonts-recommended to Build-Depends-Indep
  (Closes: #608319)

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
  return rc;
171
171
}
172
172
 
 
173
/**
 
174
 * @brief retrieves available authentication methods for this session
 
175
 * @deprecated
 
176
 * @see ssh_userauth_list
 
177
 */
173
178
int ssh_auth_list(ssh_session session) {
 
179
  return ssh_userauth_list(session, NULL);
 
180
}
 
181
 
 
182
/**
 
183
 * @brief retrieves available authentication methods for this session
 
184
 * @param[in] session the SSH session
 
185
 * @param[in] username set to NULL
 
186
 * @returns A bitfield of values SSH_AUTH_METHOD_NONE, SSH_AUTH_METHOD_PASSWORD,
 
187
            SSH_AUTH_METHOD_PUBLICKEY, SSH_AUTH_METHOD_HOSTBASED,
 
188
            SSH_AUTH_METHOD_INTERACTIVE.
 
189
   @warning Other reserved flags may appear in future versions.
 
190
 */
 
191
int ssh_userauth_list(ssh_session session, const char *username) {
174
192
  if (session == NULL) {
175
 
    return -1;
176
 
  }
177
 
 
178
 
  return session->auth_methods;
179
 
}
180
 
 
181
 
int ssh_userauth_list(ssh_session session, const char *username) {
182
 
  if (session == NULL || username == NULL) {
183
193
    return SSH_AUTH_ERROR;
184
194
  }
185
195
 
186
196
  if (session->auth_methods == 0) {
187
197
    ssh_userauth_none(session, username);
188
198
  }
189
 
 
190
 
  return ssh_auth_list(session);
 
199
  return session->auth_methods;
191
200
}
192
201
 
193
202
/* use the "none" authentication question */