From: Andy Polyakov Date: Mon, 16 Apr 2018 12:10:39 +0000 (+0200) Subject: TLSProxy/Message.pm: refine end-of-conversation detection logic. X-Git-Tag: OpenSSL_1_1_1-pre6~91 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3f473b936a292262a020353e99f896cabfedc947;p=oweals%2Fopenssl.git TLSProxy/Message.pm: refine end-of-conversation detection logic. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/5975) --- diff --git a/util/perl/TLSProxy/Message.pm b/util/perl/TLSProxy/Message.pm index 68179d914d..4a60ba0157 100644 --- a/util/perl/TLSProxy/Message.pm +++ b/util/perl/TLSProxy/Message.pm @@ -267,14 +267,17 @@ sub get_messages } } elsif ($record->content_type == TLSProxy::Record::RT_ALERT) { my ($alertlev, $alertdesc) = unpack('CC', $record->decrypt_data); + print " [$alertlev, $alertdesc]\n"; #A CloseNotify from the client indicates we have finished successfully #(we assume) if (!$end && !$server && $alertlev == AL_LEVEL_WARN && $alertdesc == AL_DESC_CLOSE_NOTIFY) { $success = 1; } - #All alerts end the test - $end = 1; + #Fatal or close notify alerts end the test + if ($alertlev == AL_LEVEL_FATAL || $alertdesc == AL_DESC_CLOSE_NOTIFY) { + $end = 1; + } } return @messages;