summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2015-08-13 19:14:34 +0200
committerRichard Levitte <levitte@openssl.org>2015-08-13 22:05:25 +0200
commit4deefd6567cce43ef6c6b910693c093e9598f556 (patch)
treecb3ee80565fa9da9f3d04db89edceba715a4493a /util
parentb3a231db49f864a40f999bf5b3843bebec5e3730 (diff)
Fixups in libssl test harness
- select an actual file handle for devnull - do not declare $msgdata twice - SKE records sometimes seem to come without sig - in SKE parsing, use and use $pub_key_len when parsing $pub_key Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'util')
-rw-r--r--util/TLSProxy/Message.pm2
-rw-r--r--util/TLSProxy/Proxy.pm3
-rw-r--r--util/TLSProxy/ServerKeyExchange.pm11
3 files changed, 10 insertions, 6 deletions
diff --git a/util/TLSProxy/Message.pm b/util/TLSProxy/Message.pm
index 66a4a7bc12..028322b613 100644
--- a/util/TLSProxy/Message.pm
+++ b/util/TLSProxy/Message.pm
@@ -350,7 +350,7 @@ sub repack
$lenlo = length($self->data) & 0xff;
$lenhi = length($self->data) >> 8;
- my $msgdata = pack('CnC', $self->mt, $lenhi, $lenlo).$self->data;
+ $msgdata = pack('CnC', $self->mt, $lenhi, $lenlo).$self->data;
if ($numrecs == 0) {
diff --git a/util/TLSProxy/Proxy.pm b/util/TLSProxy/Proxy.pm
index c033c29dd7..571ab10e83 100644
--- a/util/TLSProxy/Proxy.pm
+++ b/util/TLSProxy/Proxy.pm
@@ -142,7 +142,8 @@ sub start
my $oldstdout;
if(!$self->debug) {
- $oldstdout = select(File::Spec->devnull());
+ open DEVNULL, ">", File::Spec->devnull();
+ $oldstdout = select(DEVNULL);
}
# Create the Proxy socket
diff --git a/util/TLSProxy/ServerKeyExchange.pm b/util/TLSProxy/ServerKeyExchange.pm
index 3a91d1718c..b85b8addca 100644
--- a/util/TLSProxy/ServerKeyExchange.pm
+++ b/util/TLSProxy/ServerKeyExchange.pm
@@ -104,13 +104,16 @@ sub parse
my $pub_key_len = unpack('n', substr($self->data, $ptr));
$ptr += 2;
my $pub_key = substr($self->data, $ptr, $pub_key_len);
- $ptr += $g_len;
+ $ptr += $pub_key_len;
#We assume its signed
my $sig_len = unpack('n', substr($self->data, $ptr));
- $ptr += 2;
- my $sig = substr($self->data, $ptr, $sig_len);
- $ptr += $sig_len;
+ my $sig = "";
+ if (defined $sig_len) {
+ $ptr += 2;
+ $sig = substr($self->data, $ptr, $sig_len);
+ $ptr += $sig_len;
+ }
$self->p($p);
$self->g($g);