Add a flag so finalised contexts are not reused
authorSimo Sorce <simo@redhat.com>
Thu, 9 Mar 2023 16:45:02 +0000 (11:45 -0500)
committerPauli <pauli@openssl.org>
Tue, 14 Mar 2023 21:42:59 +0000 (08:42 +1100)
commit3fc2b7d6b8f961144905330dfd4689f5bd515199
tree6636f65738ba67a2c55d1941a0c7f3a4432e590d
parentf3c0dd4f0cd3bc282575a98181f8190d81189a78
Add a flag so finalised contexts are not reused

The EVP layer should not rely on the underlying low level code to
handle catching incorrect reuse of contexts.
Add a flag to mark a context as finalised as needed and then catch and
immediately error on Update/Final operations if called improperly.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/20375)
crypto/evp/digest.c
crypto/evp/m_sigver.c
include/crypto/evp.h
include/openssl/evp.h