From bbd0522026671db6b98ac09d6caefba11cbca051 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 2 May 2016 06:27:40 +0200 Subject: [PATCH] dh: Rename ssh_get_publickey() to ssh_get_server_publickey() Signed-off-by: Andreas Schneider --- include/libssh/libssh.h | 3 ++- src/dh.c | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index 6d45e4df..ac5418ca 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -445,7 +445,7 @@ LIBSSH_API char *ssh_get_hexa(const unsigned char *what, size_t len); LIBSSH_API char *ssh_get_issue_banner(ssh_session session); LIBSSH_API int ssh_get_openssh_version(ssh_session session); -LIBSSH_API int ssh_get_publickey(ssh_session session, ssh_key *key); +LIBSSH_API int ssh_get_server_publickey(ssh_session session, ssh_key *key); enum ssh_publickey_hash_type { SSH_PUBLICKEY_HASH_SHA1, @@ -461,6 +461,7 @@ SSH_DEPRECATED LIBSSH_API int ssh_get_pubkey_hash(ssh_session session, unsigned SSH_DEPRECATED LIBSSH_API ssh_channel ssh_forward_accept(ssh_session session, int timeout_ms); SSH_DEPRECATED LIBSSH_API int ssh_forward_cancel(ssh_session session, const char *address, int port); SSH_DEPRECATED LIBSSH_API int ssh_forward_listen(ssh_session session, const char *address, int port, int *bound_port); +SSH_DEPRECATED LIBSSH_API int ssh_get_publickey(ssh_session session, ssh_key *key); LIBSSH_API int ssh_get_random(void *where,int len,int strong); diff --git a/src/dh.c b/src/dh.c index 0c57d76d..0177ab76 100644 --- a/src/dh.c +++ b/src/dh.c @@ -961,7 +961,7 @@ void ssh_clean_pubkey_hash(unsigned char **hash) { * * @see ssh_key_free() */ -int ssh_get_publickey(ssh_session session, ssh_key *key) +int ssh_get_server_publickey(ssh_session session, ssh_key *key) { if (session==NULL || session->current_crypto ==NULL || @@ -973,6 +973,14 @@ int ssh_get_publickey(ssh_session session, ssh_key *key) key); } +/** + * @deprecated Use ssh_get_server_publickey() + */ +int ssh_get_publickey(ssh_session session, ssh_key *key) +{ + return ssh_get_server_publickey(session, key); +} + /** * @brief Allocates a buffer with the hash of the public key. *