diff options
author | Christian Breunig <christian@breunig.cc> | 2023-08-11 07:53:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-11 07:53:55 +0200 |
commit | 4659f25804bd1b534767c134247c24699aaca722 (patch) | |
tree | 5016d917baccec0eb5326e1d6aed7609370d90af /src/conf_mode | |
parent | bfbd7273b33119854b4285a44b13bfcdcc2d1564 (diff) | |
parent | e7d7bd20b8fafaaabdd093393f4fa22167af8d3c (diff) | |
download | vyos-1x-4659f25804bd1b534767c134247c24699aaca722.tar.gz vyos-1x-4659f25804bd1b534767c134247c24699aaca722.zip |
Merge pull request #2146 from dmbaturin/T5270-openvpn-dh-optional
openvpn: T5270: do not require classic DH params in any mode
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/interfaces-openvpn.py | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/conf_mode/interfaces-openvpn.py b/src/conf_mode/interfaces-openvpn.py index 2a9b43f9b..26b217d98 100755 --- a/src/conf_mode/interfaces-openvpn.py +++ b/src/conf_mode/interfaces-openvpn.py @@ -189,16 +189,7 @@ def verify_pki(openvpn): if dict_search_args(pki, 'certificate', tls['certificate'], 'private', 'password_protected') is not None: raise ConfigError(f'Cannot use encrypted private key on openvpn interface {interface}') - if mode == 'server' and 'dh_params' not in tls and not is_ec_private_key(pki, tls['certificate']): - raise ConfigError('Must specify "tls dh-params" when not using EC keys in server mode') - if 'dh_params' in tls: - if 'dh' not in pki: - raise ConfigError('There are no DH parameters in PKI configuration') - - if tls['dh_params'] not in pki['dh']: - raise ConfigError(f'Invalid dh-params on openvpn interface {interface}') - pki_dh = pki['dh'][tls['dh_params']] dh_params = load_dh_parameters(pki_dh['parameters']) dh_numbers = dh_params.parameter_numbers() @@ -207,6 +198,7 @@ def verify_pki(openvpn): if dh_bits < 2048: raise ConfigError(f'Minimum DH key-size is 2048 bits') + if 'auth_key' in tls or 'crypt_key' in tls: if not dict_search_args(pki, 'openvpn', 'shared_secret'): raise ConfigError('There are no openvpn shared-secrets in PKI configuration') @@ -495,9 +487,6 @@ def verify(openvpn): if openvpn['protocol'] == 'tcp-active': raise ConfigError('Cannot specify "tcp-active" when "tls role" is "passive"') - if not dict_search('tls.dh_params', openvpn): - raise ConfigError('Must specify "tls dh-params" when "tls role" is "passive"') - if 'certificate' in openvpn['tls'] and is_ec_private_key(openvpn['pki'], openvpn['tls']['certificate']): if 'dh_params' in openvpn['tls']: print('Warning: using dh-params and EC keys simultaneously will ' \ |