openssl/crypto
Cesar Pereida Garcia 85728d08ae Update control logic for BN_gcd
PR https://github.com/openssl/openssl/pull/10122 introduced changes to
the BN_gcd function and the control logic inside it accessed `g->d[0]`
irrespective of `g->top`.

When BN_add is called, in case the result is zero, `BN_zero` is called.
The latter behaves differently depending on the API compatibility level
flag: normally `g->d[0]` is cleared but in `no-deprecated` builds only
`g->top` is set to zero.

This commit uses bitwise logic to ensure that `g` is treated as zero if
`g->top` is zero, irrespective of `g->d[0]`.

Co-authored-by: Nicola Tuveri <nic.tuv@gmail.com>

(cherry picked from commit 8aca4bfe8213402c80abc06fe25121461f79128d)

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10232)
2019-10-23 12:16:13 +03:00
..
aes Fix header file include guard names 2019-09-27 23:58:12 +02:00
aria Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
asn1 [crypto/asn1/x_bignum.c] Explicit test against NULL 2019-10-16 15:41:17 +03:00
async Fix header file include guard names 2019-09-27 23:58:12 +02:00
bf Fix header file include guard names 2019-09-27 23:58:12 +02:00
bio Fix unused goto label gcc warning 2019-10-10 19:09:28 +02:00
blake2 Reorganize local header files 2019-09-27 23:58:06 +02:00
bn Update control logic for BN_gcd 2019-10-23 12:16:13 +03:00
buffer
camellia Fix header file include guard names 2019-09-27 23:58:12 +02:00
cast Reorganize local header files 2019-09-27 23:58:06 +02:00
chacha Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
cmac Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
cms Fix a bundle of mischecks of return values 2019-09-30 17:19:05 +08:00
comp Reorganize local header files 2019-09-27 23:58:06 +02:00
conf Reorganize local header files 2019-09-27 23:58:06 +02:00
ct Reorganize local header files 2019-09-27 23:58:06 +02:00
des Fix header file include guard names 2019-09-27 23:58:12 +02:00
dh Reorganize local header files 2019-09-27 23:58:06 +02:00
dsa Document and add macros for additional DSA options 2019-10-15 16:04:46 +02:00
dso Reorganize local header files 2019-09-27 23:58:06 +02:00
ec [ec_asn1.c] Avoid injecting seed when built-in matches 2019-10-15 15:19:38 +03:00
engine Fix header file include guard names 2019-09-27 23:58:12 +02:00
err Reorganize local header files 2019-09-27 23:58:06 +02:00
evp Define AESNI_ASM if AESNI assembler is included, and use it 2019-10-03 15:07:26 +02:00
hmac Fix header file include guard names 2019-09-27 23:58:12 +02:00
idea Reorganize local header files 2019-09-27 23:58:06 +02:00
kdf Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
lhash Reorganize local header files 2019-09-27 23:58:06 +02:00
md2
md4 Reorganize local header files 2019-09-27 23:58:06 +02:00
md5 Reorganize local header files 2019-09-27 23:58:06 +02:00
mdc2
modes Reorganize local header files 2019-09-27 23:58:06 +02:00
objects Fix long name of some Microsoft objects 2019-10-03 08:26:27 +10:00
ocsp Reorganize local header files 2019-09-27 23:58:06 +02:00
pem Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
perlasm Update copyright year 2019-02-26 14:05:09 +00:00
pkcs7 Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
pkcs12 Reorganize local header files 2019-09-27 23:58:06 +02:00
poly1305 Reorganize local header files 2019-09-27 23:58:06 +02:00
rand Move random-related defines from e_os.h to rand_unix.c 2019-10-19 00:08:07 +02:00
rc2 Reorganize local header files 2019-09-27 23:58:06 +02:00
rc4 Fix header file include guard names 2019-09-27 23:58:12 +02:00
rc5 Reorganize local header files 2019-09-27 23:58:06 +02:00
ripemd Reorganize local header files 2019-09-27 23:58:06 +02:00
rsa rsa: replace magic number '11' by RSA_PKCS1_PADDING_SIZE 2019-10-03 14:38:57 +02:00
seed Fix header file include guard names 2019-09-27 23:58:12 +02:00
sha Reorganize local header files 2019-09-27 23:58:06 +02:00
siphash Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
sm2 Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
sm3 Reorganize local header files 2019-09-27 23:58:06 +02:00
sm4 Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
srp Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
stack Revert "stack/stack.c: omit redundant NULL checks." 2018-08-09 14:37:10 +01:00
store Reorganize local header files 2019-09-27 23:58:06 +02:00
ts Reorganize local header files 2019-09-27 23:58:06 +02:00
txt_db
ui Fix header file include guard names 2019-09-27 23:58:12 +02:00
whrlpool Reorganize local header files 2019-09-27 23:58:06 +02:00
x509 Reorganize local header files 2019-09-27 23:58:06 +02:00
x509v3 Fix header file include guard names 2019-09-27 23:58:12 +02:00
alphacpuid.pl
arm64cpuid.pl
arm_arch.h Fix header file include guard names 2019-09-27 23:58:12 +02:00
armcap.c Update copyright year 2019-02-26 14:05:09 +00:00
armv4cpuid.pl
build.info Use secure_getenv(3) when available. 2018-09-24 11:22:22 +10:00
c64xpluscpuid.pl
cpt_err.c
cryptlib.c Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
ctype.c Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
cversion.c
dllmain.c Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
ebcdic.c
ex_data.c Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
getenv.c Use secure_getenv(3) when available. 2018-09-24 11:22:22 +10:00
ia64cpuid.S
init.c Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
LPdir_nyi.c
LPdir_unix.c typo-fixes: miscellaneous typo fixes 2018-09-21 23:59:02 +02:00
LPdir_vms.c
LPdir_win.c
LPdir_win32.c
LPdir_wince.c
mem.c Reorganize private crypto header files 2019-09-27 23:57:58 +02:00
mem_clr.c
mem_dbg.c
mem_sec.c test/secmemtest: test secure memory only if it is implemented 2018-10-05 12:23:34 +02:00
mips_arch.h Fix header file include guard names 2019-09-27 23:58:12 +02:00
o_dir.c
o_fips.c
o_fopen.c Add missing include file. 2018-09-17 12:54:20 +10:00
o_init.c
o_str.c Fix error handling at openssl_strerror_r 2019-06-18 13:58:52 +02:00
o_time.c
pariscid.pl
ppc_arch.h Fix header file include guard names 2019-09-27 23:58:12 +02:00
ppccap.c Reorganize local header files 2019-09-27 23:58:06 +02:00
ppccpuid.pl Update copyright year 2019-02-26 14:05:09 +00:00
s390x_arch.h Fix header file include guard names 2019-09-27 23:58:12 +02:00
s390xcap.c Update copyright year 2019-09-10 13:56:40 +01:00
s390xcpuid.pl s390x assembly pack: add KIMD/KLMD code path for sha3/shake 2018-08-06 12:04:52 +02:00
sparc_arch.h Fix header file include guard names 2019-09-27 23:58:12 +02:00
sparccpuid.S
sparcv9cap.c
threads_none.c crypto/threads_none.c: fix syntax error in openssl_get_fork_id() 2019-09-11 10:32:03 +02:00
threads_pthread.c Update copyright year 2019-09-10 13:56:40 +01:00
threads_win.c crypto/threads_win.c: fix preprocessor indentation 2019-09-11 10:40:18 +02:00
uid.c Swap #if blocks in uid.c so target platform gets checked before host 2019-06-18 12:53:27 +10:00
vms_rms.h
x86_64cpuid.pl
x86cpuid.pl