aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2015-09-17 13:32:44 +0200
committerFabiano FidĂȘncio <fidencio@redhat.com>2016-01-19 11:31:07 +0100
commit1102ea4c5551d0aa55e8f4cdd2a82741e8b16aad (patch)
treec0f7c5a646b79975a6d1e1e4980c186edad43fb7
parentc487f5db5b75cee9aa61a4941bacb060d6c94a7c (diff)
downloadlibssh-1102ea4c5551d0aa55e8f4cdd2a82741e8b16aad.tar.gz
libssh-1102ea4c5551d0aa55e8f4cdd2a82741e8b16aad.tar.xz
libssh-1102ea4c5551d0aa55e8f4cdd2a82741e8b16aad.zip
cleanup: use ssh_ prefix in the kex (non-static) functions
Having "ssh_" prefix in the functions' name will avoid possible clashes when compiling libssh statically. Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--include/libssh/kex.h6
-rw-r--r--src/client.c2
-rw-r--r--src/kex.c8
-rw-r--r--src/known_hosts.c2
-rw-r--r--src/options.c2
5 files changed, 10 insertions, 10 deletions
diff --git a/include/libssh/kex.h b/include/libssh/kex.h
index 1a5b6d41..e872bde1 100644
--- a/include/libssh/kex.h
+++ b/include/libssh/kex.h
@@ -38,10 +38,10 @@ SSH_PACKET_CALLBACK(ssh_packet_publickey1);
int ssh_send_kex(ssh_session session, int server_kex);
void ssh_list_kex(struct ssh_kex_struct *kex);
-int set_client_kex(ssh_session session);
+int ssh_set_client_kex(ssh_session session);
int ssh_kex_select_methods(ssh_session session);
-int verify_existing_algo(int algo, const char *name);
-char **space_tokenize(const char *chain);
+int ssh_verify_existing_algo(int algo, const char *name);
+char **ssh_space_tokenize(const char *chain);
int ssh_get_kex1(ssh_session session);
char *ssh_find_matching(const char *in_d, const char *what_d);
const char *ssh_kex_get_supported_method(uint32_t algo);
diff --git a/src/client.c b/src/client.c
index 64ce5dec..0c2b7e4f 100644
--- a/src/client.c
+++ b/src/client.c
@@ -399,7 +399,7 @@ static void ssh_client_connection_callback(ssh_session session){
case SSH_SESSION_STATE_KEXINIT_RECEIVED:
set_status(session,0.6f);
ssh_list_kex(&session->next_crypto->server_kex);
- if (set_client_kex(session) < 0) {
+ if (ssh_set_client_kex(session) < 0) {
goto error;
}
if (ssh_kex_select_methods(session) == SSH_ERROR)
diff --git a/src/kex.c b/src/kex.c
index 497c67af..55b83189 100644
--- a/src/kex.c
+++ b/src/kex.c
@@ -172,7 +172,7 @@ static char **tokenize(const char *chain){
/* same as tokenize(), but with spaces instead of ',' */
/* TODO FIXME rewrite me! */
-char **space_tokenize(const char *chain){
+char **ssh_space_tokenize(const char *chain){
char **tokens;
int n=1;
int i=0;
@@ -512,7 +512,7 @@ static char *ssh_client_select_hostkeys(ssh_session session){
for (i=0;preferred_hostkeys[i] != NULL; ++i){
for (j=0; methods[j] != NULL; ++j){
if(strcmp(preferred_hostkeys[i], methods[j]) == 0){
- if (verify_existing_algo(SSH_HOSTKEYS, methods[j])){
+ if (ssh_verify_existing_algo(SSH_HOSTKEYS, methods[j])){
if(needcoma)
strncat(methods_buffer,",",sizeof(methods_buffer)-strlen(methods_buffer)-1);
strncat(methods_buffer, methods[j], sizeof(methods_buffer)-strlen(methods_buffer)-1);
@@ -539,7 +539,7 @@ static char *ssh_client_select_hostkeys(ssh_session session){
* @brief sets the key exchange parameters to be sent to the server,
* in function of the options and available methods.
*/
-int set_client_kex(ssh_session session){
+int ssh_set_client_kex(ssh_session session){
struct ssh_kex_struct *client= &session->next_crypto->client_kex;
const char *wanted;
int i;
@@ -656,7 +656,7 @@ error:
}
/* returns 1 if at least one of the name algos is in the default algorithms table */
-int verify_existing_algo(int algo, const char *name){
+int ssh_verify_existing_algo(int algo, const char *name){
char *ptr;
if(algo>9 || algo <0)
return -1;
diff --git a/src/known_hosts.c b/src/known_hosts.c
index 263289fe..32f795a0 100644
--- a/src/known_hosts.c
+++ b/src/known_hosts.c
@@ -134,7 +134,7 @@ static char **ssh_get_knownhost_line(FILE **file, const char *filename,
continue; /* skip empty lines */
}
- tokens = space_tokenize(buffer);
+ tokens = ssh_space_tokenize(buffer);
if (tokens == NULL) {
fclose(*file);
*file = NULL;
diff --git a/src/options.c b/src/options.c
index e715c09d..70b4ca5e 100644
--- a/src/options.c
+++ b/src/options.c
@@ -164,7 +164,7 @@ int ssh_options_copy(ssh_session src, ssh_session *dest) {
int ssh_options_set_algo(ssh_session session, int algo,
const char *list) {
- if (!verify_existing_algo(algo, list)) {
+ if (!ssh_verify_existing_algo(algo, list)) {
ssh_set_error(session, SSH_REQUEST_DENIED,
"Setting method: no algorithm for method \"%s\" (%s)\n",
ssh_kex_get_description(algo), list);