TLSProxy/Message.pm: refine end-of-conversation detection logic.
authorAndy Polyakov <appro@openssl.org>
Mon, 16 Apr 2018 12:10:39 +0000 (14:10 +0200)
committerAndy Polyakov <appro@openssl.org>
Wed, 18 Apr 2018 17:56:12 +0000 (19:56 +0200)
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5975)

util/perl/TLSProxy/Message.pm

index 68179d9..4a60ba0 100644 (file)
@@ -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;