aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2013-11-19 15:00:28 +0100
committerTobias Brunner <tobias@strongswan.org>2013-11-19 15:00:28 +0100
commit3bff80aee3d7d9198a889ab0f7b7caf15791ca21 (patch)
treeb865bb45b1e08ed6984c71de8641aa36eab42805 /src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c
parent38a4f1964e98ec9e4e4396c4b3c62855ced6c26a (diff)
downloadstrongswan-3bff80aee3d7d9198a889ab0f7b7caf15791ca21.tar.bz2
strongswan-3bff80aee3d7d9198a889ab0f7b7caf15791ca21.tar.xz
openssl: Verify that a peer's ECDH public value is a point on the elliptic curve
This check is mandated by RFC 6989. Since we don't reuse DH secrets, it is mostly a sanity check.
Diffstat (limited to 'src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c')
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c b/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c
index c43fe455a..835ed586e 100644
--- a/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c
+++ b/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c
@@ -102,6 +102,11 @@ static bool chunk2ecp(const EC_GROUP *group, chunk_t chunk, EC_POINT *point)
goto error;
}
+ if (!EC_POINT_is_on_curve(group, point, ctx))
+ {
+ goto error;
+ }
+
ret = TRUE;
error:
BN_CTX_end(ctx);