aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2010-02-18 17:38:59 +0100
committerMartin Willi <martin@strongswan.org>2010-02-18 17:38:59 +0100
commit3e35a6e7a1b01f53f75c6020184845c3129db1ac (patch)
treea7920a1d9013934b0fe3a9c1bda4b0bb31cacc0c /src/libstrongswan
parent7d3a830a71001f24fc25a194df4aab257817dca9 (diff)
downloadstrongswan-3e35a6e7a1b01f53f75c6020184845c3129db1ac.tar.bz2
strongswan-3e35a6e7a1b01f53f75c6020184845c3129db1ac.tar.xz
Use side-channel secured mpz_powm_sec of libgmp 5, if available
Diffstat (limited to 'src/libstrongswan')
-rw-r--r--src/libstrongswan/plugins/gmp/gmp_diffie_hellman.c4
-rw-r--r--src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c5
-rw-r--r--src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c5
3 files changed, 14 insertions, 0 deletions
diff --git a/src/libstrongswan/plugins/gmp/gmp_diffie_hellman.c b/src/libstrongswan/plugins/gmp/gmp_diffie_hellman.c
index ea7e6fdd2..862386e95 100644
--- a/src/libstrongswan/plugins/gmp/gmp_diffie_hellman.c
+++ b/src/libstrongswan/plugins/gmp/gmp_diffie_hellman.c
@@ -22,6 +22,10 @@
#include <debug.h>
+#ifdef HAVE_MPZ_POWM_SEC
+# undef mpz_powm
+# define mpz_powm mpz_powm_sec
+#endif
/**
* Modulus of Group 1 (MODP_768_BIT).
diff --git a/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c b/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c
index 1829bd459..c58097f88 100644
--- a/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c
+++ b/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c
@@ -27,6 +27,11 @@
#include <asn1/asn1.h>
#include <asn1/asn1_parser.h>
+#ifdef HAVE_MPZ_POWM_SEC
+# undef mpz_powm
+# define mpz_powm mpz_powm_sec
+#endif
+
/**
* Public exponent to use for key generation.
*/
diff --git a/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c b/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c
index 5fea69131..d20767177 100644
--- a/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c
+++ b/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c
@@ -28,6 +28,11 @@
#include <asn1/asn1_parser.h>
#include <crypto/hashers/hasher.h>
+#ifdef HAVE_MPZ_POWM_SEC
+# undef mpz_powm
+# define mpz_powm mpz_powm_sec
+#endif
+
typedef struct private_gmp_rsa_public_key_t private_gmp_rsa_public_key_t;
/**