aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_rsa.c
diff options
context:
space:
mode:
authorDavid Barksdale <amatus.amongus@gmail.com>2016-08-23 15:43:38 +0000
committerDavid Barksdale <amatus.amongus@gmail.com>2016-08-23 15:43:38 +0000
commita741a84289724ea33d3941b10c57e554e8ab5e09 (patch)
treea5662194123e74a4849e9cc2ac38c726f8211010 /src/util/crypto_rsa.c
parentcfbaa1465b020d7d7300190bb86b9da667a67f06 (diff)
downloadgnunet-a741a84289724ea33d3941b10c57e554e8ab5e09.tar.gz
gnunet-a741a84289724ea33d3941b10c57e554e8ab5e09.zip
Restore Lenstra protection for gcrypt < 1.6.4
Diffstat (limited to 'src/util/crypto_rsa.c')
-rw-r--r--src/util/crypto_rsa.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c
index 0e9ed99d0..443d597e4 100644
--- a/src/util/crypto_rsa.c
+++ b/src/util/crypto_rsa.c
@@ -840,12 +840,12 @@ rsa_sign_mpi (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
840 return NULL; 840 return NULL;
841 } 841 }
842 842
843 /* Lenstra protection was first added to libgcrypt 1.6.4
844 * with commit c17f84bd02d7ee93845e92e20f6ddba814961588.
845 */
846#if GCRYPT_VERSION_NUMBER < 0x010604
843 /* verify signature (guards against Lenstra's attack with fault injection...) */ 847 /* verify signature (guards against Lenstra's attack with fault injection...) */
844 /* Removed because Lenstra protection was first added to libgcrypt 1.6.4 848 struct GNUNET_CRYPTO_RsaPublicKey *public_key = GNUNET_CRYPTO_rsa_private_key_get_public (key);
845 * with commit c17f84bd02d7ee93845e92e20f6ddba814961588. Do not run with
846 * an earlier libgcrypt. Or uncomment if you must. */
847 /*
848 public_key = GNUNET_CRYPTO_rsa_private_key_get_public (key);
849 if (0 != 849 if (0 !=
850 gcry_pk_verify (result, 850 gcry_pk_verify (result,
851 data, 851 data,
@@ -858,7 +858,7 @@ rsa_sign_mpi (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
858 return NULL; 858 return NULL;
859 } 859 }
860 GNUNET_CRYPTO_rsa_public_key_free (public_key); 860 GNUNET_CRYPTO_rsa_public_key_free (public_key);
861 */ 861#endif
862 862
863 /* return signature */ 863 /* return signature */
864 gcry_sexp_release (data); 864 gcry_sexp_release (data);