summaryrefslogtreecommitdiff
path: root/cipher/ecc-misc.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2021-05-06 13:06:52 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2021-05-06 13:06:52 +0900
commit5f814e8a4968c01a7ffc7762bcaf3ce040594caf (patch)
tree4f9fcf176cf5c0b5cf195fe396229460bd60ed63 /cipher/ecc-misc.c
parentec87511d9cd2dc31434e939b6351d74a38d4ceaa (diff)
downloadlibgcrypt-5f814e8a4968c01a7ffc7762bcaf3ce040594caf.tar.gz
ecc: Fix the input length check for Montgomery curve.
* cipher/ecc-misc.c (_gcry_ecc_mont_decodepoint): Fix the condition. -- Fixes-commit: 060c378c050e7ec6206358c681a313d6e1967dcf GnuPG-bug-id: 5423 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'cipher/ecc-misc.c')
-rw-r--r--cipher/ecc-misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cipher/ecc-misc.c b/cipher/ecc-misc.c
index f7f914f6..37b4fa1b 100644
--- a/cipher/ecc-misc.c
+++ b/cipher/ecc-misc.c
@@ -436,7 +436,7 @@ _gcry_ecc_mont_decodepoint (gcry_mpi_t pk, mpi_ec_t ec, mpi_point_t result)
rawmpi = _gcry_mpi_get_buffer (pk, nbytes, &rawmpilen, NULL);
if (!rawmpi)
return gpg_err_code_from_syserror ();
- if (rawmpilen > nbytes + 1)
+ if (rawmpilen > nbytes + BYTES_PER_MPI_LIMB)
{
xfree (rawmpi);
return GPG_ERR_INV_OBJ;