From 0356089d0f94ab86dd82fd686703560988833e3c Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Mon, 23 Mar 2015 14:32:11 +0100 Subject: diffie-hellman: Verify public DH values in backends --- src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c') 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)); -- cgit v1.2.3