From 5b094067f7e988e7078526bcedcf07f1bb2cc29b Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 22 Nov 2019 16:03:43 +0900 Subject: [PATCH] gpg: Use opaque MPI for shared point. Signed-off-by: NIIBE Yutaka --- g10/pubkey-enc.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/g10/pubkey-enc.c b/g10/pubkey-enc.c index 9ec86df3e..f796f39b5 100644 --- a/g10/pubkey-enc.c +++ b/g10/pubkey-enc.c @@ -282,13 +282,7 @@ get_it (ctrl_t ctrl, gcry_mpi_t decoded; /* At the beginning the frame are the bytes of shared point MPI. */ - err = gcry_mpi_scan (&shared_mpi, GCRYMPI_FMT_USG, frame, nframe, NULL); - if (err) - { - err = gpg_error (GPG_ERR_WRONG_SECKEY); - goto leave; - } - + shared_mpi = gcry_mpi_set_opaque_copy (NULL, frame, nframe * 8); err = pk_ecdh_decrypt (&decoded, fp, enc->data[1]/*encr data as an MPI*/, shared_mpi, sk->pkey); mpi_release (shared_mpi);