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>
This commit is contained in:
Fabiano Fidêncio
2015-09-17 09:43:33 +02:00
parent 63e52afd5b
commit adc8c20ac1
30 changed files with 494 additions and 494 deletions

View File

@@ -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;