aboutsummaryrefslogtreecommitdiff
path: root/crypto/ec/ecp_oct.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-06-04 14:22:00 +0100
committerMatt Caswell <matt@openssl.org>2015-06-10 10:43:53 +0100
commit68886be7e2cd395a759fcd41d2cede461b68843d (patch)
treea2cc07973cf021a2601394abee80cf3a4ea22f57 /crypto/ec/ecp_oct.c
parentb8b12aadd8edfd3bd327157c8899b1cf3403177f (diff)
downloadopenssl-68886be7e2cd395a759fcd41d2cede461b68843d.zip
openssl-68886be7e2cd395a759fcd41d2cede461b68843d.tar.gz
openssl-68886be7e2cd395a759fcd41d2cede461b68843d.tar.bz2
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>
Diffstat (limited to 'crypto/ec/ecp_oct.c')
-rw-r--r--crypto/ec/ecp_oct.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/ec/ecp_oct.c b/crypto/ec/ecp_oct.c
index a68b559..8bb7aa3 100644
--- a/crypto/ec/ecp_oct.c
+++ b/crypto/ec/ecp_oct.c
@@ -410,7 +410,7 @@ int ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point,
}
/* test required by X9.62 */
- if (!EC_POINT_is_on_curve(group, point, ctx)) {
+ if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
ECerr(EC_F_EC_GFP_SIMPLE_OCT2POINT, EC_R_POINT_IS_NOT_ON_CURVE);
goto err;
}