]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Cleanup: Remove special case code for old poor man's NCP.
authorArne Schwabe <arne@rfc2549.org>
Thu, 9 Jul 2020 10:16:01 +0000 (12:16 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 10 Jul 2020 16:05:37 +0000 (18:05 +0200)
commite539c95dc8d240327be17e8647e52556dd7fd92d
tree5b1f52e8f52c32dca1800e73b0cdcfcf5e9ffc95
parent07560d9ed11a4bfdd7f2446f2c6ff854ee091154
Cleanup: Remove special case code for old poor man's NCP.

Ever since the NCPv2 the ncp_get_best_cipher uses the global
options->ncp_enabled option and ignore the tls_session->ncp_enabled
option.

The server side's poor man's NCP is implemented as seeing the list
of supported ciphers from the peer as just one cipher so this special
handling for poor man's NCP of the older NCP here is not needed anymore.

Theoretically we can now get rid of tls_session->ncp_enabled but doing
so requires more refactoring since options is not available in the
methods that still use it. And when we remove ncp-disable the variable
will be removed anyway.

This commit moves the data channel key generation for the corner case of a
client not supporting NCP but having the same cipher as the server to
the same function that also generates data channel keys for NCP and
poort man's NCP.

This has an unintended side effect of changing the calculated frame
size for this special case. The old path did call
tls_session_update_crypto_params.
To avoid this change in behaviour, this patch adds a hacky
workaround for this.

A proper solution for this needs still be found but this allows the patch
set to be merged.

Document the remaining usage of tls_poor_mans_ncp better.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20200709101603.11941-6-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20251.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/init.c
src/openvpn/ssl.c