summaryrefslogtreecommitdiff
path: root/cipher/ecc.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2016-02-12 13:50:02 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2016-02-12 13:50:02 +0900
commit7a019bc7ecdbdfdef51094e090ce95e062da9b64 (patch)
treeb6f8a0c92ec53ab23bf8eec73f6aaa049074417d /cipher/ecc.c
parentb12dd550fd6af687ef95c584d0d8366c34965cc8 (diff)
downloadlibgcrypt-7a019bc7ecdbdfdef51094e090ce95e062da9b64.tar.gz
ecc: Not validate input point for Curve25519.
* cipher/ecc.c (ecc_decrypt_raw): Curve25519 is an exception. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'cipher/ecc.c')
-rw-r--r--cipher/ecc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cipher/ecc.c b/cipher/ecc.c
index d1fe8237..4cdbb149 100644
--- a/cipher/ecc.c
+++ b/cipher/ecc.c
@@ -1570,7 +1570,9 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (DBG_CIPHER)
log_printpnt ("ecc_decrypt kG", &kG, NULL);
- if (!_gcry_mpi_ec_curve_point (&kG, ec))
+ if (!(curvename && !strcmp (curvename, "Curve25519"))
+ /* For Curve25519, by its definition, validation should not be done. */
+ && !_gcry_mpi_ec_curve_point (&kG, ec))
{
rc = GPG_ERR_INV_DATA;
goto leave;