[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Fri May 26 18:15:11 UTC 2017


The branch master has been updated
       via  b72668a0d3586ee2560f0536c43e18991a4cfc6f (commit)
      from  7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5 (commit)


- Log -----------------------------------------------------------------
commit b72668a0d3586ee2560f0536c43e18991a4cfc6f
Author: Matt Caswell <matt at openssl.org>
Date:   Fri May 26 13:06:08 2017 +0100

    Fix a Proxy race condition
    
    Issue #3562 describes a problem where a race condition can occur in the
    Proxy such that a test "ok" line can appear in the middle of other text
    causing the test harness to miss it. The issue is that we do not wait for
    the client process to finish after the test is complete, so that process may
    continue to write data to stdout/stderr at the same time that the test
    harness does.
    
    This commit fixes TLSProxy so that we always wait for the client process to
    finish before continuing.
    
    Fixes #3562
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/3567)

-----------------------------------------------------------------------

Summary of changes:
 util/TLSProxy/Proxy.pm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/util/TLSProxy/Proxy.pm b/util/TLSProxy/Proxy.pm
index a826cb5..5c363e7 100644
--- a/util/TLSProxy/Proxy.pm
+++ b/util/TLSProxy/Proxy.pm
@@ -49,6 +49,7 @@ sub new
         clientflags => "",
         serverconnects => 1,
         serverpid => 0,
+        clientpid => 0,
         reneg => 0,
         sessionfile => undef,
 
@@ -113,6 +114,7 @@ sub clearClient
     $self->{message_list} = [];
     $self->{clientflags} = "";
     $self->{sessionfile} = undef;
+    $self->{clientpid} = 0;
     $is_tls13 = 0;
     $ciphersuite = undef;
 
@@ -240,6 +242,7 @@ sub clientstart
             }
             exec($execcmd);
         }
+        $self->clientpid($pid);
     }
 
     # Wait for incoming connection from client
@@ -338,6 +341,10 @@ sub clientstart
         waitpid( $self->serverpid, 0);
         die "exit code $? from server process\n" if $? != 0;
     }
+    die "clientpid is zero\n" if $self->clientpid == 0;
+    print "Waiting for client process to close: ".$self->clientpid."\n";
+    waitpid($self->clientpid, 0);
+
     return 1;
 }
 
@@ -531,6 +538,14 @@ sub serverpid
     }
     return $self->{serverpid};
 }
+sub clientpid
+{
+    my $self = shift;
+    if (@_) {
+        $self->{clientpid} = shift;
+    }
+    return $self->{clientpid};
+}
 
 sub fill_known_data
 {


More information about the openssl-commits mailing list