]> git.ipfire.org Git - thirdparty/openssl.git/commit - ssl/statem/statem.h
Provide an SSLfatal() macro
authorMatt Caswell <matt@openssl.org>
Thu, 23 Nov 2017 16:21:46 +0000 (16:21 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 4 Dec 2017 13:31:48 +0000 (13:31 +0000)
commit1f359471f9eebab29fe2b0e8bf0e0f7b93f3bc26
tree7149493bf84e7433390ebe11903286bfaa1e628c
parent1e2804f25c80136c33f3508adb54b24106b6b6f6
Provide an SSLfatal() macro

Typically if a fatal error occurs three things need to happen:

- Put an error on the error queue
- Send an alert
- Put the state machine into the error state

Although all 3 of these things need to be done every time we hit a fatal
error the responsibilities for doing this are distributed throughout the
code. The place where the error goes on the queue, where the alert gets
sent and where the state machine goes into the error state are almost
invariably different. It has been a common pattern to pass alert codes up
and down the stack to get the alert information from the point in the code
where the error is detected to the point in the code where the alert gets
sent.

This commit provides an SSLfatal() macro (backed by an ossl_statem_fatal
function) that does all 3 of the above error tasks. This is largely a drop
in replacement for SSLerr, but takes a couple of extra parameters (the SSL
object, and an alert code).

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4778)
ssl/statem/statem.c
ssl/statem/statem.h