summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_exp.c
diff options
context:
space:
mode:
authortb <>2023-03-27 10:21:23 +0000
committertb <>2023-03-27 10:21:23 +0000
commitda1a532fc7d061a1f8b375580c6d9d22ea78970b (patch)
tree78bb6d4286a0a95d7729bde003bd20eb6757d89a /src/lib/libcrypto/bn/bn_exp.c
parent62d326cb4e50a66b7d20ac55a0808f880deb43d9 (diff)
downloadopenbsd-da1a532fc7d061a1f8b375580c6d9d22ea78970b.tar.gz
openbsd-da1a532fc7d061a1f8b375580c6d9d22ea78970b.tar.bz2
openbsd-da1a532fc7d061a1f8b375580c6d9d22ea78970b.zip
Convert BN_copy() with explicit comparison against NULL to bn_copy()
ok jsing
Diffstat (limited to 'src/lib/libcrypto/bn/bn_exp.c')
-rw-r--r--src/lib/libcrypto/bn/bn_exp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c
index 9e4497bb06..4944daa48c 100644
--- a/src/lib/libcrypto/bn/bn_exp.c
+++ b/src/lib/libcrypto/bn/bn_exp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_exp.c,v 1.41 2023/03/26 19:09:42 tb Exp $ */ 1/* $OpenBSD: bn_exp.c,v 1.42 2023/03/27 10:21:23 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -142,12 +142,12 @@ BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
142 if (rr == NULL || v == NULL) 142 if (rr == NULL || v == NULL)
143 goto err; 143 goto err;
144 144
145 if (BN_copy(v, a) == NULL) 145 if (!bn_copy(v, a))
146 goto err; 146 goto err;
147 bits = BN_num_bits(p); 147 bits = BN_num_bits(p);
148 148
149 if (BN_is_odd(p)) { 149 if (BN_is_odd(p)) {
150 if (BN_copy(rr, a) == NULL) 150 if (!bn_copy(rr, a))
151 goto err; 151 goto err;
152 } else { 152 } else {
153 if (!BN_one(rr)) 153 if (!BN_one(rr))