From b2c61e2127d83cc0a0e27092462b62c2e8e7eaa1 Mon Sep 17 00:00:00 2001 From: Marcus Hoff Date: Tue, 22 Sep 2020 19:44:24 +0200 Subject: openvpn: T2907: add 'none' encryption option to not encrypt any data --- data/templates/openvpn/server.conf.tmpl | 4 +++- interface-definitions/interfaces-openvpn.xml.in | 16 ++++++++++++---- src/conf_mode/interfaces-openvpn.py | 8 +++++++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/data/templates/openvpn/server.conf.tmpl b/data/templates/openvpn/server.conf.tmpl index 401f8e04b..8a1ac6bd8 100644 --- a/data/templates/openvpn/server.conf.tmpl +++ b/data/templates/openvpn/server.conf.tmpl @@ -196,7 +196,9 @@ tls-server # Encryption options {%- if encryption %} -{% if encryption == 'des' -%} +{% if encryption == 'none' -%} +cipher none +{%- elif encryption == 'des' -%} cipher des-cbc {%- elif encryption == '3des' -%} cipher des-ede3-cbc diff --git a/interface-definitions/interfaces-openvpn.xml.in b/interface-definitions/interfaces-openvpn.xml.in index 905c76507..5675379d5 100644 --- a/interface-definitions/interfaces-openvpn.xml.in +++ b/interface-definitions/interfaces-openvpn.xml.in @@ -63,8 +63,12 @@ Standard Data Encryption Algorithm - des 3des bf128 bf256 aes128 aes128gcm aes192 aes192gcm aes256 aes256gcm + none des 3des bf128 bf256 aes128 aes128gcm aes192 aes192gcm aes256 aes256gcm + + none + Disable encryption + des DES algorithm @@ -106,7 +110,7 @@ AES algorithm with 256-bit key GCM - (des|3des|bf128|bf256|aes128|aes128gcm|aes192|aes192gcm|aes256|aes256gcm) + (none|des|3des|bf128|bf256|aes128|aes128gcm|aes192|aes192gcm|aes256|aes256gcm) @@ -114,8 +118,12 @@ Cipher negotiation list for use in server or client mode - des 3des aes128 aes128gcm aes192 aes192gcm aes256 aes256gcm + none des 3des aes128 aes128gcm aes192 aes192gcm aes256 aes256gcm + + none + Disable encryption + des DES algorithm @@ -149,7 +157,7 @@ AES algorithm with 256-bit key GCM - (des|3des|aes128|aes128gcm|aes192|aes192gcm|aes256|aes256gcm) + (none|des|3des|aes128|aes128gcm|aes192|aes192gcm|aes256|aes256gcm) diff --git a/src/conf_mode/interfaces-openvpn.py b/src/conf_mode/interfaces-openvpn.py index f83590209..518dbdc0e 100755 --- a/src/conf_mode/interfaces-openvpn.py +++ b/src/conf_mode/interfaces-openvpn.py @@ -257,7 +257,10 @@ def get_config(config=None): if conf.exists('encryption ncp-ciphers'): _ncp_ciphers = [] for enc in conf.return_values('encryption ncp-ciphers'): - if enc == 'des': + if enc == 'none': + _ncp_ciphers.append('none') + _ncp_ciphers.append('NONE') + elif enc == 'des': _ncp_ciphers.append('des-cbc') _ncp_ciphers.append('DES-CBC') elif enc == '3des': @@ -944,6 +947,9 @@ def verify(openvpn): else: print('Diffie-Hellman prime file is unspecified, assuming ECDH') + if openvpn['encryption'] == 'none': + print('Warning: "encryption none" was specified. NO encryption will be performed and tunnelled data WILL be transmitted in clear text over the network!') + # # Auth user/pass # -- cgit v1.2.3