Modify ssl_handshake_hash to call SSLfatal
authorTrev Larock <tlarock@juniper.net>
Fri, 28 May 2021 02:26:41 +0000 (02:26 +0000)
committerTomas Mraz <tomas@openssl.org>
Wed, 2 Jun 2021 07:59:30 +0000 (09:59 +0200)
commit5b74c197f315fe1e6591876aaa82e275e4f05f54
tree07a005a537d5666649692ad47010a7571c42d801
parent3ee328ab9eff0bf0c86d07b24555a81f403d2ecb
Modify ssl_handshake_hash to call SSLfatal

When EVP_MD_CTX_new fails call SSLfatal before the goto err.
This resolves a state machine issue on the out of memory condition:
ssl/statem/statem.c:643: OpenSSL internal error: Assertion failed:
(s)->statem.in_init && (s)->statem.state == MSG_FLOW_ERROR

Fixes #15491.
CLA: trivial

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15511)
ssl/ssl_lib.c