diff options
author | NIIBE Yutaka <[email protected]> | 2020-06-09 06:45:51 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2020-06-09 06:45:51 +0000 |
commit | da5e0bc31b4c6f16ed5ff9b35063f3b03eb7ff16 (patch) | |
tree | 54a549895066f5d2663bb601d5dd36aa70a8b8f0 /g10/pubkey-enc.c | |
parent | gpg: Add X448 support. (diff) | |
download | gnupg-da5e0bc31b4c6f16ed5ff9b35063f3b03eb7ff16.tar.gz gnupg-da5e0bc31b4c6f16ed5ff9b35063f3b03eb7ff16.zip |
gpg: Use bytes for ECDH.
* g10/ecdh.c (extract_secret_x): Use byte * instead of MPI.
(prepare_ecdh_with_shared_point): Use char * instead of MPI.
(pk_ecdh_encrypt_with_shared_point): Likewise.
(pk_ecdh_decrypt): Likewise.
* g10/pkglue.h (pk_ecdh_encrypt_with_shared_point, pk_ecdh_decrypt):
Change declaration.
* g10/pkglue.c (get_data_from_sexp): New.
(pk_encrypt): Use get_data_from_sexp instead of get_mpi_from_sexp.
Follow the change of pk_ecdh_encrypt_with_shared_point.
* g10/pubkey-enc.c (get_it): Follow the change of pk_ecdh_decrypt.
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'g10/pubkey-enc.c')
-rw-r--r-- | g10/pubkey-enc.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/g10/pubkey-enc.c b/g10/pubkey-enc.c index 9ec86df3e..38353c812 100644 --- a/g10/pubkey-enc.c +++ b/g10/pubkey-enc.c @@ -278,20 +278,11 @@ get_it (ctrl_t ctrl, if (sk->pubkey_algo == PUBKEY_ALGO_ECDH) { - gcry_mpi_t shared_mpi; 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; - } - err = pk_ecdh_decrypt (&decoded, fp, enc->data[1]/*encr data as an MPI*/, - shared_mpi, sk->pkey); - mpi_release (shared_mpi); + frame, nframe, sk->pkey); if(err) goto leave; |