Fix incorrect use of BN_CTX API
authorAgustin Gianni <agustingianni@gmail.com>
Fri, 8 Jan 2021 15:04:05 +0000 (16:04 +0100)
committerTomas Mraz <tmraz@fedoraproject.org>
Wed, 13 Jan 2021 09:35:27 +0000 (10:35 +0100)
commit48116c2d0fbb1db875e2bc703c08089bf3c5c5c3
treeb9e4c9474bb26c9f32db06c3ffbf5ae6164b0f29
parent1dccccf33351a732dac3c700b2de05d34f708e33
Fix incorrect use of BN_CTX API

In some edge cases BN_CTX_end was being called without first calling
BN_CTX_start. This creates a situation where the state of the big
number allocator is corrupted and may lead to crashes.

Fixes #13812

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13813)
crypto/bn/bn_prime.c
crypto/bn/bn_sqrt.c
crypto/bn/bn_x931p.c
crypto/ec/ec_mult.c