Default to --cipher BF-CBC if not set and compat-mode < 2.4.0
PATCH 1/1 Default to --cipher BF-CBC if not set and compat-mode < 2.4.0
When we try to make a configuration compatible to a version earlier than 2.4.0 we probably need to have a --cipher configured since NCP is not available. In configuration where --cipher is not specified we default to BF-CBC to support these old clients.
Note that with OpenSSL 3.0 you will also need to enable the legacy provider otherwise we bail out since BF-CBC is no longer supported.
Also move the condition so BF-CBC gets included in the data-ciphers list.
--- src/openvpn/options.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
src/openvpn/options.c +13 -7
@@ -3193,6 +3193,19 @@ options_set_backwards_compatible_options(struct options *o) } } +/* Versions < 2.4.0 additionally might be compiled with --enable-small and +* not have OCC strings required for "poor man's NCP" */ +if (need_compatibility_before (o,20400 )) + { +if (!o->ciphername) + { +/* If ciphername is not set default to BF-CBC when targeting these +* old versions that do not have NCP */ + o->ciphername ="BF-CBC" ; + } + o->enable_ncp_fallback = true; + } +/* Versions < 2.5.0 do need --cipher in the list of accepted ciphers. * Version 2.4 might probably does not need it but NCP was not so * good with 2.4 and ncp-disable might be more common on 2.4 peers.
@@ -3205,13 +3218,6 @@ options_set_backwards_compatible_options(struct options *o)append_cipher_to_ncp_list (o, o->ciphername); } -/* Versions < 2.4.0 additionally might be compiled with --enable-small and -* not have OCC strings required for "poor man's NCP" */ -if (o->ciphername &&need_compatibility_before (o,20400 )) - { - o->enable_ncp_fallback = true; - } -/* Compression is deprecated and we do not want to announce support for it * by default anymore, additionally DCO breaks with compression. *
Signature · 1 line
2.33.0
PATCH v2 1/1 Default to --cipher BF-CBC if not set and compat-mode < 2.4.0
When we try to make a configuration compatible to a version earlier than 2.4.0 we probably need to have a --cipher configured since NCP is not available. In configuration where --cipher is not specified we default to BF-CBC to support these old clients.
Note that with OpenSSL 3.0 you will also need to enable the legacy provider otherwise we bail out since BF-CBC is no longer supported.
Also move the condition so BF-CBC gets included in the data-ciphers list.
Patch v2: move the comment to a better place.
--- src/openvpn/options.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
src/openvpn/options.c +13 -7
@@ -3186,6 +3186,19 @@ options_set_backwards_compatible_options(struct options *o) } } +if (need_compatibility_before (o,20400 )) + { +if (!o->ciphername) + { +/* If ciphername is not set default to BF-CBC when targeting these +* old versions that do not have NCP */ + o->ciphername ="BF-CBC" ; + } +/* Versions < 2.4.0 additionally might be compiled with --enable-small and +* not have OCC strings required for "poor man's NCP" */ + o->enable_ncp_fallback = true; + } +/* Versions < 2.5.0 do need --cipher in the list of accepted ciphers. * Version 2.4 might probably does not need it but NCP was not so * good with 2.4 and ncp-disable might be more common on 2.4 peers.
@@ -3198,13 +3211,6 @@ options_set_backwards_compatible_options(struct options *o)append_cipher_to_ncp_list (o, o->ciphername); } -/* Versions < 2.4.0 additionally might be compiled with --enable-small and -* not have OCC strings required for "poor man's NCP" */ -if (o->ciphername &&need_compatibility_before (o,20400 )) - { - o->enable_ncp_fallback = true; - } -#ifdef USE_COMP /* Compression is deprecated and we do not want to announce support for it * by default anymore, additionally DCO breaks with compression.
Signature · 1 line
2.33.0
Hi,
Quoted 8 lines · Arne Schwabe
When we try to make a configuration compatible to a version earlier than 2.4.0 we probably need to have a --cipher configured since NCP is not available. In configuration where --cipher is not specified we default to BF-CBC to support these old clients.
Note that with OpenSSL 3.0 you will also need to enable the legacy provider otherwise we bail out since BF-CBC is no longer supported.
Quoted 6 lines
Also move the condition so BF-CBC gets included in the data-ciphers list.
Patch v2: move the comment to a better place.
Signed-off-by Arne Schwabe <[email protected]...>
Unfortunately I cannot fully ACK this patch because I'd need to compile 2.3 to run a test, but this turned to be a mission impossible (due to OpenSSL compatibility issues).
The change makes sense and it should do what we expect.
If anybody wants to test against an openvpn2.3 peer is most welcome.
Cheers,
Signature · 1 line
Antonio Quartulli
Am 04.02.22 um 17:51 schrieb Antonio Quartulli:
Quoted 18 lines
Hi,
Quoted 8 lines · Arne Schwabe
When we try to make a configuration compatible to a version earlier than 2.4.0 we probably need to have a --cipher configured since NCP is not available. In configuration where --cipher is not specified we default to BF-CBC to support these old clients.
Note that with OpenSSL 3.0 you will also need to enable the legacy provider otherwise we bail out since BF-CBC is no longer supported.
Quoted 6 lines
Also move the condition so BF-CBC gets included in the data-ciphers list.
Patch v2: move the comment to a better place.
Signed-off-by Arne Schwabe <[email protected]...>
Quoted 7 lines
Reviewed-by Antonio Quartulli <[email protected]...>Unfortunately I cannot fully ACK this patch because I'd need to compile 2.3 to run a test, but this turned to be a mission impossible (due to OpenSSL compatibility issues).
The change makes sense and it should do what we expect.
If anybody wants to test against an openvpn2.3 peer is most welcome.
A 2.4 client with ncp-disable should work nicely as well. We just do not make ourselves compatible with 2.4.0 with ncp-disable if you select 2.4.0, you need 2.3.0 for that.
Arne
Antonio Quartulli
Acked-byHi,
Quoted 1 line · Arne Schwabe
A 2.4 client with ncp-disable should work nicely as well. We just do not make ourselves compatible with 2.4.0 with ncp-disable if you select 2.4.0, you need 2.3.0 for that.
Thanks for the hint!
Went the lazy route and tested against 2.4.11 with --ncp-disable.
Server: 2.4.11 with --ncp-disable (to mimic 2.3.x) and no --cipher specified (BF-CBC is therefore the default).
Client: master + this patch and no --cipher specified.
* First attempt: wrong cipher negotiated and connection breaks.
* Second attempt: add --compat-mode 2.3.0 to client (to exercise the code implemented by this patch) and I could happily connect to the 2.3.x-like server using BF-CBC.
Signature · 1 line
Antonio Quartulli
I have not given this much testing, as Antonio has tested the relevant combinations. Code looks good. Client-tested.
Your patch has been applied to the master branch.
commit fd72a3b99dcb110953d8466bfe6c47dab3a29657
Author: Arne Schwabe Date: Fri Nov 5 16:07:42 2021 +0100
Default to --cipher BF-CBC if not set and compat-mode < 2.4.0
Signed-off-by: Arne Schwabe <[email protected]...>
Acked-by: Antonio Quartulli <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg23100.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering