[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Renamed function: ssh_get_publickey() to ssh_get_server_publickey()


From fb00dcf62c77cc02ed82a03d804d2d9b62a1f25a Mon Sep 17 00:00:00 2001
From: Younes Serraj <younes.serraj@xxxxxxxxx>
Date: Sun, 24 Jan 2016 19:23:26 +0100
Subject: [PATCH] Renamed function: ssh_get_publickey() to
 ssh_get_server_publickey()

Renamed the ssh_get_publickey() function to make clear what it does.

The documentation already says that this function extracts the server's
public key, but making the function name say so makes code easier to
understand.

Signed-off-by: Younes Serraj <younes.serraj@xxxxxxxxx>
---
 examples/knownhosts.c   | 2 +-
 include/libssh/libssh.h | 2 +-
 src/dh.c                | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/knownhosts.c b/examples/knownhosts.c
index 5097cd9..cbca7e0 100644
--- a/examples/knownhosts.c
+++ b/examples/knownhosts.c
@@ -40,7 +40,7 @@ int verify_knownhost(ssh_session session){
 
   state=ssh_is_server_known(session);
 
-  rc = ssh_get_publickey(session, &srv_pubkey);
+  rc = ssh_get_server_publickey(session, &srv_pubkey);
   if (rc < 0) {
       return -1;
   }
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index 0cd4bdc..4a45c4a 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -444,7 +444,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,
diff --git a/src/dh.c b/src/dh.c
index 1291c5f..a835a0c 100644
--- a/src/dh.c
+++ b/src/dh.c
@@ -949,7 +949,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 ||
-- 
2.7.0.rc3


Archive administrator: postmaster@lists.cynapses.org