From dd6276f01b34c3a6f2592c0bd72685bbba93fb31 Mon Sep 17 00:00:00 2001 From: miod <> Date: Sun, 8 Feb 2015 22:25:03 +0000 Subject: Use `> 0' instead of `!= 0' as a successful condition for EC_POINT_is_at_infinity() and EC_POINT_is_on_curve(), for they may return -1 should an error arise. ok doug@ jsing@ --- src/lib/libcrypto/ec/ec2_mult.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/libcrypto/ec/ec2_mult.c') diff --git a/src/lib/libcrypto/ec/ec2_mult.c b/src/lib/libcrypto/ec/ec2_mult.c index c74571f88c..dd113907be 100644 --- a/src/lib/libcrypto/ec/ec2_mult.c +++ b/src/lib/libcrypto/ec/ec2_mult.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec2_mult.c,v 1.5 2014/07/12 16:03:37 miod Exp $ */ +/* $OpenBSD: ec2_mult.c,v 1.6 2015/02/08 22:25:03 miod Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -272,7 +272,7 @@ ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r, } /* if result should be point at infinity */ if ((scalar == NULL) || BN_is_zero(scalar) || (point == NULL) || - EC_POINT_is_at_infinity(group, point)) { + EC_POINT_is_at_infinity(group, point) > 0) { return EC_POINT_set_to_infinity(group, r); } /* only support affine coordinates */ -- cgit v1.2.3-55-g6feb