diff options
author | Daniil Baturin <daniil@baturin.org> | 2014-05-25 05:39:20 -0700 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2014-05-25 05:39:20 -0700 |
commit | 960810b0b56d404b4abf275abfadfe3d77888ae5 (patch) | |
tree | 317660bf78138cb357c1366a140b8eb478cc867d | |
parent | 0640aecf6f8457b6bc3856d82a6ea6eb41afae11 (diff) | |
parent | b9136d195651f8c9c3cbec2a7ec250d87962a0c0 (diff) | |
download | vyatta-op-vpn-960810b0b56d404b4abf275abfadfe3d77888ae5.tar.gz vyatta-op-vpn-960810b0b56d404b4abf275abfadfe3d77888ae5.zip |
Merge pull request #2 from ryanriske/helium-sha2vyos/1.1.0-beta1
Bug 220: Add support for SHA2 hashes
-rw-r--r-- | lib/OPMode.pm | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/OPMode.pm b/lib/OPMode.pm index cf5e635..9d83941 100644 --- a/lib/OPMode.pm +++ b/lib/OPMode.pm @@ -89,8 +89,11 @@ sub conv_dh_group { sub conv_hash { my $hash = pop(@_); - if ($hash =~ /.*_(.*)/){ + if ($hash =~ /[^_]*_(.*)/){ $hash = lc($1); + if ($hash =~ /sha2_(.*)/){ + $hash = "sha".$1; + } } return $hash; } @@ -820,8 +823,8 @@ EOH print "\n Description: $desc\n" if (defined($desc)); print <<EOH; - Tunnel State Bytes Out/In Encrypt Hash NAT-T A-Time L-Time Proto - ------ ----- ------------- ------- ---- ----- ------ ------ ----- + Tunnel State Bytes Out/In Encrypt Hash NAT-T A-Time L-Time Proto + ------ ----- ------------- ------- ---- ----- ------ ------ ----- EOH for my $tunnel (tunSort(@{$tunhash{$connid}->{_tunnels}})){ (my $tunnum, my $state, my $inbytes, my $outbytes, @@ -840,7 +843,7 @@ EOH } my $atime = $life - $expire; $atime = 0 if ($atime == $life); - printf " %-7s %-6s %-14s %-8s %-5s %-6s %-7s %-7s %-2s\n", + printf " %-7s %-6s %-14s %-8s %-7s %-6s %-7s %-7s %-2s\n", $tunnum, $state, $bytesp, $enc, $hash, $natt, $atime, $life, $proto; } @@ -1065,8 +1068,8 @@ EOH print "\n Description: $desc\n" if (defined($desc)); print <<EOH; - State Encrypt Hash D-H Grp NAT-T A-Time L-Time - ----- ------- ---- ------- ----- ------ ------ + State Encrypt Hash D-H Grp NAT-T A-Time L-Time + ----- ------- ---- ------- ----- ------ ------ EOH for my $tunnel (tunSort(@{$tunhash{$connid}->{_tunnels}})){ (my $tunnum, my $state, my $isakmpnum, my $enc, @@ -1077,7 +1080,7 @@ EOH $dhgrp = conv_dh_group($dhgrp); my $atime = $life - $expire; $atime = 0 if ($atime == $life); - printf " %-6s %-8s %-5s %-8s %-6s %-7s %-7s\n", + printf " %-6s %-8s %-7s %-8s %-6s %-7s %-7s\n", $state, $enc, $hash, $dhgrp, $natt, $atime, $life; } print "\n \n"; |