1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-08 19:02:06 +03:00

auth: Make ssh_userauth_try_publickey() legacy.

This commit is contained in:
Andreas Schneider
2011-08-23 19:01:22 +02:00
parent 37df5e17c3
commit aa018c1484
5 changed files with 26 additions and 156 deletions

View File

@@ -40,6 +40,26 @@ int ssh_auth_list(ssh_session session) {
return ssh_userauth_list(session, NULL);
}
int ssh_userauth_offer_pubkey(ssh_session session, const char *username,
int type, ssh_string publickey)
{
ssh_key key;
int rc;
(void) type; /* unused */
rc = ssh_pki_import_pubkey_blob(publickey, &key);
if (rc < 0) {
ssh_set_error(session, SSH_FATAL, "Failed to convert public key");
return SSH_AUTH_ERROR;
}
rc = ssh_userauth_try_publickey(session, username, key);
ssh_key_free(key);
return rc;
}
/* BUFFER FUNCTIONS */
void buffer_free(ssh_buffer buffer){