From 0431b7166a469a852abe1f2d270d13d3287672a6 Mon Sep 17 00:00:00 2001 From: Dirk Date: Mon, 12 Nov 2018 20:52:36 +0100 Subject: [PATCH] Check for OpenSSL + use unames --- utils/wireshark2ciphers.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/utils/wireshark2ciphers.pl b/utils/wireshark2ciphers.pl index d272ced..ba49d24 100755 --- a/utils/wireshark2ciphers.pl +++ b/utils/wireshark2ciphers.pl @@ -6,10 +6,16 @@ use JSON; my $namelength = 30; -# Get all ciphers first (sorry only works on 64 bit mac atm) +# Get all ciphers first my @spec; my %ciphers; -foreach my $line ( split /\n/, `bin/openssl.Darwin.x86_64 ciphers -V 'ALL:COMPLEMENTOFALL:\@STRENGTH'`) { +my $ossl = "bin/openssl." . `uname -s` . "." . `uname -m`; +$ossl =~ s/\R//g; # remove LFs + +die "Unable to open $ossl" unless -f $ossl; +my $ossl = "$ossl" . " ciphers -V 'ALL:COMPLEMENTOFALL:\@STRENGTH'"; + +foreach my $line ( split /\n/, `$ossl` ) { my @fields = split /\s+/, $line; my $hex = ""; foreach my $byte ( split /,/, $fields[1] ) { @@ -40,4 +46,4 @@ while (<>) { } print "\n\n" . join ":", @ciphers; -print "\n"; \ No newline at end of file +print "\n";