[openssl] master update
tomas at openssl.org
tomas at openssl.org
Thu Feb 10 14:22:03 UTC 2022
The branch master has been updated
via 649999dc57419ddd9329f7062b048dee5ecd9306 (commit)
from 63b996e752ac698186c38177232280e6515d571b (commit)
- Log -----------------------------------------------------------------
commit 649999dc57419ddd9329f7062b048dee5ecd9306
Author: Kelvin Lee <kiyolee at gmail.com>
Date: Sat Jan 22 11:22:31 2022 +1100
bn_lib.c: Change Endianess check to as a binary condition.
This prevents VS2022 from mis-identify an uninitialized local pointer
variable.
CLA: trivial
Reviewed-by: Ben Kaduk <kaduk at mit.edu>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17567)
-----------------------------------------------------------------------
Summary of changes:
crypto/bn/bn_lib.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c
index b49c8a3bd2..05b36033a5 100644
--- a/crypto/bn/bn_lib.c
+++ b/crypto/bn/bn_lib.c
@@ -455,18 +455,15 @@ static BIGNUM *bin2bn(const unsigned char *s, int len, BIGNUM *ret,
* significant BIGNUM chunk, so we adapt parameters to transfer
* input bytes accordingly.
*/
- switch (endianess) {
- case LITTLE:
+ if (endianess == LITTLE) {
s2 = s + len - 1;
inc2 = -1;
inc = 1;
- break;
- case BIG:
+ } else {
s2 = s;
inc2 = 1;
inc = -1;
s += len - 1;
- break;
}
/* Take note of the signedness of the input bytes*/
@@ -593,14 +590,11 @@ static int bn2binpad(const BIGNUM *a, unsigned char *to, int tolen,
* to most significant BIGNUM limb, so we adapt parameters to
* transfer output bytes accordingly.
*/
- switch (endianess) {
- case LITTLE:
+ if (endianess == LITTLE) {
inc = 1;
- break;
- case BIG:
+ } else {
inc = -1;
to += tolen - 1; /* Move to the last byte, not beyond */
- break;
}
lasti = atop - 1;
More information about the openssl-commits
mailing list