diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-09-26 21:10:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-26 21:10:21 +0200 |
| commit | 69f8e7a26513bd1b88c4faba9a16a2136ce4bd03 (patch) | |
| tree | 5823c7551e164cd552c1ca4aa2010e7076bbc9c7 /python | |
| parent | 430dda1e170576239d3580c1b7a6381525a05cbc (diff) | |
| parent | 514dfbc9ba33dd1a18a3a891d1a7d23ce9e959ee (diff) | |
| download | vyos-1x-69f8e7a26513bd1b88c4faba9a16a2136ce4bd03.tar.gz vyos-1x-69f8e7a26513bd1b88c4faba9a16a2136ce4bd03.zip | |
Merge pull request #5194 from vyos/fix/T8859-dh-keysize-validation
python: T8859: enforce positive integer min_keysize in verify_diffie_hellman_length
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/configverify.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py index c1c038a7a..89f1b7ad7 100644 --- a/python/vyos/configverify.py +++ b/python/vyos/configverify.py @@ -423,29 +423,6 @@ def verify_vlan_config(config): verify_mtu_parent(c_vlan, s_vlan) verify_mtu_ipv6(c_vlan) - -def verify_diffie_hellman_length(file, min_keysize): - """ Verify Diffie-Hellamn keypair length given via file. It must be greater - then or equal to min_keysize """ - import os - import re - from vyos.utils.process import cmdl - - try: - keysize = str(min_keysize) - except: - return False - - if os.path.exists(file): - out = cmdl(['openssl', 'dhparam', '-inform', 'PEM', '-in', file, '-text']) - prog = re.compile('\d+\s+bit') - if prog.search(out): - bits = prog.search(out)[0].split()[0] - if int(bits) >= int(min_keysize): - return True - - return False - def verify_common_route_maps(config): """ Common helper function used by routing protocol implementations to perform |
