mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-08 19:02:06 +03:00
priv: Move gcrypt functions to gcrypt header.
This commit is contained in:
@@ -43,6 +43,10 @@ typedef gcry_md_hd_t HMACCTX;
|
|||||||
|
|
||||||
typedef gcry_mpi_t bignum;
|
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_new() gcry_mpi_new(0)
|
||||||
#define bignum_free(num) gcry_mpi_release(num)
|
#define bignum_free(num) gcry_mpi_release(num)
|
||||||
#define bignum_set_word(bn,n) gcry_mpi_set_ui(bn,n)
|
#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_bn2bin(num,datalen,data) gcry_mpi_print(GCRYMPI_FMT_USG,data,datalen,NULL,num)
|
||||||
#define bignum_cmp(num1,num2) gcry_mpi_cmp(num1,num2)
|
#define bignum_cmp(num1,num2) gcry_mpi_cmp(num1,num2)
|
||||||
|
|
||||||
|
|
||||||
#endif /* HAVE_LIBGCRYPT */
|
#endif /* HAVE_LIBGCRYPT */
|
||||||
|
|
||||||
struct ssh_cipher_struct *ssh_get_ciphertab(void);
|
struct ssh_cipher_struct *ssh_get_ciphertab(void);
|
||||||
|
@@ -265,11 +265,5 @@ SSH_PACKET_CALLBACK(ssh_packet_kexdh_init);
|
|||||||
*/
|
*/
|
||||||
#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
|
#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 */
|
#endif /* _LIBSSH_PRIV_H */
|
||||||
/* vim: set ts=4 sw=4 et cindent: */
|
/* vim: set ts=4 sw=4 et cindent: */
|
||||||
|
@@ -22,7 +22,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "libssh/priv.h"
|
#include "libssh/priv.h"
|
||||||
|
#include "libssh/libgcrypt.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBGCRYPT
|
#ifdef HAVE_LIBGCRYPT
|
||||||
int my_gcry_dec2bn(bignum *bn, const char *data) {
|
int my_gcry_dec2bn(bignum *bn, const char *data) {
|
||||||
|
Reference in New Issue
Block a user