summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-04-19 15:26:28 +0100
committerMatt Caswell <matt@openssl.org>2018-04-20 11:46:12 +0100
commit4ce787b97aa66e1b4c1d48f6ec047141408056f7 (patch)
treeee102ad590a4eb63b125aeedf9e69cd41439fed9 /ssl
parent4b7c6385f779e92ffcd76159b03b4dac301e93e7 (diff)
Make sure SSL_in_init() returns 0 at SSL_CB_HANDSHAKE_DONE
In 1.1.0 and before calling SSL_in_init() from the info_callback at SSL_CB_HANDSHAKE_DONE would return 0. This commit fixes it so that it does again for 1.1.1. This broke Node. Fixes #4574 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6019)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/statem/statem_lib.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ssl/statem/statem_lib.c b/ssl/statem/statem_lib.c
index a17dec9dcb..6d0778db3f 100644
--- a/ssl/statem/statem_lib.c
+++ b/ssl/statem/statem_lib.c
@@ -1090,13 +1090,18 @@ WORK_STATE tls_finish_handshake(SSL *s, WORK_STATE wst, int clearbufs, int stop)
else if (s->ctx->info_callback != NULL)
cb = s->ctx->info_callback;
+ /* The callback may expect us to not be in init at handshake done */
+ ossl_statem_set_in_init(s, 0);
+
if (cb != NULL)
cb(s, SSL_CB_HANDSHAKE_DONE, 1);
- if (!stop)
+ if (!stop) {
+ /* If we've got more work to do we go back into init */
+ ossl_statem_set_in_init(s, 1);
return WORK_FINISHED_CONTINUE;
+ }
- ossl_statem_set_in_init(s, 0);
return WORK_FINISHED_STOP;
}