summaryrefslogtreecommitdiffstats
path: root/ssl/statem/statem.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-06-03 11:59:19 +0100
committerMatt Caswell <matt@openssl.org>2016-06-03 20:29:04 +0100
commit2c4a056f59a6819b8a0d40e3a7e11cf6d35b3e88 (patch)
treec9d9275b21fc98c0f18f44729c1b0cbaf93c1a50 /ssl/statem/statem.c
parentfa28bfd66fc221e18ee57134e42b54b4012e66db (diff)
Handle a memory allocation failure in ssl3_init_finished_mac()
The ssl3_init_finished_mac() function can fail, in which case we need to propagate the error up through the stack. RT#3198 Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'ssl/statem/statem.c')
-rw-r--r--ssl/statem/statem.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c
index 0b0595d237..28483e7944 100644
--- a/ssl/statem/statem.c
+++ b/ssl/statem/statem.c
@@ -332,8 +332,12 @@ static int state_machine(SSL *s, int server)
goto end;
}
- if (!server || st->state != MSG_FLOW_RENEGOTIATE)
- ssl3_init_finished_mac(s);
+ if (!server || st->state != MSG_FLOW_RENEGOTIATE) {
+ if (!ssl3_init_finished_mac(s)) {
+ ossl_statem_set_error(s);
+ goto end;
+ }
+ }
if (server) {
if (st->state != MSG_FLOW_RENEGOTIATE) {