Remove support for key-method 1 from master/2.4
Hi,
To create keys for the data channel, OpenVPN currently supports two mechanisms, 'Key method 1' and the newer 'Key method 2'. Key method 2 is supported since OpenVPN 1.5, and has been the default from OpenVPN 2.0. See the manpage and/or http://openvpn.net/index.php/open-source/documentation/security-overview.html for a short recap of both methods.
I think the time has come to remove support for key method 1 from OpenVPN. This will allow us to remove quite some legacy code, and will probably allow us to simplify some of the surrounding code.
However, before investing time in preparing a patch for this, I would like to hear if there are objections to this proposal. So, if you have a setup that uses key method 1, and you want to use that setup with OpenVPN 2.4, or have other reasons to believe we should keep supporting key method 1 in OpenVPN 2.4, please speak up.
-Steffan
PATCH 1/1 Deprecate key-method 1
Key method 2 has been the default since OpenVPN 2.0, and is both more functional and secure. Also, key method 1 was only ever supported for peer-to-peer connections (i.e. not for client-server).
Let's get rid of some legacy and phase out key method 1.
--- src/openvpn/options.c | 6 ++++++ 1 file changed, 6 insertions(+)
src/openvpn/options.c +6 -0
@@ -2245,6 +2245,12 @@ options_postprocess_verify_ce (const struct options *options, const struct conne "may accept clients which do not present a certificate"); } +if (options->key_method ==1 ) + { +msg (M_WARN ,"WARNING: --key-method 1 is deprecated and will be removed" +"in OpenVPN 2.5. Migrate to --key-method 2 as soon as possible." ); + } +if (options->tls_server || options->tls_client) {#ifdef ENABLE_PKCS11
Signature · 1 line
2.7.4
PATCH v2 1/1 Deprecate key-method 1
Key method 2 has been the default since OpenVPN 2.0, and is both more functional and secure. Also, key method 1 was only ever supported for peer-to-peer connections (i.e. not for client-server).
Let's get rid of some legacy and phase out key method 1.
v2: add Changes.rst entry, and update man page
--- Changes.rst | 7 +++++++ doc/openvpn.8 | 5 ++++- src/openvpn/options.c | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-)
Changes.rst +7 -0
@@ -112,6 +112,13 @@ AIX platform support devices since AIX does not provide tun interface. +Deprecated features +------------------- +- ``--key-method 1`` is deprecated in 2.4 and will be removed in 2.5. Migrate + to ``--key-method 2`` as soon as possible. Note that this requires changing + the option in both the client and server side configs. + + User-visible Changes -------------------- - For certificate DNs with duplicate fields, e.g. "OU=one,OU=two", both fields
doc/openvpn.8 +4 -1
@@ -4782,7 +4782,10 @@ exchanged over the TLS session. In method 1 (the default for OpenVPN 1.x), both sides generate random encrypt and HMAC-send keys which are forwarded to -the other host over the TLS channel. +the other host over the TLS channel. Method 1 is +.B deprecated in OpenVPN 2.4 +, and +.B will be removed in OpenVPN 2.5\fR. In method 2, (the default for OpenVPN 2.0) the client generates a random key. Both client
src/openvpn/options.c +6 -0
@@ -2245,6 +2245,12 @@ options_postprocess_verify_ce (const struct options *options, const struct conne "may accept clients which do not present a certificate"); } +if (options->key_method ==1 ) + { +msg (M_WARN ,"WARNING: --key-method 1 is deprecated and will be removed" +"in OpenVPN 2.5. Migrate to --key-method 2 as soon as possible." ); + } +if (options->tls_server || options->tls_client) {#ifdef ENABLE_PKCS11
Signature · 1 line
2.7.4
Re: [Openvpn-devel] [PATCH v2] Deprecate key-method 1
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 5 lines · Steffan Karger
Key method 2 has been the default since OpenVPN 2.0, and is both more functional and secure. Also, key method 1 was only ever supported for peer-to-peer connections (i.e. not for client-server).
Quoted 7 lines
Let's get rid of some legacy and phase out key method 1.
v2: add
Changes.rstentry, and update man pageSigned-off-by Steffan Karger <[email protected]...> --- Changes.rst| 7 +++++++ doc/openvpn.8 | 5 ++++-
src/openvpn/options.c|
6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-)
I wanted to give this an ACK ... but I think we should just remove it all together as we seem to be in a broken state already.
/usr/sbin/openvpn --dev tun --local 192.168.122.1 --lport 1194 \
--remote 192.168.122.100 --rport 194 \
--secret ../../sample/sample-keys/ta.key 0 \
--ifconfig 10.8.0.10 10.8.0.20 --verb 3 \
--key-method 1Options error: Parameter key_method can only be specified in TLS-mode, i.e. where --tls-server or --tls-client is also specified. Use --help for more information.
That is with /usr/sbin/openvpn --version:
OpenVPN 2.3.11 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on May 10 2016
So unless I messed up my simple and stupid static key p2p mode tunnel, this doesn't work at all with v2.3. And git master haven't "fixed" this issue.
If nobody noticed this by now, then nobody really uses --key-method.
- --
kind regards,
David Sommerseth
OpenVPN Technologies, Inc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAEBAgAGBQJYKi41AAoJEIbPlEyWcf3yVasP/0vlhDldY6i+HkBGrlMg1OxK TnuTlqdoz3pg3q3DJT20+7plpsXdahfymB3cETwI27A71gTLx3o894f0zZDAGNvU b2svnA7VSGnQMc0E8Bg6puyZJi88MtIibNtVScuu47POumS8I/FcRYB6TVIyr815 MU9q7dsyVXeX9rHBKY7gXfgZGkvBnTEOS67HimIF/fxY+mHQffYJAyRwlZcFZ78V HW3ymUa/FY28AKMMSaa0xemuaCM6bthIYd7H7o02kTLOVKHXoqgKOG0Axd7yL9i0 pLuzPSiPGrIojw8W1i/n2X50RMTfKhrevwpCD6GYu9LS013et7LLiLGlvEKFbgOJ NjTd+A5yHjDx75YZ9LQr8I0Tb/Ix6Xm41NCdDQaykSDmztCpWm11tGZuOxEDVUeC wuzHGfwox7lG2Q+M9rW3V/w077eVwxLg4gFuUD+w3S9qKwTuPw5PGH0R7zojL22T tb626KAbOFQjk3NzDG97HCWC3BPB7LT5anPuLcxdsrL3Wf05DqarcBEJp3nQQgnm r1jCg09awOAld4kcmyE57rPCc8/GahTHbDFTLu5s5XI7Auo6LCqHecuhJgslT3Qk LGNP8PVb8LK80sfmvXInvNtxh3zdvRo+YD9tluXbPcs+ynbxD/8mBaib84aLhyw5 FGPPexuZhKkAINHyduu2
=NQRH
-----END PGP SIGNATURE-----
Re: [Openvpn-devel] [PATCH v2] Deprecate key-method 1
Hi,
On 14 November 2016 at 22:35, David Sommerseth
<[email protected]...> wrote:
Quoted 29 lines · Steffan Karger
Quoted 5 lines
Key method 2 has been the default since OpenVPN 2.0, and is both more functional and secure. Also, key method 1 was only ever supported for peer-to-peer connections (i.e. not for client-server).
Quoted 7 lines
Let's get rid of some legacy and phase out key method 1.
v2: add
Changes.rstentry, and update man pageSigned-off-by Steffan Karger <[email protected]...> --- Changes.rst| 7 +++++++ doc/openvpn.8 | 5 ++++-
src/openvpn/options.c|
6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-)I wanted to give this an ACK ... but I think we should just remove it all together as we seem to be in a broken state already.
/usr/sbin/openvpn --dev tun --local 192.168.122.1 --lport 1194 \ --remote 192.168.122.100 --rport 194 \ --secret ../../sample/sample-keys/ta.key 0 \ --ifconfig 10.8.0.10 10.8.0.20 --verb 3 \ --key-method 1Options error: Parameter
key_methodcan only be specified in TLS-mode, i.e. where --tls-server or --tls-client is also specified. Use --help for more information.That is with
/usr/sbin/openvpn--version:
OpenVPN 2.3.11 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on May 10 2016
Quoted 5 lines
So unless I messed up my simple and stupid static key p2p mode tunnel, this doesn't work at all with v2.3. And git master haven't "fixed" this issue.
If nobody noticed this by now, then nobody really uses --key-method.
Well, the options parser is right: --key-method should be used together with --tls-server and --tls-client. Use e.g. the loopback-server and loopback-client configs from sample/sample-configs to test this.
-Steffan
Re: [Openvpn-devel] [PATCH v2] Deprecate key-method 1
In reply to David Sommerseth-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 29 lines · David Sommerseth
Quoted 5 lines · Steffan Karger
Key method 2 has been the default since OpenVPN 2.0, and is both more functional and secure. Also, key method 1 was only ever supported for peer-to-peer connections (i.e. not for client-server).
Quoted 8 lines
Let's get rid of some legacy and phase out key method 1.
v2: add
Changes.rstentry, and update man pageSigned-off-by Steffan Karger <[email protected]...> ---
Changes.rst| 7 +++++++ doc/openvpn.8 | 5 ++++-src/openvpn/options.c| 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-)I wanted to give this an ACK ... but I think we should just remove it all together as we seem to be in a broken state already.
/usr/sbin/openvpn--dev tun --local 192.168.122.1 --lport 1194 \
--remote 192.168.122.100 --rport 194 \ --secret ../../sample/sample-keys/ta.key 0 \ --ifconfig 10.8.0.10 10.8.0.20 --verb 3 \ --key-method 1 Options error: Parameterkey_methodcan only be specified in TLS-mode, i.e. where --tls-server or --tls-client is also specified. Use --help for more information.That is with
/usr/sbin/openvpn--version: OpenVPN 2.3.11 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on May 10 2016
Quoted 6 lines
So unless I messed up my simple and stupid static key p2p mode tunnel, this doesn't work at all with v2.3. And git master haven't "fixed" this issue.
If nobody noticed this by now, then nobody really uses --key-method.
Okay, so I was mistaken. It is possible to use p2p mode with
- --tls-server/--tls-client without setting --mode server. My prior tests used --server and --client, which does not allow --key-method to be set to anything but 2.
Running a test-case using the sample/sample-config-files/loopback-{client,server} test configs triggered the correct code path, and both --key-method 1 and 2 could be tested properly.
So it's an ACK after all. But I will slightly modify the warning + Changes.rst to recommend not setting --key-method, as that will currently default to --key-method 2.
- --
kind regards,
David Sommerseth
OpenVPN Technologies, Inc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAEBAgAGBQJYKjUBAAoJEIbPlEyWcf3yRxAP/0HZCEWTN5pdOCb/gPJ/C9CM 71Br6fzMZqF/cm/rd6EhZwFd8PB+YTq7ppiRbKBHxLZFNT2ZpE94FvkzNGtWePW5 xJB0vcLjejDUcXAY04iuf9Ye1HPMq7y+GN6cGwMD9pO6Y6iqPKCuBKstkypT0XU7 80QuNoXXCzP9+DWcGnLlKWLC+CLlE6LKVycGCCl/mMppLHZwlCFNw7JKfr7GKYCT FgMcPlqh9EGAcZOnxQIGWhxOUatWHcZm2vEdLhziCWA4MDO2ubeoEh6ol0+p1XcN BirZHgvNmw/wq31GG38KGOiE7qMGjUHf9UR6WMwS/g+BzJCV8/0LcNCjXaTWDMKI qlzb9nXXJ7a2CiigW1a3DmCXICBjwKimrzoRWM2GZQfwmrQP1joDnDJvG12ieHab 3yXh406Ky33/wnx/DG+om6OiJsGNV2Ygh8EtqyrKKIgHh7NzHVbESsTRSVfNOApn aM0jwotj2s4rWgJ9Uf4PLp1p+7ujNegJ/9ZcFZLqLH7eAD+VsBGA8qg+KLNk0ldu lnbCdyMO2mxZV+oVLVWAHODbJI/8OIxihNuV8lqzDyY4dS6HeOFnfePGKJJK9JI3 g/KWbLhPmWG4oQ4ocG04I9mbiJYHgfa6B1Xda1JwCiOexreoWW3rbFX5EqzjYx9L fKgS3he37m8WQCHqD4SB
=8vbI
-----END PGP SIGNATURE-----
Re: [Openvpn-devel] [PATCH applied] Deprecate key-method 1
In reply to Steffan Karger-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
ACK, but with a minor adjustment to the warning + Changes.rst file. The text now tries to encourage not setting --key-method at all, as that will default to --key-method 2.
Your patch has been applied to the master branch
commit 1ce0638627eb35631af9bfaa569468573568ec65
Author: Steffan Karger Date: Mon Nov 14 21:06:07 2016 +0100
Deprecate key-method 1
Signed-off-by: Steffan Karger <[email protected]...>
Acked-by: David Sommerseth <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg13054.html
Signed-off-by: David Sommerseth <[email protected]...>- --
kind regards,
David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAEBAgAGBQJYKjYzAAoJEIbPlEyWcf3yiSMP/27hFtYCIUlLIaMyvaHWeLqu Rfizl0PPpXX3Q3Nwi9SJBGwQdMEFf9UJJKMKpBdrVq4ftRHD/qef25pe+a3DxsCY /l5skP3SXHGf+7EsRvRmvmqXoHArJlJuQy3LYJZF6M7SBw39tDiaEI/p2zFCwgTS tVmQr0IMs/ZKYKmnDF6LHdUfzpEDkYfe1yhqsO0+nFUdbV6ePZ80xHyGy/BWbypK QVS6o3uxiCl7CakyxA2Twg7DFg0/64g+lE+OGCEy3rS6IUGB6q/0njAKYqlPp8VP 81ULuFrHXydVHSgy3jb6peakHu1MP2zEKBiaBtPm2nuQ+IgkvoCQIwgmdc39FZDs DPRheUQXvoUv2Dx2U2ns01SANzpXpQzVsFiyJZqzC59RLLigL9V5CRrPDiw9YozQ KKQahLf5BtCVNhYwVrlQhrKdYQnoIlTGc6XXU0LR32HGahEHaZDgNmZsLi6I5VUV XQaKd9SZWozIqwaA1vWisUlJXKyCSkEqK/9fukaa7AyVwrcyRUNttig6Hwh+rbXL czUxZZaou2TQeDOwtuOOuguNNl2TNo3Xg84JxYxhgBV/LO0+QooTt2s4g8M2BB4y lbQoZeU9xxG+wsvr7Tq/mt3FfMVMqApaFR//G1VU0n/SeoS+ktF82XyJz8CEN/kn TPXJUvjlvmnJHQaFZ1CC
=WZJS
-----END PGP SIGNATURE-----