]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Normalise ncp-ciphers option and restrict it to 127 bytes
authorArne Schwabe <arne@rfc2549.org>
Thu, 12 Mar 2020 11:36:54 +0000 (12:36 +0100)
committerGert Doering <gert@greenie.muc.de>
Fri, 27 Mar 2020 15:26:29 +0000 (16:26 +0100)
commitbe4531564e2be7c8a0222e6923e3f7580b358cab
treefd1b6bc78c8282e21a26caf9f4781479b3a5e6aa
parentf67efa9412a62f477aa17c3179b7e9f31ac4b25f
Normalise ncp-ciphers option and restrict it to 127 bytes

In scenarios of mbed TLS vs OpenSSL we already normalise the ciphers
that are send via the wire protocol via OCC to not have a mismatch
warning between server and client. This is done by
translate_cipher_name_from_openvpn. The same applies also to the
ncp-ciphers list. Specifying non normalised names in ncp-ciphers will
cause negotation not to succeed if ciphers are not in the same form.
Therefore we will normalise the ciphers in options_postmutate.

The alternative and a lot less user friendly alternative would be to
bail if on of the ciphers in ncp-ciphers is not in its normalised form.

Also restrict the ncp-ciphers list to 127. This is somewhat arbitrary
but should prevent too large IV_CIPHER messages and problems sending
those. The server will accept also large IV_CIPHER values from clients.

Patch V2: Correct comment about normalising ciphers
Patch V3: Correct #ifdef statement
Patch V5: Fix tests with OpenSSL 1.0.2 and libraries missing Chacha
Patch V6: Fix unit tests for mbed tls, which recognises ChaCha20-Poly1305
          only when used with all uppercase, fix missing space in message

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <20200312113654.16184-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19546.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
doc/openvpn.8
src/openvpn/options.c
src/openvpn/ssl_ncp.c
src/openvpn/ssl_ncp.h
tests/unit_tests/openvpn/test_ncp.c