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.
This commit is contained in:
@@ -102,6 +102,11 @@ static bool chunk2ecp(const EC_GROUP *group, chunk_t chunk, EC_POINT *point)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!EC_POINT_is_on_curve(group, point, ctx))
|
||||||
|
{
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
error:
|
error:
|
||||||
BN_CTX_end(ctx);
|
BN_CTX_end(ctx);
|
||||||
|
|||||||
Reference in New Issue
Block a user