ecc: Not validate input point for Curve25519.
authorNIIBE Yutaka <gniibe@fsij.org>
Fri, 12 Feb 2016 04:50:02 +0000 (13:50 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Fri, 12 Feb 2016 04:50:02 +0000 (13:50 +0900)
* cipher/ecc.c (ecc_decrypt_raw): Curve25519 is an exception.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
cipher/ecc.c

index d1fe823..4cdbb14 100644 (file)
@@ -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;