From 310c41a89a91a44b4e63c19bc2f35e8b2d28827d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 17 Sep 2015 13:47:00 +0200 Subject: [PATCH] cleanup: use ssh_ prefix in the gcrypt missing functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Having "ssh_" prefix in the functions' name will avoid possible clashes when compiling libssh statically. Signed-off-by: Fabiano FidĂȘncio Reviewed-by: Andreas Schneider --- include/libssh/libgcrypt.h | 8 ++++---- src/gcrypt_missing.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/libssh/libgcrypt.h b/include/libssh/libgcrypt.h index 8e52a681..7b97c7f8 100644 --- a/include/libssh/libgcrypt.h +++ b/include/libssh/libgcrypt.h @@ -52,15 +52,15 @@ typedef void *EVPCTX; typedef gcry_mpi_t bignum; /* missing gcrypt functions */ -int my_gcry_dec2bn(bignum *bn, const char *data); -char *my_gcry_bn2dec(bignum bn); +int ssh_gcry_dec2bn(bignum *bn, const char *data); +char *ssh_gcry_bn2dec(bignum bn); #define bignum_new() gcry_mpi_new(0) #define bignum_free(num) gcry_mpi_release(num) #define bignum_set_word(bn,n) gcry_mpi_set_ui(bn,n) #define bignum_bin2bn(bn,datalen,data) gcry_mpi_scan(data,GCRYMPI_FMT_USG,bn,datalen,NULL) -#define bignum_bn2dec(num) my_gcry_bn2dec(num) -#define bignum_dec2bn(num, data) my_gcry_dec2bn(data, num) +#define bignum_bn2dec(num) ssh_gcry_bn2dec(num) +#define bignum_dec2bn(num, data) ssh_gcry_dec2bn(data, num) #define bignum_bn2hex(num,data) gcry_mpi_aprint(GCRYMPI_FMT_HEX,data,NULL,num) #define bignum_hex2bn(num,datalen,data) gcry_mpi_scan(num,GCRYMPI_FMT_HEX,data,datalen,NULL) #define bignum_rand(num,bits) gcry_mpi_randomize(num,bits,GCRY_STRONG_RANDOM),gcry_mpi_set_bit(num,bits-1),gcry_mpi_set_bit(num,0) diff --git a/src/gcrypt_missing.c b/src/gcrypt_missing.c index b21e5f30..e07843b8 100644 --- a/src/gcrypt_missing.c +++ b/src/gcrypt_missing.c @@ -27,7 +27,7 @@ #include "libssh/libgcrypt.h" #ifdef HAVE_LIBGCRYPT -int my_gcry_dec2bn(bignum *bn, const char *data) { +int ssh_gcry_dec2bn(bignum *bn, const char *data) { int count; *bn = bignum_new(); @@ -43,7 +43,7 @@ int my_gcry_dec2bn(bignum *bn, const char *data) { return count; } -char *my_gcry_bn2dec(bignum bn) { +char *ssh_gcry_bn2dec(bignum bn) { bignum bndup, num, ten; char *ret; int count, count2;