diff options
author | jsing <> | 2022-11-24 01:30:01 +0000 |
---|---|---|
committer | jsing <> | 2022-11-24 01:30:01 +0000 |
commit | 8a7c8abfd4f8805f2a5101e89356e9411d908a0c (patch) | |
tree | faea38f1c86dae9f6d4b143b2aa9f7752ecd0a34 /src/lib/libcrypto/bn/bn_exp.c | |
parent | 095ccaedd0631462c52a1a2d9aa19b35c3e45b12 (diff) | |
download | openbsd-8a7c8abfd4f8805f2a5101e89356e9411d908a0c.tar.gz openbsd-8a7c8abfd4f8805f2a5101e89356e9411d908a0c.tar.bz2 openbsd-8a7c8abfd4f8805f2a5101e89356e9411d908a0c.zip |
Change bn_expand()/bn_wexpand() to indicate failure/success via 0/1.
Currently bn_expand()/bn_wexpand() return a BIGNUM *, however none of the
callers use this (and many already treat it as a true/false value).
Change these functions to return 0 on failure and 1 on success, revising
callers that test against NULL in the process.
ok tb@
Diffstat (limited to 'src/lib/libcrypto/bn/bn_exp.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_exp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c index 3525b50388..64156f716f 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.32 2022/04/20 13:32:34 tb Exp $ */ | 1 | /* $OpenBSD: bn_exp.c,v 1.33 2022/11/24 01:30:01 jsing 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 | * |
@@ -590,7 +590,7 @@ MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, unsigned char *buf, int idx, | |||
590 | int width = 1 << window; | 590 | int width = 1 << window; |
591 | volatile BN_ULONG *table = (volatile BN_ULONG *)buf; | 591 | volatile BN_ULONG *table = (volatile BN_ULONG *)buf; |
592 | 592 | ||
593 | if (bn_wexpand(b, top) == NULL) | 593 | if (!bn_wexpand(b, top)) |
594 | return 0; | 594 | return 0; |
595 | 595 | ||
596 | if (window <= 3) { | 596 | if (window <= 3) { |