aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2015-03-23 14:32:11 +0100
committerMartin Willi <martin@revosec.ch>2015-03-23 17:54:03 +0100
commit0356089d0f94ab86dd82fd686703560988833e3c (patch)
tree43201d2caf56388bcddc82795962b95504a07482 /src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
parenta777155ffed7fc6382a2e344ebd748f70b1c61c2 (diff)
downloadstrongswan-0356089d0f94ab86dd82fd686703560988833e3c.tar.bz2
strongswan-0356089d0f94ab86dd82fd686703560988833e3c.tar.xz
diffie-hellman: Verify public DH values in backends
Diffstat (limited to 'src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c')
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
index 7a0aa1a6a..2615d60a2 100644
--- a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
+++ b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
@@ -92,6 +92,11 @@ METHOD(diffie_hellman_t, set_other_public_value, bool,
{
int len;
+ if (!diffie_hellman_verify_value(this->group, value))
+ {
+ return FALSE;
+ }
+
BN_bin2bn(value.ptr, value.len, this->pub_key);
chunk_clear(&this->shared_secret);
this->shared_secret.ptr = malloc(DH_size(this->dh));