diff --git a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/list_ciphers.py b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/list_ciphers.py index 244491048..76e2c9981 100755 --- a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/list_ciphers.py +++ b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/list_ciphers.py @@ -1,7 +1,7 @@ #!/usr/local/bin/python3 """ - Copyright (c) 2016-2019 Ad Schellevis + Copyright (c) 2016-2020 Ad Schellevis All rights reserved. Redistribution and use in source and binary forms, with or without @@ -28,19 +28,14 @@ -------------------------------------------------------------------------------------- list ciphers """ -from subprocess import Popen, PIPE +import subprocess import ujson response = dict() -p = Popen(['/usr/bin/openssl','enc', '-help'],stdin=PIPE, stdout=PIPE, stderr=PIPE, bufsize=-1) -output, error = p.communicate() -cipher_section = False -for line in error.decode().split('\n'): - if line.find('Cipher Types') == 0: - cipher_section = True - continue - if cipher_section: +p = subprocess.run(['/usr/local/bin/openssl', 'enc', '-ciphers'], capture_output=True, text=True) +for line in p.stdout.split("\n"): + if not line.startswith('Supported'): for item in line.split(): if len(item) > 1: response[item[1:]] = item[1:]