From 01b446f469759acfe9aa6ac37c82e0f199b15663 Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Fri, 5 Jun 2020 18:04:09 +0200 Subject: [PATCH] Fix SessionTicket length in unencrypted case --- src/internal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index 69faa7c01..2d3d16c7a 100644 --- a/src/internal.c +++ b/src/internal.c @@ -28265,7 +28265,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, #endif } - if (IsEncryptionOn(ssl, 1)) + if (IsEncryptionOn(ssl, 1) && ssl->options.handShakeDone) sendSz += cipherExtraData(ssl); /* check for available size */ @@ -28326,7 +28326,8 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, ssl->buffers.outputBuffer.length += sendSz; - ret = SendBuffered(ssl); + if (!ssl->options.groupMessages) + ret = SendBuffered(ssl); WOLFSSL_LEAVE("SendTicket", ret); WOLFSSL_END(WC_FUNC_TICKET_SEND);