summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-04-15 16:38:57 +0200
committerGitHub <noreply@github.com>2024-04-15 16:38:57 +0200
commit8528764c97a5dd91ece7d3df5646fdacd648a588 (patch)
treee1156083214a68cdb95d609b80c5000e666dbbac /src
parenta6ccf358c7148781be438c4a2f89468ebfe5d48f (diff)
parent95cd743c24c6f7720af87450312fc111649db849 (diff)
downloadvyos-1x-8528764c97a5dd91ece7d3df5646fdacd648a588.tar.gz
vyos-1x-8528764c97a5dd91ece7d3df5646fdacd648a588.zip
Merge pull request #3308 from sever-sever/T5734
T5734: OpenVPN check PKI DH name exists if DH configured
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces_openvpn.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces_openvpn.py b/src/conf_mode/interfaces_openvpn.py
index 505ec55c6..0ecffd3be 100755
--- a/src/conf_mode/interfaces_openvpn.py
+++ b/src/conf_mode/interfaces_openvpn.py
@@ -198,6 +198,12 @@ def verify_pki(openvpn):
raise ConfigError(f'Cannot use encrypted private key on openvpn interface {interface}')
if 'dh_params' in tls:
+ if 'dh' not in pki:
+ raise ConfigError(f'pki dh is not configured')
+ proposed_dh = tls['dh_params']
+ if proposed_dh not in pki['dh'].keys():
+ raise ConfigError(f"pki dh '{proposed_dh}' is not configured")
+
pki_dh = pki['dh'][tls['dh_params']]
dh_params = load_dh_parameters(pki_dh['parameters'])
dh_numbers = dh_params.parameter_numbers()