]> git.ipfire.org Git - thirdparty/openvpn.git/log
thirdparty/openvpn.git
7 years agoResolve merge conflict fuzzing
Guido Vranken [Sun, 13 Aug 2017 01:42:02 +0000 (03:42 +0200)] 
Resolve merge conflict

7 years agofuzzer-standalone-loader.c: add comments
Guido Vranken [Sun, 13 Aug 2017 01:11:03 +0000 (03:11 +0200)] 
fuzzer-standalone-loader.c: add comments

7 years agofuzzer-options.c: add comments
Guido Vranken [Sun, 13 Aug 2017 01:00:39 +0000 (03:00 +0200)] 
fuzzer-options.c: add comments

7 years agofuzzer-verify-cert.c: change subbuffer limit from 256 to 2048 bytes, and enforce...
Guido Vranken [Sun, 13 Aug 2017 00:37:13 +0000 (02:37 +0200)] 
fuzzer-verify-cert.c: change subbuffer limit from 256 to 2048 bytes, and enforce limit. for greater code coverage

7 years agofuzzer-forward.c: re-order data extraction for greater code coverage
Guido Vranken [Fri, 11 Aug 2017 03:25:24 +0000 (05:25 +0200)] 
fuzzer-forward.c: re-order data extraction for greater code coverage

7 years agouse NULL instead of 0 when assigning pointers
Antonio Quartulli [Fri, 11 Aug 2017 09:07:44 +0000 (17:07 +0800)] 
use NULL instead of 0 when assigning pointers

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20170811090744.31750-6-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15204.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
7 years agoremove unused functions
Antonio Quartulli [Fri, 11 Aug 2017 09:07:43 +0000 (17:07 +0800)] 
remove unused functions

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Acked-by: Steffan Karger <steffan@karger.me>
Message-Id: <20170811090744.31750-5-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15205.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
7 years agomake function declarations C99 compliant
Antonio Quartulli [Fri, 11 Aug 2017 09:07:40 +0000 (17:07 +0800)] 
make function declarations C99 compliant

In the attempt of adhering to the C99 standard as much as possible,
ensure that all the function declarations with no parameter contain
the "void" keyword[1].

Defects identified with sparse[2].

[1] ISO/IEC 9899:1999 spec, TC3 - section 6.7.5.3
[1] https://sparse.wiki.kernel.org/index.php/Main_Page

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170811090744.31750-2-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15203.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
7 years agoOpenSSL: remove unreachable call to SSL_CTX_get0_privatekey()
Antonio Quartulli [Wed, 9 Aug 2017 07:42:37 +0000 (15:42 +0800)] 
OpenSSL: remove unreachable call to SSL_CTX_get0_privatekey()

In tls_ctx_load_ecdh_params() the SSL_CTX_get0_privatekey() function
is invoked only when "OPENSSL_VERSION_NUMBER >= 0x10002000L" and
curve_name is NULL.

However, under the very same conditions the code flow will
lead to an earlier return, thus never reaching the invocation of
SSL_CTX_get0_privatekey().

Restructure the surrounding code in order to make the if/else
block a bit easier to read and get rid of the unreachable
invocation.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Acked-by: Steffan Karger <steffan@karger.me>
Message-Id: <20170809074237.31291-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15186.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
7 years agotravis-ci: update pkcs11-helper to 1.22
Ilya Shipitsin [Wed, 9 Aug 2017 08:12:19 +0000 (13:12 +0500)] 
travis-ci: update pkcs11-helper to 1.22

use pkcs11-helper from https://github.com/OpenSC/pkcs11-helper/
to match build process used in windows installer build

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
Acked-by: Steffan Karger <steffan@karger.me>
Message-Id: <20170809081219.10367-1-chipitsine@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15187.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
7 years agotravis-ci: update openssl to 1.0.2l, update mbedtls to 2.5.1
Ilya Shipitsin [Mon, 7 Aug 2017 13:23:00 +0000 (18:23 +0500)] 
travis-ci: update openssl to 1.0.2l, update mbedtls to 2.5.1

Acked-by: Steffan Karger <steffan@karger.me>
Message-Id: <20170807132301.22759-2-chipitsine@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15171.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
7 years agocleanup: Move init_random_seed() to where it is being used
David Sommerseth [Tue, 25 Jul 2017 15:07:23 +0000 (17:07 +0200)] 
cleanup: Move init_random_seed() to where it is being used

The init_random_seed() function is only used by the init_static() in
init.c.  As this function was pretty basic and it is only being called
once, it was merged into init_static() instead of keeping it as a separate
function.

(I agree that calling functions often makes the code more readable, but
I would rather see that as a part of cleaning up the whole init_static()
function - in fact when moving all "unit tests" in init_static() to cmocka,
it will not be too bad in the end.)

Signed-off-by: David Sommerseth <davids@openvpn.net>
Acked-by: Steffan Karger <steffan@karger.me>
Message-Id: <20170725150723.14919-1-davids@openvpn.net>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15136.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
7 years agocontrib: Remove keychain-mcd code
David Sommerseth [Tue, 25 Jul 2017 13:03:14 +0000 (15:03 +0200)] 
contrib: Remove keychain-mcd code

After the security audits performed by Cryptography Engineering the
spring of 2017 [1], there were several concerns about the contrib code
for the macOS keychain support.  After more careful review of this
code base, it was considered to be in such a bad shape that it will
need a massive overhaul.  There were more issues than what the security
audit revealed.

It was attempted several times to get in touch with the contributor
of this code; with no response at all [2].  There has however
been some discussions with the Tunnelblick project [3]. There is one
person there willing to go through this and improve the situation.
The main Tunnelblick maintainer is also willing to include the improved
code to their project instead of having this as a contrib code in
the upstream OpenVPN project.

So this patch just removes the code which we will no longer
ship as part of OpenVPN - and the Tunnelblick project will take
over the responsibility for this code base on their own.  And since
this code base is purely macOS specific, this seems to be a far
better place for this code to reside.

Signed-off-by: David Sommerseth <davids@openvpn.net>
[1]
<http://community.openvpn.net/openvpn/wiki/QuarkslabAndCryptographyEngineer
Audits#OVPN-04-1:PossibleNULLpointerderefenceincontribkeychain-mcdcert_data
.c>
[2]
<https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14559.
html>
[3] <https://github.com/Tunnelblick/Tunnelblick/pull/369>
Acked-by: Jonathan K. Bullard <jkbullard@gmail.com>
Message-Id: <20170725130314.12919-1-davids@openvpn.net>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15130.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
7 years agoPrint ec bit details, refuse management-external-key if key is not RSA
Arne Schwabe [Sun, 23 Jul 2017 16:45:36 +0000 (18:45 +0200)] 
Print ec bit details, refuse management-external-key if key is not RSA

V2: Print also curve details, add missing ifdef
V3: Goto err instead of using M_FATAL, format fixes, use
    EC_GROUP_get_curve_name + OBJ_nid2sn instead of ECPKParameters_print, add
    compat headers for 1.0.2
V4: Formatting changes and change M_ERR to M_WARN

Acked-by: Steffan Karger <steffan@karger.me>
Message-Id: <1500828336-30314-1-git-send-email-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15124.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
7 years agontlm: improve code style and readability
Antonio Quartulli [Mon, 10 Jul 2017 04:34:41 +0000 (12:34 +0800)] 
ntlm: improve code style and readability

This patch does not introduce any functional or behavioural change.

The code in ntlm.c has been restyled to better to obey to the
new coding style and its readability has been a improved a bit.

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Steffan Karger <steffan@karger.me>
Message-Id: <20170710043441.24770-5-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15028.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
7 years agontlm: restyle compressed multiple function calls
Antonio Quartulli [Mon, 10 Jul 2017 04:34:40 +0000 (12:34 +0800)] 
ntlm: restyle compressed multiple function calls

The gen_md4_hash() function is receiving as first argument a buffer
that is filled by a function invoked when evaluating the second
argument.

Although this is proper C, it makes the call invocation a bit obscure
because it is not immediately easy to grasp how the 'pwbuf' buffer is
filled.

Unroll the multiple function call onto lines and make the core more
readable.

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Steffan Karger <steffan@karger.me>
Message-Id: <20170710043441.24770-4-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15030.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
7 years agontlm: convert binary buffers to uint8_t *
Antonio Quartulli [Mon, 10 Jul 2017 04:34:38 +0000 (12:34 +0800)] 
ntlm: convert binary buffers to uint8_t *

Several binary buffers in the ntlm component are stored
as char *, however this generates a lot of warnings, because
hashing functions expect something unsigned.

Convert binary buffers to uint8_t *, while use explicit cast
for buffers that are really carrying a string inside.

This commit removes several warnings from ntlm.c that you can
catch with "-Wall -std=c99".

[DS: Done minor typo-fixes in commit message at commit time]

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Steffan Karger <steffan@karger.me>
Message-Id: <20170710043441.24770-2-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15032.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
7 years agofuzzer-forward.c: add comments, refactor code in multiple functions for more readabil...
Guido Vranken [Fri, 11 Aug 2017 00:58:13 +0000 (02:58 +0200)] 
fuzzer-forward.c: add comments, refactor code in multiple functions for more readability, use gc instead of malloc

7 years agoFix bug in fuzzer-forward.c
Guido Vranken [Fri, 11 Aug 2017 00:37:49 +0000 (02:37 +0200)] 
Fix bug in fuzzer-forward.c

Instead of adding the same item over and over,
allocate and fill a new struct client_nat_entry for each call
to client_nat_add_entry().

7 years agofuzzer-route.c: add some comments
Guido Vranken [Thu, 10 Aug 2017 23:45:27 +0000 (01:45 +0200)] 
fuzzer-route.c: add some comments

7 years agofuzzer-verify-cert: add comments, refactor code in multiple functions for more readab...
Guido Vranken [Thu, 10 Aug 2017 23:22:34 +0000 (01:22 +0200)] 
fuzzer-verify-cert: add comments, refactor code in multiple functions for more readability

7 years agofuzzer-mroute.c: add comments
Guido Vranken [Thu, 10 Aug 2017 22:27:40 +0000 (00:27 +0200)] 
fuzzer-mroute.c: add comments

7 years agofuzzer-list.c: remove unused line, add comments
Guido Vranken [Thu, 10 Aug 2017 21:42:12 +0000 (23:42 +0200)] 
fuzzer-list.c: remove unused line, add comments

7 years agofuzzer-buffer.c: add some comments
Guido Vranken [Thu, 10 Aug 2017 21:37:16 +0000 (23:37 +0200)] 
fuzzer-buffer.c: add some comments

7 years agoAdd comments to fuzzing.c, fuzzing.h, remove unused function (fuzzer_read)
Guido Vranken [Thu, 10 Aug 2017 21:29:50 +0000 (23:29 +0200)] 
Add comments to fuzzing.c, fuzzing.h, remove unused function (fuzzer_read)

7 years agoDHCP fuzzer: add comments
Guido Vranken [Wed, 9 Aug 2017 14:23:48 +0000 (16:23 +0200)] 
DHCP fuzzer: add comments

7 years agoBase64 fuzzer: add comments, split code into separate functions, use helper functions...
Guido Vranken [Wed, 9 Aug 2017 13:59:53 +0000 (15:59 +0200)] 
Base64 fuzzer: add comments, split code into separate functions, use helper functions from fuzzing.c

8 years agocleanup: Move write_pid() to where it is being used
David Sommerseth [Tue, 25 Jul 2017 14:57:18 +0000 (16:57 +0200)] 
cleanup: Move write_pid() to where it is being used

The write_pid() function is only used in openvpn.c, so no
need to have that in the misc.[ch] mixed bag.

[on-the-fly change: Added #include "platform.h"]

Signed-off-by: David Sommerseth <davids@openvpn.net>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170725145718.13175-1-davids@openvpn.net>
URL: https://www.mail-archive.com/search?l=mid&q=20170725145718.13175-1-davids@openvpn.net
Signed-off-by: David Sommerseth <davids@openvpn.net>
8 years agotls-crypt: avoid warnings when --disable-crypto is used
Antonio Quartulli [Fri, 7 Jul 2017 10:22:38 +0000 (18:22 +0800)] 
tls-crypt: avoid warnings when --disable-crypto is used

Avoid including the content of tls_crypt.h when --disable-crypto
is used, as it will trigger some warnings due to missing
structures declarations.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Acked-by: Steffan Karger <steffan@karger.me>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <20170707102238.8781-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15014.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
8 years agomanagement: preserve wait_for_push field when asking for user/pass
Antonio Quartulli [Fri, 7 Jul 2017 14:01:08 +0000 (22:01 +0800)] 
management: preserve wait_for_push field when asking for user/pass

With the introduction of the wait_for_push field in the auth_user_pass
structure, we have to make sure that such field is not accidentally
erased when the management asks the user for user/pass.

Erasing such field would mess up the logic introduced by
("Ignore auth-nocache for auth-user-pass if auth-token is pushed").

Thanks to David Sommerseth for the preliminary analysis and debugging.

Reported-by: Steven Haigh <netwiz@crc.id.au>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Tested-by: Steven Haigh <netwiz@crc.id.au>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <20170707140108.31612-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15015.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
8 years agoroute: improve error message
Antonio Quartulli [Thu, 20 Jul 2017 08:23:38 +0000 (16:23 +0800)] 
route: improve error message

- fix typ0 in message: NLSMG -> NLMSG
- use strerror() to print a human readable message
- don't print error message if error is ENETUNREACH: it means no route
  found

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20170720082338.1302-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15101.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agofixup: also change missed openvpn_sleep() occurrences
Steffan Karger [Thu, 20 Jul 2017 19:17:02 +0000 (21:17 +0200)] 
fixup: also change missed openvpn_sleep() occurrences

45b2af9c missed some openvpn_sleep() occurrences in platform-specific code
in tun.c - fix that.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1500578222-21689-1-git-send-email-steffan@karger.me>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15111.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoMove openvpn_sleep() to manage.c
Steffan Karger [Thu, 20 Jul 2017 16:00:35 +0000 (18:00 +0200)] 
Move openvpn_sleep() to manage.c

openvpn_sleep() is basically "service the management interface for x
seconds, then return".  Therefore, manage.c is a more suitable location
than the random collection of unrelated stuff called misc.c.

(I think we should find a better place for everything currently in misc.c,
and get rid of it all together.  This patch is part of that effort.)

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1500566435-29920-1-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15109.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoRemove strerror_ts()
Steffan Karger [Thu, 20 Jul 2017 11:39:00 +0000 (13:39 +0200)] 
Remove strerror_ts()

This function was only called in string format functions, which already
copy the contents, so all this ever did was adding redundant malloc() and
free() calls.

Also, this wasn't as thread-safe as it claims: another thread could still
change the string value between the strerror() and buf_printf() calls. So,
instead of a not needed false sense of thread-safeness, just be honest and
use strerror() directly.

(I think we should find a better place for everything currently in misc.c,
and get rid of it all together.  In this case, the better place is
/dev/null.  This patch is part of that effort.)

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1500550740-24773-1-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15105.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agontlm: unwrap multiple function calls
Antonio Quartulli [Wed, 12 Jul 2017 04:30:02 +0000 (12:30 +0800)] 
ntlm: unwrap multiple function calls

In order to improve code readability it is better to unwrap
multiple function calls onto multiple lines.

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20170712043002.11083-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15041.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agontlm: avoid useless cast
Antonio Quartulli [Mon, 10 Jul 2017 04:34:39 +0000 (12:34 +0800)] 
ntlm: avoid useless cast

The argument passed to my_strupr() is converted to an upper case
string by means of toupper(). The latter expects a single signed int
as argument, therefore it makes sense to have my_strupr() take a
signed argument too and avoid an explicit and an implicit cast.

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170710043441.24770-3-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15031.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agodon't print errno twice
Antonio Quartulli [Thu, 13 Jul 2017 08:05:27 +0000 (16:05 +0800)] 
don't print errno twice

when passing the M_ERRNO flag to msg(), the latter will already
print the errno message (in a form of a string and number) for us,
hence there is no need to explicitly print it a second time.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20170713080527.13299-2-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15057.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agouse M_ERRNO instead of explicitly printing errno
Antonio Quartulli [Thu, 13 Jul 2017 08:05:26 +0000 (16:05 +0800)] 
use M_ERRNO instead of explicitly printing errno

the msg() function will print the errno for us when
provided with the M_ERRNO flag.

Therefore, don't bother printing errno explicitly and always
pass M_ERRNO to msg().

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20170713080527.13299-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15056.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agodoc: The CRL processing is not a deprecated feature
David Sommerseth [Wed, 28 Jun 2017 19:15:38 +0000 (21:15 +0200)] 
doc: The CRL processing is not a deprecated feature

The note related to the CRL processing was somehow put into
the deprecated section.  This is quite confusing.

Since this is a fairly important change, and there have been
a noticable amount of supports questions related to OpenVPN
not starting due to CRL errors, I put this into the
"New features" section labelled as an improvement.  Otherwise
I fear this would drown in the list of "User-visible Changes"
later on.

Signed-off-by: David Sommerseth <davids@openvpn.net>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170628191538.9135-1-davids@openvpn.net>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14985.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoUndo cipher push in client options state if cipher is rejected
Steffan Karger [Tue, 27 Jun 2017 22:20:29 +0000 (00:20 +0200)] 
Undo cipher push in client options state if cipher is rejected

Because of the way we re-use the options parser for both config files and
pushed options, we always update the local options state when we accept an
option.  This resulted in a pushed cipher being rejected the first time it
was pushed, but being accepted the second time.

This patch is a minimal way to resolve this issue in the master and
release/2.4 branches.  I'll send a more invasive patch for master, to
reset the entire options state on reconnects, later.

Trac: #906

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20170627222029.26623-1-steffan@karger.me>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14984.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoOpenSSL: remove EVP_CIPHER_CTX_free() from the compat layer
Emmanuel Deloget [Thu, 29 Jun 2017 14:21:19 +0000 (16:21 +0200)] 
OpenSSL: remove EVP_CIPHER_CTX_free() from the compat layer

For unknown reason, the writer of the compat layer seemed to think that
this function was only present in OpenSSL 1.1. This is not the case at
all, since it has been introduced in OpenSSL before version 0.9.8.

Thus, there is no need to add this function to the compat layer, and it
can be safely removed.

Signed-off-by: Emmanuel Deloget <logout@free.fr>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170629142119.29502-2-logout@free.fr>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14988.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoOpenSSL: remove EVP_CIPHER_CTX_new() from the compat layer
Emmanuel Deloget [Thu, 29 Jun 2017 14:21:18 +0000 (16:21 +0200)] 
OpenSSL: remove EVP_CIPHER_CTX_new() from the compat layer

For unknown reason, the writer of the compat layer seemed to think that
this function was only present in OpenSSL 1.1. This is not the case at
all, since it has been introduced in OpenSSL before version 0.9.8.

Thus, there is no need to add this function to the compat layer, and it
can be safely removed.

Signed-off-by: Emmanuel Deloget <logout@free.fr>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170629142119.29502-1-logout@free.fr>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14989.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoMove adjust_power_of_2() to integer.h
Steffan Karger [Wed, 21 Jun 2017 21:10:43 +0000 (23:10 +0200)] 
Move adjust_power_of_2() to integer.h

misc.c is a mess of incoherent functions, and is therefore included by
virtually all our source files.  That makes testing harder than it should
be.  As a first step of cleaning up misc.c, move adjust_power_of_2() to
integer.h, which is a more suitable place for a function like this.

This allows us to remove the duplicate implementation from test_argv.c.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20170621211043.6490-1-steffan@karger.me>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14940.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoinit_key_ctx: key and iv arguments can (now) be const
Steffan Karger [Mon, 19 Jun 2017 11:51:05 +0000 (13:51 +0200)] 
init_key_ctx: key and iv arguments can (now) be const

In older OpenSSL, the key and iv arguments of EVP_CipherInit_ex() were not
const, which meant that our API could not be const either.  Since we
dropped support for OpenSSL 0.9.8, we can now fix our internal API.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <1497873065-2229-1-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14881.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoSet tls-cipher restriction before loading certificates
Arne Schwabe [Mon, 26 Jun 2017 11:13:26 +0000 (13:13 +0200)] 
Set tls-cipher restriction before loading certificates

OpenSSL 1.1 does not allow MD5 signed certificates by default anymore.
This can be enabled again by settings tls-cipher "DEFAULT:@SECLEVEL=0" but
only if the cipher list is set before loading the certificates. This patch
changes the order of loading.

Acked-by: Christian Hesse <list@eworm.de>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <1498475606-8337-1-git-send-email-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14961.html

Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agocrypto: correct typ0 in error message
Antonio Quartulli [Tue, 27 Jun 2017 12:00:47 +0000 (20:00 +0800)] 
crypto: correct typ0 in error message

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170627120047.12304-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14975.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoReplace all open()/close() with platform_open()/platform_open2()/platform_close()
Guido Vranken [Tue, 27 Jun 2017 10:06:12 +0000 (12:06 +0200)] 
Replace all open()/close() with platform_open()/platform_open2()/platform_close()

8 years agoInitialize crypto in fuzzer-verify-cert
Guido Vranken [Tue, 27 Jun 2017 09:30:11 +0000 (11:30 +0200)] 
Initialize crypto in fuzzer-verify-cert

8 years agoAdd crypto.c fuzzer
Guido Vranken [Tue, 27 Jun 2017 09:27:05 +0000 (11:27 +0200)] 
Add crypto.c fuzzer

8 years agoImplement platform_read, platform_write and replace all read()/write() calls
Guido Vranken [Tue, 27 Jun 2017 08:54:01 +0000 (10:54 +0200)] 
Implement platform_read, platform_write and replace all read()/write() calls

8 years agoPut README in the right directory..
Guido Vranken [Tue, 27 Jun 2017 08:42:20 +0000 (10:42 +0200)] 
Put README in the right directory..

8 years agoPut back README
Guido Vranken [Tue, 27 Jun 2017 08:39:10 +0000 (10:39 +0200)] 
Put back README

8 years agoRename README
Guido Vranken [Mon, 26 Jun 2017 21:07:43 +0000 (23:07 +0200)] 
Rename README

8 years agoUpdate README
Guido Vranken [Mon, 26 Jun 2017 21:06:15 +0000 (23:06 +0200)] 
Update README

Describe procedure to built fuzzers

8 years agoRemaining IO abstractions
Guido Vranken [Mon, 26 Jun 2017 20:09:49 +0000 (22:09 +0200)] 
Remaining IO abstractions

8 years agoIO abstractions in socks.c
Guido Vranken [Mon, 26 Jun 2017 19:57:52 +0000 (21:57 +0200)] 
IO abstractions in socks.c

8 years agoRemove erroneous endif from fuzzer-base64, fuzzer-misc, fuzzer-options
Guido Vranken [Mon, 26 Jun 2017 19:57:31 +0000 (21:57 +0200)] 
Remove erroneous endif from fuzzer-base64, fuzzer-misc, fuzzer-options

8 years agoAdd compression fuzzer
Guido Vranken [Mon, 26 Jun 2017 19:01:41 +0000 (21:01 +0200)] 
Add compression fuzzer

8 years agoPrepare compression functions for fuzzing
Guido Vranken [Mon, 26 Jun 2017 19:01:15 +0000 (21:01 +0200)] 
Prepare compression functions for fuzzing

8 years agoRemove crypto requirement from fuzzer-base64, fuzzer-misc, fuzzer-options
Guido Vranken [Mon, 26 Jun 2017 19:00:11 +0000 (21:00 +0200)] 
Remove crypto requirement from fuzzer-base64, fuzzer-misc, fuzzer-options

8 years agoAdd mroute.c fuzzer
Guido Vranken [Mon, 26 Jun 2017 18:29:54 +0000 (20:29 +0200)] 
Add mroute.c fuzzer

8 years agoPrepare mroute.c, mroute.h for fuzzing
Guido Vranken [Mon, 26 Jun 2017 18:29:34 +0000 (20:29 +0200)] 
Prepare mroute.c, mroute.h for fuzzing

8 years agoDisable check in mss.c to speed up fuzzing
Guido Vranken [Fri, 23 Jun 2017 15:34:59 +0000 (17:34 +0200)] 
Disable check in mss.c to speed up fuzzing

8 years agoAdd misc.c fuzzer
Guido Vranken [Fri, 23 Jun 2017 14:43:06 +0000 (16:43 +0200)] 
Add misc.c fuzzer

8 years agoIO abstractions + dealing with execve/popen in misc.c
Guido Vranken [Fri, 23 Jun 2017 14:42:47 +0000 (16:42 +0200)] 
IO abstractions + dealing with execve/popen in misc.c

8 years agoAdd list.c fuzzer
Guido Vranken [Fri, 23 Jun 2017 14:36:00 +0000 (16:36 +0200)] 
Add list.c fuzzer

8 years agoIO abstractions in list.c
Guido Vranken [Fri, 23 Jun 2017 14:33:10 +0000 (16:33 +0200)] 
IO abstractions in list.c

8 years agoAdd buffer.c fuzzer
Guido Vranken [Fri, 23 Jun 2017 14:31:36 +0000 (16:31 +0200)] 
Add buffer.c fuzzer

8 years agoAdd ssl_verify* fuzzer
Guido Vranken [Fri, 23 Jun 2017 14:27:45 +0000 (16:27 +0200)] 
Add ssl_verify* fuzzer

8 years agoAdd options.c fuzzer
Guido Vranken [Fri, 23 Jun 2017 14:16:47 +0000 (16:16 +0200)] 
Add options.c fuzzer

8 years agoDisable certain options in options.c
Guido Vranken [Fri, 23 Jun 2017 14:14:58 +0000 (16:14 +0200)] 
Disable certain options in options.c

8 years agoIO abstractions in options.c
Guido Vranken [Fri, 23 Jun 2017 14:08:50 +0000 (16:08 +0200)] 
IO abstractions in options.c

8 years agoAdd proxy.c fuzzer
Guido Vranken [Fri, 23 Jun 2017 14:06:58 +0000 (16:06 +0200)] 
Add proxy.c fuzzer

8 years agoIO abstractions in proxy.c
Guido Vranken [Fri, 23 Jun 2017 14:02:47 +0000 (16:02 +0200)] 
IO abstractions in proxy.c

8 years agoAdd forward.c fuzzer
Guido Vranken [Fri, 23 Jun 2017 14:00:07 +0000 (16:00 +0200)] 
Add forward.c fuzzer

8 years agoIO abstractions in buffer.c, buffer.h
Guido Vranken [Fri, 23 Jun 2017 13:50:55 +0000 (15:50 +0200)] 
IO abstractions in buffer.c, buffer.h

8 years agoAdd dhcp.c fuzzer
Guido Vranken [Fri, 23 Jun 2017 13:45:55 +0000 (15:45 +0200)] 
Add dhcp.c fuzzer

8 years agoAdd route.c fuzzer
Guido Vranken [Fri, 23 Jun 2017 13:43:13 +0000 (15:43 +0200)] 
Add route.c fuzzer

8 years agoIO abstractions in route.c
Guido Vranken [Fri, 23 Jun 2017 13:42:49 +0000 (15:42 +0200)] 
IO abstractions in route.c

8 years agoIO abstractions in socket.c, socket.h
Guido Vranken [Fri, 23 Jun 2017 13:42:30 +0000 (15:42 +0200)] 
IO abstractions in socket.c, socket.h

8 years agoIO abstractions in error.c
Guido Vranken [Fri, 23 Jun 2017 13:42:04 +0000 (15:42 +0200)] 
IO abstractions in error.c

8 years agoIgnore all messages except M_FATAL
Guido Vranken [Fri, 23 Jun 2017 13:41:38 +0000 (15:41 +0200)] 
Ignore all messages except M_FATAL

8 years agoImplement IO abstraction functions
Guido Vranken [Fri, 23 Jun 2017 13:14:44 +0000 (15:14 +0200)] 
Implement IO abstraction functions

8 years agoCreate fuzzing basis + base64 fuzzer
Guido Vranken [Fri, 23 Jun 2017 12:51:55 +0000 (14:51 +0200)] 
Create fuzzing basis + base64 fuzzer

Signed-off-by: Guido Vranken <guidovranken@gmail.com>
8 years agoFix typo in extract_x509_extension() debug message
Steffan Karger [Wed, 21 Jun 2017 21:21:31 +0000 (23:21 +0200)] 
Fix typo in extract_x509_extension() debug message

This message should use the external name, not the internal one.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20170621212131.6776-1-steffan@karger.me>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14939.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoOpenSSL: remove pre-1.1 function from the OpenSSL compat interface
Emmanuel Deloget [Mon, 19 Jun 2017 15:35:13 +0000 (17:35 +0200)] 
OpenSSL: remove pre-1.1 function from the OpenSSL compat interface

HMAC_CTX_init() has been removed from OpenSSL 1.1. Both this function
and function HMAC_CTX_cleanup() has been replaced by HMAC_CTX_reset().

Commit aba98e9050eb54d72d921e70bcd422cb892b9c6c introduced support for
HMAC_CTX_init() for OpenSSL 1.1+ while other functions were mimicking
the OpenSSL 1.1 interface for earlier version. This is clearly not a
good idea -- a better approach would be to provide the new interface for
pre-1.1 versions in order to have the dependant code use only one
interface version. To implement that, we remove HMAC_CTX_init() from our
compatibility layer and implement HMAC_CTX_reset() in terms of a cleanup
followed by an init (as the regular HMAC_CTX_reset() function does in
OpenSSL 1.1. This change has a consequence on HMAC_CTX_free() which now
need to cleanup() the HMAC context before freeing it.

Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170619153513.5420-1-logout@free.fr>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14889.html

Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agotravis-ci: added gcc and clang openssl-1.1.0 builds
Ilya Shipitsin [Mon, 19 Jun 2017 18:38:08 +0000 (23:38 +0500)] 
travis-ci: added gcc and clang openssl-1.1.0 builds

openssl build script was modified according to official openssl manual:
https://wiki.openssl.org/index.php/Compilation_and_Installation
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <1497897488-15999-1-git-send-email-chipitsine@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14890.html

Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoUpdate Changes.rst with relevant info for 2.4.3 release.
Gert Doering [Mon, 19 Jun 2017 17:44:00 +0000 (19:44 +0200)] 
Update Changes.rst with relevant info for 2.4.3 release.

(Since Changes.rst is mostly synchronized between master and 2.4.3,
and patches flow master->release/2.4, the change is done here even
if this particular commit is not directly part of 2.4.3 release)

General cleanup, whitespace fixes, quoting fixes by David Sommerseth
<davids@openvpn.net>

Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoFix remotely-triggerable ASSERT() on malformed IPv6 packet.
Gert Doering [Tue, 13 Jun 2017 20:08:32 +0000 (22:08 +0200)] 
Fix remotely-triggerable ASSERT() on malformed IPv6 packet.

Correct sanity checks on IPv6 packet length in mss_fixup_ipv6(),
and change the ASSERT() check in mss_fixup_dowork() into a simple
"return" (= the TCP header will simply not be inspected further).

CVE-2017-7508 has been assigned due to the serious nature of the
bug: it can be used to remotely shutdown an openvpn server or
client, if IPv6 and --mssfix are enabled and the IPv6 networks used
inside the VPN are known.

Found by Guido Vranken <guidovranken@gmail.com>.

v2: style changes

CVE: 2017-7508
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170613200832.15027-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/search?l=mid&q=20170613200832.15027-1-gert@greenie.muc.de
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoPrevent two kinds of stack buffer OOB reads and a crash for invalid input data
Guido Vranken [Fri, 19 May 2017 12:04:25 +0000 (14:04 +0200)] 
Prevent two kinds of stack buffer OOB reads and a crash for invalid input data

Pre-authentication remote crash/information disclosure for clients

If clients use a HTTP proxy with NTLM authentication (i.e.
"--http-proxy <server> <port> [<authfile>|'auto'|'auto-nct'] ntlm2"),
a man-in-the-middle attacker between the client and the proxy can
cause the client to crash or disclose at most 96 bytes of stack
memory. The disclosed stack memory is likely to contain the proxy
password.

If the proxy password is not reused, this is unlikely to compromise
the security of the OpenVPN tunnel itself.  Clients who do not use
the --http-proxy option with ntlm2 authentication are not affected.

CVE: 2017-7520
Signed-off-by: Guido Vranken <guidovranken@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <CAO5O-EJvHKid-zTj+hmFG_3Gv78ixqCayE9=C62DZaxN32WNtQ@mail.gmail.com>
URL: https://www.mail-archive.com/search?l=mid&q=CAO5O-EJvHKid-zTj+hmFG_3Gv78ixqCayE9=C62DZaxN32WNtQ@mail.gmail.com
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoFix potential double-free in --x509-alt-username (CVE-2017-7521)
Steffan Karger [Mon, 19 Jun 2017 09:28:40 +0000 (11:28 +0200)] 
Fix potential double-free in --x509-alt-username (CVE-2017-7521)

We didn't check the return value of ASN1_STRING_to_UTF8() in
extract_x509_extension().  Ignoring such a failure could result in buf
being free'd twice.  An error in ASN1_STRING_to_UTF8() can be caused
remotely if the peer can make the local process run out of memory.

The problem can only be triggered for configurations that use the
--x509-alt-username option with an x509 extension (i.e. the option
parameter starts with "ext:").

This issue was discovered, analysed and reported to the OpenVPN team by
Guido Vranken.

Extensive testing by Guido Vranken gives confidence that this function
is very unlikely to fail in real-world usage (using subjectAltName or
issuerAltName extensions) for other reasons than memory exhaustion.

CVE: 2017-7521
Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@openvpn.net>
Acked-by: Guido Vranken <guidovranken@gmail.com>
Message-Id: <1497864520-12219-6-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/search?l=mid&q=1497864520-12219-6-git-send-email-steffan.karger@fox-it.com
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoRestrict --x509-alt-username extension types
Steffan Karger [Mon, 19 Jun 2017 09:28:39 +0000 (11:28 +0200)] 
Restrict --x509-alt-username extension types

The code never supported all extension types.  Make this explicit by only
allowing subjectAltName and issuerAltName (for which the current code does
work).

Using unsupported extension fields would most likely cause OpenVPN to crash
as soon as a client connects.  This does not have a real-world security
impact, as such a configuration would not be possible to use in practice.

This bug was discovered, analysed and reported to the OpenVPN team by
Guido Vranken.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@openvpn.net>
Acked-by: Guido Vranken <guidovranken@gmail.com>
Message-Id: <1497864520-12219-5-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/search?l=mid&q=1497864520-12219-5-git-send-email-steffan.karger@fox-it.com
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoFix remote-triggerable memory leaks (CVE-2017-7521)
Steffan Karger [Mon, 19 Jun 2017 09:28:38 +0000 (11:28 +0200)] 
Fix remote-triggerable memory leaks (CVE-2017-7521)

Several of our OpenSSL-specific certificate-parsing code paths did not
always clear all allocated memory.  Since a client can cause a few bytes
of memory to be leaked for each connection attempt, a client can cause a
server to run out of memory and thereby kill the server.  That makes this
a (quite inefficient) DoS attack.

When using the --x509-alt-username option on openssl builds with an
extension (argument prefixed with "ext:", e.g. "ext:subjectAltName"), the
code would not free all allocated memory.  Fix this by using the proper
free function.

If ASN1_STRING_to_UTF8() returns 0, it didn't fail and *did* allocate
memory.  So also free the returned buffer if it returns 0.

These issues were found, analysed and reported to the OpenVPN team by Guido
Vranken.

CVE: 2017-7521
Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@openvpn.net>
Acked-by: Guido Vranken <guidovranken@gmail.com>
Message-Id: <1497864520-12219-4-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/search?l=mid&q=1497864520-12219-4-git-send-email-steffan.karger@fox-it.com
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agombedtls: require C-string compatible types for --x509-username-field
Steffan Karger [Mon, 19 Jun 2017 09:28:37 +0000 (11:28 +0200)] 
mbedtls: require C-string compatible types for --x509-username-field

In the --x509-username-field extenstion, we handle the subject string as
if it is a C string.  Make this assumption explicit and reject incomatible
ASN.1 string types.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1497864520-12219-3-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/search?l=mid&q=1497864520-12219-3-git-send-email-steffan.karger@fox-it.com
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agombedtls: fix --x509-track post-authentication remote DoS (CVE-2017-7522)
Steffan Karger [Mon, 19 Jun 2017 09:28:36 +0000 (11:28 +0200)] 
mbedtls: fix --x509-track post-authentication remote DoS (CVE-2017-7522)

asn1_buf_to_c_string() returned a literal string if the input ASN.1 string
contained a NUL character, while the caller expects a mutable string.
The caller will attempt to change this string, which allows a client to
crash a server by sending a certificate with an embedded NUL character.

(The other way around is not interesting, as servers are allowed to stop
a client by design.)

Impact analysis:
 * applies to mbedtls builds only
 * introduced in 2.4 (so 2.3 is not affected)
 * can only be exploited if the --x509-track option is used
 * requires the CA to sign a certificate with an embedded NUL in the
   certificate subject

This bug was discovered and reported to the OpenVPN security team by
Guido Vranken.

CVE: 2017-7522
Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1497864520-12219-2-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/search?l=mid&q=1497864520-12219-2-git-send-email-steffan.karger@fox-it.com
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoauth-token with auth-nocache fix broke --disable-crypto builds
David Sommerseth [Mon, 19 Jun 2017 13:05:07 +0000 (15:05 +0200)] 
auth-token with auth-nocache fix broke --disable-crypto builds

After adding commit 571165360db0392fa83e, it broke builds where
the --disable-crypto was used with ./configure.  This was due to
the delayed_auth_pass_purge() which requires the crypto code paths
being called from init.c without the proper #ifdef encapsulation.

Signed-off-by: David Sommerseth <davids@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20170619130507.13892-1-davids@openvpn.net>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14883.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
8 years agoIgnore auth-nocache for auth-user-pass if auth-token is pushed
Antonio Quartulli [Sat, 25 Feb 2017 00:40:14 +0000 (08:40 +0800)] 
Ignore auth-nocache for auth-user-pass if auth-token is pushed

When the auth-token option is pushed from the server to the client,
the latter has to ignore the auth-nocache directive (if specified).

The password will now be substituted by the unique token, therefore
it can't be wiped out, otherwise the next renegotiation will fail.

Trac: #840
Cc: David Sommerseth <openvpn@sf.lists.topphemmelig.net>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20170225004014.28638-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14194.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
8 years agoFix potential 1-byte overread in TCP option parsing.
Gert Doering [Sun, 18 Jun 2017 19:41:04 +0000 (21:41 +0200)] 
Fix potential 1-byte overread in TCP option parsing.

A malformed TCP header could lead to a one-byte overread when
searching for the MSS option (but as far as we know, with no
adverse consequences).

Change outer loop to always ensure there's one extra byte available
in the buffer examined.

Technically, this would cause OpenVPN to ignore the only single-byte
TCP option available, 'NOP', if it ends up being the very last
option in the buffer - so what, it's a NOP anyway, and all we
are interested is MSS, which needs 4 bytes.
(https://www.iana.org/assignments/tcp-parameters/tcp-parameters.xhtml)

Found and reported by Guido Vranken <guidovranken@gmail.com>.

Trac: #745

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20170618194104.25179-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14874.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoOpenSSL: don't use direct access to the internal of HMAC_CTX
Emmanuel Deloget [Mon, 12 Jun 2017 13:43:29 +0000 (15:43 +0200)] 
OpenSSL: don't use direct access to the internal of HMAC_CTX

OpenSSL 1.1 does not allow us to directly access the internal of
any data type, including HMAC_CTX. We have to use the defined
functions to do so.

Compatibility with OpenSSL 1.0 is kept by defining the corresponding
functions when they are not found in the library.

Signed-off-by: Emmanuel Deloget <logout@free.fr>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170612134330.20971-8-logout@free.fr>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14797.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
8 years agoOpenSSL: don't use direct access to the internal of EVP_CIPHER_CTX
Emmanuel Deloget [Mon, 12 Jun 2017 13:43:28 +0000 (15:43 +0200)] 
OpenSSL: don't use direct access to the internal of EVP_CIPHER_CTX

OpenSSL 1.1 does not allow us to directly access the internal of
any data type, including EVP_CIPHER_CTX. We have to use the defined
functions to do so.

Compatibility with OpenSSL 1.0 is kept by defining the corresponding
functions when they are not found in the library.

Signed-off-by: Emmanuel Deloget <logout@free.fr>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170612134330.20971-7-logout@free.fr>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14796.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>