diff options
author | tb <> | 2023-03-27 10:22:47 +0000 |
---|---|---|
committer | tb <> | 2023-03-27 10:22:47 +0000 |
commit | 00aea13536dd9c7115e084e54260c208dfdfb18a (patch) | |
tree | 0185376a4aa675f04952445753ad498a9709a2e1 /src/lib/libcrypto/bn/bn_exp.c | |
parent | da1a532fc7d061a1f8b375580c6d9d22ea78970b (diff) | |
download | openbsd-00aea13536dd9c7115e084e54260c208dfdfb18a.tar.gz openbsd-00aea13536dd9c7115e084e54260c208dfdfb18a.tar.bz2 openbsd-00aea13536dd9c7115e084e54260c208dfdfb18a.zip |
Convert BN_copy() with missing error checks to bn_copy()
ok jsing
Diffstat (limited to 'src/lib/libcrypto/bn/bn_exp.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_exp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c index 4944daa48c..b756d2b305 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.42 2023/03/27 10:21:23 tb Exp $ */ | 1 | /* $OpenBSD: bn_exp.c,v 1.43 2023/03/27 10:22:47 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 | * |
@@ -165,8 +165,10 @@ BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) | |||
165 | ret = 1; | 165 | ret = 1; |
166 | 166 | ||
167 | err: | 167 | err: |
168 | if (r != rr && rr != NULL) | 168 | if (r != rr && rr != NULL) { |
169 | BN_copy(r, rr); | 169 | if (!bn_copy(r, rr)) |
170 | ret = 0; | ||
171 | } | ||
170 | BN_CTX_end(ctx); | 172 | BN_CTX_end(ctx); |
171 | return (ret); | 173 | return (ret); |
172 | } | 174 | } |