aboutsummaryrefslogtreecommitdiff
path: root/src/known_hosts.c
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2015-09-17 09:43:33 +0200
committerFabiano FidĂȘncio <fidencio@redhat.com>2016-01-19 11:31:07 +0100
commitadc8c20ac17b39e32e6ac9e8913ebeeb1c5b8081 (patch)
tree1bcd7318e12a316d4908b7eee4914bad7e2db80b /src/known_hosts.c
parent63e52afd5b9a378918ea3591e2da8fe78c201407 (diff)
downloadlibssh-adc8c20ac17b39e32e6ac9e8913ebeeb1c5b8081.tar.gz
libssh-adc8c20ac17b39e32e6ac9e8913ebeeb1c5b8081.tar.xz
libssh-adc8c20ac17b39e32e6ac9e8913ebeeb1c5b8081.zip
cleanup: use ssh_ prefix in the buffer (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>
Diffstat (limited to 'src/known_hosts.c')
-rw-r--r--src/known_hosts.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/known_hosts.c b/src/known_hosts.c
index d87af431..263289fe 100644
--- a/src/known_hosts.c
+++ b/src/known_hosts.c
@@ -211,7 +211,7 @@ static int check_public_key(ssh_session session, char **tokens) {
return -1;
}
- if (buffer_add_ssh_string(pubkey_buffer, tmpstring) < 0) {
+ if (ssh_buffer_add_ssh_string(pubkey_buffer, tmpstring) < 0) {
ssh_buffer_free(pubkey_buffer);
ssh_string_free(tmpstring);
return -1;
@@ -244,7 +244,7 @@ static int check_public_key(ssh_session session, char **tokens) {
bignum_bn2bin(tmpbn, ssh_string_data(tmpstring));
#endif
bignum_free(tmpbn);
- if (buffer_add_ssh_string(pubkey_buffer, tmpstring) < 0) {
+ if (ssh_buffer_add_ssh_string(pubkey_buffer, tmpstring) < 0) {
ssh_buffer_free(pubkey_buffer);
ssh_string_free(tmpstring);
bignum_free(tmpbn);
@@ -264,14 +264,14 @@ static int check_public_key(ssh_session session, char **tokens) {
return -1;
}
- if (buffer_get_rest_len(pubkey_buffer) != ssh_string_len(pubkey)) {
+ if (ssh_buffer_get_rest_len(pubkey_buffer) != ssh_string_len(pubkey)) {
ssh_buffer_free(pubkey_buffer);
return 0;
}
/* now test that they are identical */
- if (memcmp(buffer_get_rest(pubkey_buffer), ssh_string_data(pubkey),
- buffer_get_rest_len(pubkey_buffer)) != 0) {
+ if (memcmp(ssh_buffer_get_rest(pubkey_buffer), ssh_string_data(pubkey),
+ ssh_buffer_get_rest_len(pubkey_buffer)) != 0) {
ssh_buffer_free(pubkey_buffer);
return 0;
}
@@ -340,7 +340,7 @@ static int match_hashed_host(const char *host, const char *sourcehash)
return 0;
}
- mac = hmac_init(buffer_get_rest(salt), buffer_get_rest_len(salt), SSH_HMAC_SHA1);
+ mac = hmac_init(ssh_buffer_get_rest(salt), ssh_buffer_get_rest_len(salt), SSH_HMAC_SHA1);
if (mac == NULL) {
ssh_buffer_free(salt);
ssh_buffer_free(hash);
@@ -351,8 +351,8 @@ static int match_hashed_host(const char *host, const char *sourcehash)
hmac_update(mac, host, strlen(host));
hmac_final(mac, buffer, &size);
- if (size == buffer_get_rest_len(hash) &&
- memcmp(buffer, buffer_get_rest(hash), size) == 0) {
+ if (size == ssh_buffer_get_rest_len(hash) &&
+ memcmp(buffer, ssh_buffer_get_rest(hash), size) == 0) {
match = 1;
} else {
match = 0;