From e02347b2ab1c5a96ddc59e33190a54e11428ee91 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 12 May 2020 13:42:07 +0900 Subject: [PATCH] ecc-sos: Clean up use of mpi_get_opaque. * g10/ecdh.c (pk_ecdh_encrypt_with_shared_point): Tidy up. Signed-off-by: NIIBE Yutaka --- g10/ecdh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/g10/ecdh.c b/g10/ecdh.c index 661841686..f8080a76a 100644 --- a/g10/ecdh.c +++ b/g10/ecdh.c @@ -98,7 +98,7 @@ pk_ecdh_encrypt_with_shared_point (int is_encrypt, gcry_mpi_t shared_mpi, gpg_error_t err; byte *secret_x; int secret_x_size; - unsigned int nbits, nbits1; + unsigned int nbits; const unsigned char *kek_params; size_t kek_params_size; int kdf_hash_algo; @@ -118,7 +118,7 @@ pk_ecdh_encrypt_with_shared_point (int is_encrypt, gcry_mpi_t shared_mpi, /* Extract x component of the shared point: this is the actual shared secret. */ nbytes = (mpi_get_nbits (pkey[1] /* public point */)+7)/8; - secret_x = gcry_mpi_get_opaque (shared_mpi, &nbits1); + secret_x = gcry_mpi_get_opaque (shared_mpi, NULL); /* Expected size of the x component */ secret_x_size = (nbits+7)/8;