mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 20:30:38 +09:00
libgcrypt: make bignum_dup usable with const_bignum
Both gcry_mpi_copy and gcry_mpi_set take a pointer to const gcry_mpi, which const_bignum is not. Signed-off-by: Pavol Žáčik <pzacik@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -98,9 +98,9 @@ int ssh_gcry_rand_range(bignum rnd, bignum max);
|
||||
#define bignum_rand_range(rnd, max) ssh_gcry_rand_range(rnd, max);
|
||||
#define bignum_dup(orig, dest) do { \
|
||||
if (*(dest) == NULL) { \
|
||||
*(dest) = gcry_mpi_copy(orig); \
|
||||
*(dest) = gcry_mpi_copy((const gcry_mpi_t)orig); \
|
||||
} else { \
|
||||
gcry_mpi_set(*(dest), orig); \
|
||||
gcry_mpi_set(*(dest), (const gcry_mpi_t)orig); \
|
||||
} \
|
||||
} while(0)
|
||||
/* Helper functions for data conversions. */
|
||||
|
||||
Reference in New Issue
Block a user