diff options
author | Matt Caswell <matt@openssl.org> | 2015-06-04 14:22:00 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-06-10 10:49:06 +0100 |
commit | 7cb79c7afb043e80eb9a4f7ff36f5a7a80cdd8c9 (patch) | |
tree | 30c2509792f8add0bfa1706e5274cb284a4faf2e /crypto/ec/ec_check.c | |
parent | d272599277092d6cd054417cf671453ca5fd0d9b (diff) |
EC_POINT_is_on_curve does not return a boolean
The function EC_POINT_is_on_curve does not return a boolean value.
It returns 1 if the point is on the curve, 0 if it is not, and -1
on error. Many usages within OpenSSL were incorrectly using this
function and therefore not correctly handling error conditions.
With thanks to the Open Crypto Audit Project for reporting this issue.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(cherry picked from commit 68886be7e2cd395a759fcd41d2cede461b68843d)
Diffstat (limited to 'crypto/ec/ec_check.c')
-rw-r--r-- | crypto/ec/ec_check.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/ec/ec_check.c b/crypto/ec/ec_check.c index d3f534999e..dd6f0ac409 100644 --- a/crypto/ec/ec_check.c +++ b/crypto/ec/ec_check.c @@ -85,7 +85,7 @@ int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx) ECerr(EC_F_EC_GROUP_CHECK, EC_R_UNDEFINED_GENERATOR); goto err; } - if (!EC_POINT_is_on_curve(group, group->generator, ctx)) { + if (EC_POINT_is_on_curve(group, group->generator, ctx) <= 0) { ECerr(EC_F_EC_GROUP_CHECK, EC_R_POINT_IS_NOT_ON_CURVE); goto err; } |