$ENV{OPENSSL_ia32cap} = '~0x200000200000000';
sub checkmessages($$$$$$);
+sub clearclient();
sub clearall();
my $chellotickext = 0;
$proxy->serverconnects(2);
$proxy->clientflags("-sess_out ".$session);
$proxy->start();
-$proxy->clear();
+$proxy->clearClient();
$proxy->clientflags("-sess_in ".$session);
$proxy->clientstart();
checkmessages(4, "Session resumption session ticket test", 1, 0, 0, 0);
$proxy->serverconnects(2);
$proxy->clientflags("-sess_out ".$session." -no_ticket");
$proxy->start();
-$proxy->clear();
+$proxy->clearClient();
$proxy->clientflags("-sess_in ".$session);
$proxy->clientstart();
checkmessages(5, "Session resumption with ticket capable client without a "
$proxy->filter(undef);
$proxy->clientflags("-sess_out ".$session);
$proxy->start();
-$proxy->clear();
+$proxy->clearClient();
$proxy->clientflags("-sess_in ".$session." -sess_out ".$session);
$proxy->filter(\&inject_empty_ticket_filter);
$proxy->clientstart();
#Expected result: ClientHello extension seen; ServerHello extension seen;
# NewSessionTicket message seen; Abbreviated handshake.
checkmessages(7, "Empty ticket resumption test", 1, 1, 1, 0);
-clearall();
+clearclient();
$proxy->clientflags("-sess_in ".$session);
$proxy->filter(undef);
$proxy->clientstart();
}
}
-sub clearall()
+
+sub clearclient()
{
$chellotickext = 0;
$shellotickext = 0;
$fullhand = 0;
$ticketseen = 0;
+ $proxy->clearClient();
+}
+
+sub clearall()
+{
+ clearclient();
$proxy->clear();
}
#Test 2: Testing something below SSLv3 should fail
$client_version = TLSProxy::Record::VERS_SSL_3_0 - 1;
-$proxy->restart();
+$proxy->clear();
+$proxy->start();
ok(TLSProxy::Message->fail(), "Version tolerance test, SSL < 3.0");
sub vers_tolerance_filter
$proxy->serverconnects(2);
$proxy->clientflags("-sess_out ".$session);
$proxy->start();
-$proxy->clear();
+$proxy->clearClient();
$proxy->clientflags("-sess_in ".$session);
$proxy->clientstart();
checkmessages(5, "Session resumption extended master secret test", 1, 1, 0);
$proxy->serverconnects(2);
$proxy->clientflags("-sess_out ".$session);
$proxy->start();
-$proxy->clear();
+$proxy->clearClient();
$proxy->clientflags("-sess_in ".$session);
setrmextms(0, 0);
$proxy->clientstart();
$proxy->serverconnects(2);
$proxy->clientflags("-sess_out ".$session);
$proxy->start();
-$proxy->clear();
+$proxy->clearClient();
$proxy->clientflags("-sess_in ".$session);
setrmextms(1, 0);
$proxy->clientstart();
$proxy->serverconnects(2);
$proxy->clientflags("-sess_out ".$session);
$proxy->start();
-$proxy->clear();
+$proxy->clearClient();
$proxy->clientflags("-sess_in ".$session);
setrmextms(0, 1);
$proxy->clientstart();
$proxy->serverconnects(2);
$proxy->clientflags("-sess_out ".$session);
$proxy->start();
-$proxy->clear();
+$proxy->clearClient();
$proxy->clientflags("-sess_in ".$session);
setrmextms(0, 0);
$proxy->clientstart();
# Hudson (tjh@cryptsoft.com).
use strict;
+use POSIX ":sys_wait_h";
package TLSProxy::Proxy;
serverflags => "",
clientflags => "",
serverconnects => 1,
+ serverpid => 0,
#Public read
execute => $execute,
return bless $self, $class;
}
-sub clear
+sub clearClient
{
my $self = shift;
$self->{cipherc} = "";
- $self->{ciphers} = "AES128-SHA";
$self->{flight} = 0;
$self->{record_list} = [];
$self->{message_list} = [];
- $self->{serverflags} = "";
$self->{clientflags} = "";
- $self->{serverconnects} = 1;
TLSProxy::Message->clear();
TLSProxy::Record->clear();
}
+sub clear
+{
+ my $self = shift;
+
+ $self->clearClient;
+ $self->{ciphers} = "AES128-SHA";
+ $self->{serverflags} = "";
+ $self->{serverconnects} = 1;
+ $self->{serverpid} = 0;
+}
+
sub restart
{
my $self = shift;
}
exec($execcmd);
}
+ $self->serverpid($pid);
$self->clientstart;
}
if(!$self->debug) {
select($oldstdout);
}
+ $self->serverconnects($self->serverconnects - 1);
+ if ($self->serverconnects == 0) {
+ die "serverpid is zero\n" if $self->serverpid == 0;
+ print "Waiting for server process to close: "
+ .$self->serverpid."\n";
+ waitpid( $self->serverpid, 0);
+ }
}
sub process_packet
}
return $self->{message_list};
}
+sub serverpid
+{
+ my $self = shift;
+ if (@_) {
+ $self->{serverpid} = shift;
+ }
+ return $self->{serverpid};
+}
1;