openssl/crypto/dh
Matt Caswell fd7d252060 Tighten up BN_with_flags usage and avoid a reachable assert
The function rsa_ossl_mod_exp uses the function BN_with_flags to create a
temporary copy (local_r1) of a BIGNUM (r1) with modified flags. This
temporary copy shares some state with the original r1. If the state of r1
gets updated then local_r1's state will be stale. This was occurring in the
function so that when local_r1 was freed a call to bn_check_top was made
which failed an assert due to the stale state. To resolve this we must free
local_r1 immediately after we have finished using it and not wait until the
end of the function.

This problem prompted a review of all BN_with_flag usage within the
codebase. All other usage appears to be correct, although often not
obviously so. This commit refactors things to make it much clearer for
these other uses.

Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-11-26 10:20:36 +00:00
..
dh192.pem
dh512.pem
dh1024.pem
dh2048.pem
dh4096.pem
dh_ameth.c Continue standardising malloc style for libcrypto 2015-11-09 22:48:41 +00:00
dh_asn1.c Continue standardising malloc style for libcrypto 2015-11-09 22:48:41 +00:00
dh_check.c
dh_depr.c Continue standardising malloc style for libcrypto 2015-11-09 22:48:41 +00:00
dh_err.c Rebuild error source files. 2015-11-05 15:48:37 +00:00
dh_gen.c
dh_kdf.c
dh_key.c Tighten up BN_with_flags usage and avoid a reachable assert 2015-11-26 10:20:36 +00:00
dh_lib.c remove 0 assignments. 2015-09-03 16:26:34 -04:00
dh_pmeth.c Continue standardising malloc style for libcrypto 2015-11-09 22:48:41 +00:00
dh_prn.c
dh_rfc5114.c Fix undeclared variable warnings. 2015-10-24 16:42:51 +01:00
example
generate
Makefile Fix undeclared variable warnings. 2015-10-24 16:42:51 +01:00