From a30ba0091feb4e4962e6208632ef3ce27ccbc86e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavol=20=C5=BD=C3=A1=C4=8Dik?= Date: Mon, 1 Dec 2025 13:55:00 +0100 Subject: [PATCH] libgcrypt: make bignum_dup usable with const_bignum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jakub Jelen Reviewed-by: Andreas Schneider --- include/libssh/libgcrypt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/libssh/libgcrypt.h b/include/libssh/libgcrypt.h index a8044545..ce0beefd 100644 --- a/include/libssh/libgcrypt.h +++ b/include/libssh/libgcrypt.h @@ -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. */