summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec2_mult.c
diff options
context:
space:
mode:
authormiod <>2015-02-08 22:25:03 +0000
committermiod <>2015-02-08 22:25:03 +0000
commitdd6276f01b34c3a6f2592c0bd72685bbba93fb31 (patch)
tree39229584702a732ee11613b8adc170ac872553d0 /src/lib/libcrypto/ec/ec2_mult.c
parent7d41edeab1a29aba3d0cd0334b1edefd62baa889 (diff)
downloadopenbsd-dd6276f01b34c3a6f2592c0bd72685bbba93fb31.tar.gz
openbsd-dd6276f01b34c3a6f2592c0bd72685bbba93fb31.tar.bz2
openbsd-dd6276f01b34c3a6f2592c0bd72685bbba93fb31.zip
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@
Diffstat (limited to 'src/lib/libcrypto/ec/ec2_mult.c')
-rw-r--r--src/lib/libcrypto/ec/ec2_mult.c4
1 files changed, 2 insertions, 2 deletions
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 @@
1/* $OpenBSD: ec2_mult.c,v 1.5 2014/07/12 16:03:37 miod Exp $ */ 1/* $OpenBSD: ec2_mult.c,v 1.6 2015/02/08 22:25:03 miod Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -272,7 +272,7 @@ ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r,
272 } 272 }
273 /* if result should be point at infinity */ 273 /* if result should be point at infinity */
274 if ((scalar == NULL) || BN_is_zero(scalar) || (point == NULL) || 274 if ((scalar == NULL) || BN_is_zero(scalar) || (point == NULL) ||
275 EC_POINT_is_at_infinity(group, point)) { 275 EC_POINT_is_at_infinity(group, point) > 0) {
276 return EC_POINT_set_to_infinity(group, r); 276 return EC_POINT_set_to_infinity(group, r);
277 } 277 }
278 /* only support affine coordinates */ 278 /* only support affine coordinates */