mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
security/tinc: list_ciphers.py parse issue on 20.7. closes https://github.com/opnsense/plugins/issues/1976
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
"""
|
||||
Copyright (c) 2016-2019 Ad Schellevis <ad@opnsense.org>
|
||||
Copyright (c) 2016-2020 Ad Schellevis <ad@opnsense.org>
|
||||
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:]
|
||||
|
||||
Reference in New Issue
Block a user