From 10bda8f8dd359b3db39a5157be0e72afe9f05eea Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Thu, 7 Jun 2018 10:00:44 +0100 Subject: [PATCH] Reformulate the if condition in tls_process_new_session_ticket Improves readability Reviewed-by: Andy Polyakov (Merged from https://github.com/openssl/openssl/pull/6415) --- ssl/statem/statem_clnt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index 754fedb1af..ff353842f9 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -2566,9 +2566,8 @@ MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, PACKET *pkt) && (!PACKET_get_net_4(pkt, &age_add) || !PACKET_get_length_prefixed_1(pkt, &nonce))) || !PACKET_get_net_2(pkt, &ticklen) - || (!SSL_IS_TLS13(s) && PACKET_remaining(pkt) != ticklen) - || (SSL_IS_TLS13(s) - && (ticklen == 0 || PACKET_remaining(pkt) < ticklen))) { + || (SSL_IS_TLS13(s) ? (ticklen == 0 || PACKET_remaining(pkt) < ticklen) + : PACKET_remaining(pkt) != ticklen)) { SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_F_TLS_PROCESS_NEW_SESSION_TICKET, SSL_R_LENGTH_MISMATCH); goto err; -- 2.25.1