Update provider_util.c to correctly handle ENGINE references
authorMatt Caswell <matt@openssl.org>
Fri, 15 Oct 2021 15:28:53 +0000 (16:28 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 19 Oct 2021 15:20:00 +0000 (16:20 +0100)
commit86c15ba87488f88e6191f098ff154f79ce91847b
tree1ae67f8d664459fc20039180992e4c44bfd7f18a
parentf7d6868d0d48fedd5d9daad0c3e0cbcaef423ff3
Update provider_util.c to correctly handle ENGINE references

provider_util.c failed to free ENGINE references when clearing a cipher
or a digest. Additionally ciphers and digests were not copied correctly,
which would lead to double-frees if it were not for the previously
mentioned leaks.

Fixes #16845

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16846)
providers/common/provider_util.c