From 81f0ce2b866b3503a5a73dea0915f4e068be37c0 Mon Sep 17 00:00:00 2001 From: Todd Short Date: Thu, 29 Aug 2019 11:53:41 -0400 Subject: [PATCH] Reset init state in SSL_process_quic_post_handshake() --- ssl/ssl_quic.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ssl/ssl_quic.c b/ssl/ssl_quic.c index a39dcbb7670bd..d9d3ddbd0813f 100644 --- a/ssl/ssl_quic.c +++ b/ssl/ssl_quic.c @@ -268,16 +268,19 @@ int quic_set_encryption_secrets(SSL *ssl, OSSL_ENCRYPTION_LEVEL level) int SSL_process_quic_post_handshake(SSL *ssl) { + int ret; + if (SSL_in_init(ssl) || !SSL_IS_QUIC(ssl)) { SSLerr(SSL_F_SSL_PROCESS_QUIC_POST_HANDSHAKE, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } ossl_statem_set_in_init(ssl, 1); + ret = ssl->handshake_func(ssl); + ossl_statem_set_in_init(ssl, 0); - if (ssl->handshake_func(ssl) <= 0) + if (ret <= 0) return 0; - return 1; }