diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-08-23 19:01:22 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-08-23 21:54:02 +0200 |
commit | aa018c1484ce053bf88dbe066988b5e39a2c0317 (patch) | |
tree | e33235f8ab9ea59af7d361a3655a1e5ea2f81aeb /src/legacy.c | |
parent | 37df5e17c310c438eefaf5150bad55ad12a7d64f (diff) | |
download | libssh-aa018c1484ce053bf88dbe066988b5e39a2c0317.tar.gz libssh-aa018c1484ce053bf88dbe066988b5e39a2c0317.tar.xz libssh-aa018c1484ce053bf88dbe066988b5e39a2c0317.zip |
auth: Make ssh_userauth_try_publickey() legacy.
Diffstat (limited to 'src/legacy.c')
-rw-r--r-- | src/legacy.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/legacy.c b/src/legacy.c index cfe8bc0..58ee1be 100644 --- a/src/legacy.c +++ b/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){ |