aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-09-17 18:36:17 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-09-18 21:37:17 +0200
commitffb827b539635236c2c46804a899999949c07187 (patch)
tree8094f4c1a8bfe32a6b92dc9b0bcc1d17c33179f8
parent33754c391f34e3aa80ff6eeccf93db3d5e446496 (diff)
downloadlibssh-ffb827b539635236c2c46804a899999949c07187.tar.gz
libssh-ffb827b539635236c2c46804a899999949c07187.tar.xz
libssh-ffb827b539635236c2c46804a899999949c07187.zip
priv: Move gcrypt functions to gcrypt header.
-rw-r--r--include/libssh/libgcrypt.h5
-rw-r--r--include/libssh/priv.h6
-rw-r--r--src/gcrypt_missing.c2
3 files changed, 6 insertions, 7 deletions
diff --git a/include/libssh/libgcrypt.h b/include/libssh/libgcrypt.h
index c4b0dc00..b8704d53 100644
--- a/include/libssh/libgcrypt.h
+++ b/include/libssh/libgcrypt.h
@@ -43,6 +43,10 @@ typedef gcry_md_hd_t HMACCTX;
typedef gcry_mpi_t bignum;
+/* missing gcrypt functions */
+int my_gcry_dec2bn(bignum *bn, const char *data);
+char *my_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)
@@ -59,7 +63,6 @@ typedef gcry_mpi_t bignum;
#define bignum_bn2bin(num,datalen,data) gcry_mpi_print(GCRYMPI_FMT_USG,data,datalen,NULL,num)
#define bignum_cmp(num1,num2) gcry_mpi_cmp(num1,num2)
-
#endif /* HAVE_LIBGCRYPT */
struct ssh_cipher_struct *ssh_get_ciphertab(void);
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index e53802f5..c267f3de 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -265,11 +265,5 @@ SSH_PACKET_CALLBACK(ssh_packet_kexdh_init);
*/
#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
-#ifdef HAVE_LIBGCRYPT
-/* gcrypt_missing.c */
-int my_gcry_dec2bn(bignum *bn, const char *data);
-char *my_gcry_bn2dec(bignum bn);
-#endif /* !HAVE_LIBGCRYPT */
-
#endif /* _LIBSSH_PRIV_H */
/* vim: set ts=4 sw=4 et cindent: */
diff --git a/src/gcrypt_missing.c b/src/gcrypt_missing.c
index 7a456a6a..b21e5f30 100644
--- a/src/gcrypt_missing.c
+++ b/src/gcrypt_missing.c
@@ -22,7 +22,9 @@
*/
#include <stdlib.h>
+
#include "libssh/priv.h"
+#include "libssh/libgcrypt.h"
#ifdef HAVE_LIBGCRYPT
int my_gcry_dec2bn(bignum *bn, const char *data) {