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:
20
src/legacy.c
20
src/legacy.c
@@ -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){
|
||||
|
Reference in New Issue
Block a user