summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason McAllister <16666676+jdmac87@users.noreply.github.com>2019-10-21 15:59:01 +0100
committerJason McAllister <16666676+jdmac87@users.noreply.github.com>2019-10-21 23:17:53 +0100
commit915116e69a532e427c0ddd2037138c5299f9e485 (patch)
treea1202088a35f2965eda4bfaefee75a6b1f217496 /src
parentc761e94b5619c605d280bf613f6c5b35fc008dd9 (diff)
downloadvyos-1x-915116e69a532e427c0ddd2037138c5299f9e485.tar.gz
vyos-1x-915116e69a532e427c0ddd2037138c5299f9e485.zip
T1755: fixes issue with 'show vpn ipsec sa' command where lack of keysize (encr-keysize) will result in KeyError - such as for CHACHA20_POLY1305
Diffstat (limited to 'src')
-rwxr-xr-xsrc/op_mode/show_ipsec_sa.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/op_mode/show_ipsec_sa.py b/src/op_mode/show_ipsec_sa.py
index 70e892aa6..e319cc38d 100755
--- a/src/op_mode/show_ipsec_sa.py
+++ b/src/op_mode/show_ipsec_sa.py
@@ -82,7 +82,10 @@ for sa in sas:
pkts_str = re.sub(r'B', r'', pkts_str)
enc = isa["encr-alg"].decode()
- key_size = isa["encr-keysize"].decode()
+ if "encr-keysize" in isa:
+ key_size = isa["encr-keysize"].decode()
+ else:
+ key_size = ""
if "integ-alg" in isa:
hash = isa["integ-alg"].decode()
else:
@@ -91,7 +94,10 @@ for sa in sas:
dh_group = isa["dh-group"].decode()
else:
dh_group = ""
- proposal = "{0}_{1}".format(enc, key_size)
+
+ proposal = enc
+ if key_size:
+ proposal = "{0}_{1}".format(proposal, key_size)
if hash:
proposal = "{0}/{1}".format(proposal, hash)
if dh_group: