]> git.ipfire.org Git - thirdparty/openvpn.git/log
thirdparty/openvpn.git
10 years agoFix regression with password protected private keys (polarssl)
Steffan Karger [Fri, 19 Sep 2014 04:19:13 +0000 (06:19 +0200)] 
Fix regression with password protected private keys (polarssl)

Between versions 1.2 and 1.3, polarssl changed the errors
returned by the X509 parsing functions, which broke the OpenVPN
implementation for password protected private keys in polarssl
builds. This patch fixes that by checking for the new errors in
OpenVPN.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <5432E951.6020405@fox-it.com>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
10 years agoFix "code=995" bug with windows NDIS6 tap driver.
TDivine [Wed, 22 Oct 2014 07:07:39 +0000 (10:07 +0300)] 
Fix "code=995" bug with windows NDIS6 tap driver.

Modification to address bug where OpenVPN enters state where it is
unresponsive and cannot be terminated. Log output is continuous spew
of "code=995" errors.

Revised fix for code=995 sped bug.

Adding new tap adapters while connected:
  https://community.openvpn.net/openvpn/ticket/430

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1413961660-19251-2-git-send-email-samuli@openvpn.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9165
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1413961660-19251-3-git-send-email-samuli@openvpn.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9167
Signed-off-by: Gert Doering <gert@greenie.muc.de>
10 years agoEnsure that client-connect files are always deleted
Samuel Thibault [Thu, 9 Oct 2014 21:40:49 +0000 (23:40 +0200)] 
Ensure that client-connect files are always deleted

On a long-running, busy server using either a plug-in which hooks into
OPENVPN_PLUGIN_CLIENT_CONNECT or a configuration using --client-connect
a lot of unused files will be lingering and potentially filling up
the file system with temporary files if the plug-in or --client-connect
script fails.

This patch ensures that these files are always removed in the end,
regardless if the plug-in or script succeeds or fails.

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 20141012195919.GU3738@type
URL: http://thread.gmane.org/gmane.network.openvpn.devel/9104/focus=9118

10 years agoextract_x509_extension(): hide status message during normal operation.
Andris Kalnozols [Sat, 9 Aug 2014 22:40:44 +0000 (00:40 +0200)] 
extract_x509_extension(): hide status message during normal operation.

For each recognized extension in a certificate, extract_x509_extension()
would issue an "ASN1 ERROR: can not handle field type" debug message at
verb 2. Reduce that to verb 9 (D_TLS_ERRORS -> D_TLS_DEBUG) and alter the
message text accordingly.

Signed-off-by: Andris Kalnozols <andris@hpl.hp.com>
Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <53E6A61C.7010106@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8981
Signed-off-by: Gert Doering <gert@greenie.muc.de>
10 years agoImplement on-link route adding for iproute2
Philipp Hagemeister [Fri, 26 Sep 2014 16:11:01 +0000 (18:11 +0200)] 
Implement on-link route adding for iproute2

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
Currently, when compiling with --enable-iproute2 , OpenVPN does not
create a correct route when the user is connected to the Internet
without a gateway (e.g. via ppp). This patch implements the
corresponding FIXME.

Signed-off-by: Philipp Hagemeister <phihag@phihag.de>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <54259015.2030005@phihag.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9056
Signed-off-by: Gert Doering <gert@greenie.muc.de>
10 years agoAdd documentation for PERSIST_TUN_ACTION (Android specific)
Arne Schwabe [Tue, 7 Oct 2014 20:10:50 +0000 (22:10 +0200)] 
Add documentation for PERSIST_TUN_ACTION (Android specific)

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1412712650-5173-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9090

Signed-off-by: Gert Doering <gert@greenie.muc.de>
10 years agosystemd: Use systemd functions to consider systemd availability
David Sommerseth [Fri, 3 Oct 2014 17:16:07 +0000 (19:16 +0200)] 
systemd: Use systemd functions to consider systemd availability

This is another systemd implementation clean-up.  It was found that
SELinux will block OpenVPN from checking /sys/fs/cgroups.  As OpenVPN
only checked /sys/fs/cgroups and /sys/fs/cgroups/systemd to see if
systemd was available or not, it was considered better to query
systemd directly to see whether or not to query for usernames and
passwords via systemd.

This patch has been compile tested on Fedora 19 and Fedora 21 alpha and
function tested on Fedora 19.

  v2 - Use PKG_CHECK_MODULES() + check for libsystemd before
       libystemd-daemon.  systemd >= 209 use a unified library

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1412356567-27125-1-git-send-email-openvpn.list@topphemmelig.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9072
Signed-off-by: Gert Doering <gert@greenie.muc.de>
10 years agoocsp_check - double check if ocsp didn't report any errors in execution
Hubert Kario [Fri, 26 Sep 2014 10:24:01 +0000 (12:24 +0200)] 
ocsp_check - double check if ocsp didn't report any errors in execution

in case the reposnses are too old, ocsp tool can return text like this:

Response verify OK
ca/cert.pem: WARNING: Status times invalid.
139990703290240:error:2707307D:OCSP routines:OCSP_check_validity:status
expired:ocsp_cl.c:358:
good
        This Update: Sep 21 12:12:48 2014 GMT
        Next Update: Sep 22 12:12:48 2014 GMT

light change in buffering can cause "verify OK" and "ca/cert.pem: good"
to be placed in a way that matching will be valid
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <1411727041-11884-2-git-send-email-hkario@redhat.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9055

Signed-off-by: Gert Doering <gert@greenie.muc.de>
10 years agoocsp_check - signature verification and cert staus results are separate
Hubert Kario [Fri, 26 Sep 2014 10:24:00 +0000 (12:24 +0200)] 
ocsp_check - signature verification and cert staus results are separate

when openssl returns result of parsing and verification of the
OCSP response, the signature verification is separate from the certificate
status, as such it's necessary to check both of them.

Otherwise results like:

Response Verify Failure
140170966779776:error:27069076:OCSP routines:OCSP_basic_verify:signer
certificate not found:ocsp_vfy.c:85:
ca/cert.pem: good
        This Update: Sep 23 12:12:28 2014 GMT

will be accepted as being trustworthy.

Note that "Response verify OK" is printed on stderr, so it can't
be discarded.

Signed-off-by: Hubert Kario <hkario@redhat.com>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <1411727041-11884-1-git-send-email-hkario@redhat.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9054
Signed-off-by: Gert Doering <gert@greenie.muc.de>
10 years agoAdd systemd unit file for OpenVPN
David Sommerseth [Thu, 18 Sep 2014 08:57:53 +0000 (10:57 +0200)] 
Add systemd unit file for OpenVPN

This is to encourage all Linux distributions to use a unified systemd
unit file.

This unit file also tries to reduce the capabilities of the running
openvpn process.

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1411030936-16309-1-git-send-email-openvpn.list@topphemmelig.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/9043

10 years agoFix compiler warnings in ssl_polarssl.c.
Steffan Karger [Mon, 18 Aug 2014 21:09:15 +0000 (23:09 +0200)] 
Fix compiler warnings in ssl_polarssl.c.

No functional changes, just add missing includes and make casts explicit.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1408396155-9017-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8991
Signed-off-by: Gert Doering <gert@greenie.muc.de>
10 years agoFix clang warning in options.c
Steffan Karger [Wed, 20 Aug 2014 21:00:26 +0000 (23:00 +0200)] 
Fix clang warning in options.c

fixed warning: expression which evaluates to zero treated as a
null pointer constant of type 'struct addrinfo *'

Seems to be innocent, but clang is correct that this is strange.
init_tun() expects two pointers, but options_string() tried to
feed it two uint32_t values.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Message-Id: <1408568426-19601-2-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9004
Signed-off-by: Gert Doering <gert@greenie.muc.de>
10 years agoFix some unintialized variable warnings
Steffan Karger [Wed, 20 Aug 2014 21:00:25 +0000 (23:00 +0200)] 
Fix some unintialized variable warnings

Does not actually change behaviour, but fixes compiler warnings
and properly initializing is good habit anyway.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Message-Id: <1408568426-19601-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9003
Signed-off-by: Gert Doering <gert@greenie.muc.de>
10 years agoRemove quadratic complexity from openvpn_base64_decode()
Jann Horn [Wed, 16 Jul 2014 19:55:42 +0000 (21:55 +0200)] 
Remove quadratic complexity from openvpn_base64_decode()

Every four input characters, openvpn_base64_decode called token_decode,
which in turn called strlen() on the remaining input. This means that
base64 decoding in openvpn had quadratic complexity.

All we really need to know is whether the token is complete, so replace
the check to check just that, and make the complexity linear wrt the
input length.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <5408494D.7050407@fox-it.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9016
Signed-off-by: Gert Doering <gert@greenie.muc.de>
10 years agoClean up the pipe closing in openvpn_popen()
David Sommerseth [Fri, 5 Sep 2014 15:04:58 +0000 (17:04 +0200)] 
Clean up the pipe closing in openvpn_popen()

Do the proper closing of the pipe ends which is not being used,
also in error situations.  Moved the closing of the parent side
before the waitpid(), to be consistent with the child side (as
early as possible).

Also improved the error messages with more details.

[v2 - Don't call close() if execve() fails]

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 20140909202408.GK1118@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/9036

10 years agoDon't try to use systemd-ask-password if it is not available
David Sommerseth [Tue, 9 Sep 2014 16:58:53 +0000 (18:58 +0200)] 
Don't try to use systemd-ask-password if it is not available

If the SYSTEMD_ASK_PASSWORD_PATH executable cannot be found, we
don't consider systemd as running.

[v2 - Don't clean up white-space]

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 20140909202044.GJ1118@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/9035

10 years agoDon't let openvpn_popen() keep zombies around
David Sommerseth [Fri, 5 Sep 2014 12:26:32 +0000 (14:26 +0200)] 
Don't let openvpn_popen() keep zombies around

Commit 9449e6a9eba30c9ed054f57d630a88c9f087080f introduced the
openvpn_popen() function to support retrieving passwords via systemd.

It was discovered that the child processes openvpn fork()ed would
be lingering around until openvpn stopped.  This was due to the lack
of a wait() call.

This patch also cleans up a few minor white-space issues in the same
code segment.

 [v2 proper initialisation of status variable]

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1409930731-15263-2-git-send-email-davids@redhat.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/9021

10 years agoAdd configure check for the path to systemd-ask-password
Mike Gilbert [Thu, 3 Jul 2014 20:24:05 +0000 (16:24 -0400)] 
Add configure check for the path to systemd-ask-password

Gentoo Linux installs this in /usr/bin by default. Also, the user may
have installed it in /usr/local/bin if building from source.

Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1404419045-14728-1-git-send-email-floppym@gentoo.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/8825

Signed-off-by: David Sommerseth <davids@redhat.com>
11 years agoFix typo in cipher_kt_mode_{cbc, ofb_cfb}() doxygen.
Steffan Karger [Tue, 29 Jul 2014 21:04:26 +0000 (23:04 +0200)] 
Fix typo in cipher_kt_mode_{cbc, ofb_cfb}() doxygen.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1406667866-14226-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8953
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoRemove deprecated --max-routes option from manual
Arne Schwabe [Thu, 24 Jul 2014 21:37:46 +0000 (23:37 +0200)] 
Remove deprecated --max-routes option from manual

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1406237866-9086-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8938

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoAlways enable http-proxy and socks-proxy
Arne Schwabe [Mon, 7 Jul 2014 12:12:20 +0000 (14:12 +0200)] 
Always enable http-proxy and socks-proxy

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1404735142-31420-2-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8840

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoAdd topology in sample server configuration file
Philipp Hagemeister [Fri, 11 Jul 2014 08:00:24 +0000 (10:00 +0200)] 
Add topology in sample server configuration file

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
On modern systems, topology subnet should always be set, but it's
missing in the configuration file.
Add it with a short explanation.

Signed-off-by: Philipp Hagemeister <phihag@phihag.de>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <53BF9998.5020906@phihag.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8878
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoFix server routes not working in topology subnet with --server [v3]
Arne Schwabe [Sun, 13 Jul 2014 12:28:47 +0000 (14:28 +0200)] 
Fix server routes not working in topology subnet with --server [v3]

The IPv4 routing code needs an IPv4 address to point a route to, and
in --topology subnet mode, the *server* did not have one set by default.

So we now just default --route-gateway to the next address right after
the server address - the specific address doesn't matter, as the correct
next-hop will not be resolved by the host OS but by the OpenVPN daemon.
All that is needed is "it's in the subnet routed to the tun interface".

Using the server address itself would work on unix, but doesn't work with
the Windows TAP driver (as it does not spoof ARP responses for itself).

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1405254527-23833-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8904

11 years agoDefine dummy SSL_OP_NO_TICKET flag if not present in OpenSSL.
Steffan Karger [Sun, 13 Jul 2014 09:26:32 +0000 (11:26 +0200)] 
Define dummy SSL_OP_NO_TICKET flag if not present in OpenSSL.

This restores support for pre-0.9.8f OpenSSL versions, which do not include
stateless session resumption, and the accompanying SSL_OP_NO_TICKET flag.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <53C251E2.7050605@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8902
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoDon't exit daemon if opening or parsing the CRL fails.
Steffan Karger [Sun, 6 Jul 2014 09:27:21 +0000 (11:27 +0200)] 
Don't exit daemon if opening or parsing the CRL fails.

As requested in trac ticket #83, the daemon should not exit if opening the
CRL file during a connection attempt fails; OpenVPN should merely deny the
connection.

CRL files need to be periodically updated. When users update their CRL in
place and a connection attempt takes place simultaneously, the CRL file
might temporarily not be available, or not be in a consistent state.
Previously, that would result in the daemon exiting. With this patch, that
results in one (or possibly a few) failed connection attempts, but service
will restore automatically as soon as the CRL is again available in a valid
state.

Note that on startup OpenVPN still checks the existence and accessibility
of the CRL file, and will refuse to start on error.

While I was touching the code, I improved error reporting for the PolarSSL
code a bit. The polar code opens and parses the CRL in a single call, so
on error retrieve details from polarssl and report those to the user.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <53BED57C.7070300@fox-it.com>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoDo not upcase x509-username-field for mixed-case arguments.
Andris Kalnozols [Sat, 28 Jun 2014 17:41:02 +0000 (19:41 +0200)] 
Do not upcase x509-username-field for mixed-case arguments.

I revisited options.c to refine its brute-force upcasing behavior. Now, the
upcasing is done only if the option argument is all lowercase. Mixed-case
arguments and those with the "ext:" prefix are left unchanged. This
preserves the original intent of the "helpful" upcasing feature for
backwards compatibility while limiting its scope in a straightforward way.

Signed-off-by: Andris Kalnozols <andris@hpl.hp.com>
Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <53B1BDD8.8020705@karger.me>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoRemove ENABLE_BUFFER_LIST
Arne Schwabe [Mon, 7 Jul 2014 12:12:22 +0000 (14:12 +0200)] 
Remove ENABLE_BUFFER_LIST

it is unconditionally enabled and OpenVPN does not compile if disabled
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1404735142-31420-4-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8841

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoCall init script helpers with explicit path (./)
Gert Doering [Tue, 8 Jul 2014 07:20:54 +0000 (09:20 +0200)] 
Call init script helpers with explicit path (./)

The provided OpenVPN init scripts scan /etc/openvpn for *.conf and run
an OpenVPN process for each, and if a .sh script with the same base name
exists, this is run before openvpn.  Change from running "$name.sh" to
"./$name.sh" - depending on the shell used, the script won't be found
otherwise, and ensuring that the script isn't searched in $PATH is the
right thing anyway.

Reported in trac #423

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Message-Id: <1404804054-32424-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8858

11 years agoFix t_lpback.sh platform-dependent failures
Gert Doering [Tue, 8 Jul 2014 14:45:58 +0000 (16:45 +0200)] 
Fix t_lpback.sh platform-dependent failures

commit e97aa06dc058 introduced "full openvpn cipher testing", but fails
on OpenSSL 0.9.8 with DES-CFB1 (skip), on NetBSD for RC5-* (needs extra
library, libcrypto_rc5.a) and on Solaris for POSIXly "tail" (rewrite).

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <1404830758-7927-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8861

11 years agoDon't issue warning for 'translate to self' tls-ciphers
Steffan Karger [Thu, 3 Jul 2014 21:47:45 +0000 (23:47 +0200)] 
Don't issue warning for 'translate to self' tls-ciphers

All cipher suite names supplied through --tls-cipher are translated by
OpenVPN to IANA names, to get OpenSSL and PolarSSL configuration files
compatible. OpenSSL however supports cipher suite group names, like
'DEFAULT', 'HIGH', or 'ECDH'. To make OpenVPN not complain about these,
entries translating these to themselves were added to the translation
table. However, to make OpenVPN not still complain, the deprecated-name
check has to be reversed from 'if this is a deprecated name then complain'
to 'if this is not a iana name, then complain'. Which this commit does.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1404424065-24787-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8824
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoExtend t_lpback tests to test all ciphers reported by --show-ciphers
Steffan Karger [Sun, 8 Jun 2014 16:16:15 +0000 (18:16 +0200)] 
Extend t_lpback tests to test all ciphers reported by --show-ciphers

... instead of just BF-CBC. Should catch more mistakes.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1402244175-31462-5-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8777
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoImprove --show-ciphers to show if a cipher can be used in static key mode
Steffan Karger [Sun, 8 Jun 2014 15:04:32 +0000 (17:04 +0200)] 
Improve --show-ciphers to show if a cipher can be used in static key mode

Also remove the bulky warning from init_key_type() and add the information
to the --show-ciphers output.

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: <53BAEF65.2070509@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8852
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoAdd proper check for crypto modes (CBC or OFB/CFB)
Steffan Karger [Sun, 8 Jun 2014 16:16:13 +0000 (18:16 +0200)] 
Add proper check for crypto modes (CBC or OFB/CFB)

OpenSSL has added AEAD-CBC mode ciphers like AES-128-CBC-HMAC-SHA1, which
have mode EVP_CIPH_CBC_MODE, but require a different API (the AEAD API).
So, add extra checks to filter out those AEAD-mode ciphers.

Adding these made the crypto library agnostic function cfb_ofb_mode()
superfuous, so removed that on the go.

Also update all cipher mode checks to use the new cipher_kt_mode_*()
functions for consistency.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1402244175-31462-3-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8779
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoRename ALLOW_NON_CBC_CIPHERS to ENABLE_OFB_CFB_MODE, and add to configure.
Steffan Karger [Sun, 8 Jun 2014 16:16:12 +0000 (18:16 +0200)] 
Rename ALLOW_NON_CBC_CIPHERS to ENABLE_OFB_CFB_MODE, and add to configure.

Makes OFB/CFB compile time configurable, and fixes output of --show-ciphers
to also show OFB/CFB ciphers along the way (becasue crypto.h was not
included from crypto_openssl.c).

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1402244175-31462-2-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8781
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoMake t_client.sh work on AIX.
Gert Doering [Tue, 10 Jun 2014 14:04:33 +0000 (16:04 +0200)] 
Make t_client.sh work on AIX.

Teach it how to run ifconfig/route on AIX to have meaningful results.

Signed-off-by: Gert Doering <gd@medat.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1402409073-54067216-5-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8786
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoimplement adding/deleting routes on AIX, for IPv4 and IPv6
Gert Doering [Tue, 10 Jun 2014 14:04:32 +0000 (16:04 +0200)] 
implement adding/deleting routes on AIX, for IPv4 and IPv6

AIX only has TAP interfaces, so always use gateway address as next hop,
not interface name.

AIX route works much more reliable if passed netbits than netmask - do so
(introducing a new helper function netmask_to_netbits2())
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1402409073-54067216-4-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8785

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoAdd tap driver initialization and ifconfig for AIX.
Gert Doering [Tue, 10 Jun 2014 14:04:31 +0000 (16:04 +0200)] 
Add tap driver initialization and ifconfig for AIX.

AIX is special... ifconfig only works if it can add the data to
the ODM right away, so setup a local enviromnment set that has
"ODMDIR=/etc/objrepos" in it (hard-coded, nobody changes that).

Only --dev tap or --dev tapNN are supported right now.  AIX has no
tun driver (so tun mode would need to dynamically add/remove ethernet
headers to/from AIX).

Signed-off-by: Gert Doering <gd@medat.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1402409073-54067216-3-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8788
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoRecognize AIX, define TARGET_AIX
Gert Doering [Tue, 10 Jun 2014 14:04:30 +0000 (16:04 +0200)] 
Recognize AIX, define TARGET_AIX

force "have_tap_header=yes", as configure won't like AIX headers otherwise
(no tun related headers, just <net/if_tap.h>).

force ROUTE to be "/usr/sbin/route" - not executable by non-root users, so
configure testing for executables will not find it

force "ac_cv_header_net_if_h=no", because AIX' <net/if.h> pulls in AIX'
<net/route.h>, which #defines ROUTE_H, disabling our "route.h"... (and
we don't need <net/if.h> on AIX anyway)

Signed-off-by: Gert Doering <gd@medat.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1402409073-54067216-2-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8787
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agocleanup: remove #if 0'ed function initiate_untrusted_session() from ssl.c.
Steffan Karger [Wed, 2 Jul 2014 21:31:28 +0000 (23:31 +0200)] 
cleanup: remove #if 0'ed function initiate_untrusted_session() from ssl.c.

Has been inside the #if 0 since 'git tree epoch' (sept-2005) and was not
referenced, from either code, nor dead code nor comment.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1404336688-15036-1-git-send-email-steffan@karger.me>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoFix socket-flag/TCP_NODELAY on Mac OS X
James Bekkema [Thu, 26 Jun 2014 11:40:39 +0000 (21:40 +1000)] 
Fix socket-flag/TCP_NODELAY on Mac OS X

Hi All,

OpenVPN 2.3.4 will currently throw a warning of "NOTE: setsockopt
TCP_NODELAY=1 failed (No kernel support) when attempting to use the
TCP_NODELAY socket option on Mac OS X/Darwin. Kernel support is there,
however the required header file where TCP_NODELAY is defined is not being
included. This patch simply alters syshead.h to include <netinet/tcp.h> on
Darwin platforms.

Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <A1005665-126D-45D5-A6F2-75ED0EAE30FE@sparklabs.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8809

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoFix some typos in the man page.
Andris Kalnozols [Sat, 28 Jun 2014 17:45:48 +0000 (19:45 +0200)] 
Fix some typos in the man page.

Signed-off-by: Andris Kalnozols <andris@hpl.hp.com>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <53AF0D20.7020204@karger.me>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoUpdate README.polarssl
Steffan Karger [Tue, 24 Jun 2014 20:03:26 +0000 (22:03 +0200)] 
Update README.polarssl

PolarSSL support has been extended and adjusted, but README.polarssl was
not accordingly adjusted. This updates README.polarssl to the current state
of affairs for the master branch.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1403640206-7024-2-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8803
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoFix bug that incorrectly refuses oid representation eku's in polar builds
Steffan Karger [Fri, 25 Apr 2014 08:41:17 +0000 (10:41 +0200)] 
Fix bug that incorrectly refuses oid representation eku's in polar builds

The return value of x509_get_numeric_string() was interpreted incorrectly
by ssl_verify_polarssl.c's x509_verify_cert_eku(). This patch enables the
usage of oid represenation in --remote-cert-eku options.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Message-Id: <1398415277-6880-1-git-send-email-steffan.karger@fox-it.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8627
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoconfigure.ac: fix SSL_OP_NO_TICKET check
Steffan Karger [Sun, 22 Jun 2014 18:18:39 +0000 (20:18 +0200)] 
configure.ac: fix SSL_OP_NO_TICKET check

Only check for SSL_OP_NO_TICKET if building with --enable-ssl and using
openssl. This fixes cross-compiling polarssl builds for Windows (where
pkg-config would find the system openssl library, but the cross compiler
would not have openssl for the target platform).

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1403461119-21440-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8795
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoImprove error reporting on file access to --client-config-dir and --ccd-exclusive
David Sommerseth [Fri, 2 May 2014 00:28:24 +0000 (02:28 +0200)] 
Improve error reporting on file access to --client-config-dir and --ccd-exclusive

OpenVPN will do some simple sanity checking at startup to ensure
the expected files and directories is in place.  However, with
--client-config-dir and --ccd-exclusive, things are slightly different.
In both cases it is perfectly fine that files does not exists, and we
cannot know any file names beforehand due to these filenames being based
upon the certificate's CN field.

The problem arises when OpenVPN cannot open files inside a directory
because the directory permissions are too restrictive, have wrong
ownership (triggered by the usage of --user/--group) or other security
mechanisms the OS uses.

When a client connects, the test_file() function is used to check if a
client config file has been prepared.  And if not, it continues without
trying to read it.  So, if the privileges of the running OpenVPN process
is not allowed to open and read an existing file, OpenVPN will treat this
as a non-existing file without saying anything.  This is clearly wrong.
So this patch adds an warning message in the OpenVPN log if it could
not open the file due to lack of permissions.

This will work fine on all *nix based OSes.  Windows however reports
'no such file or directory' (errno=2/-ENOENT) even on privilege access
errors when the directory this file resides is too restrictive.  But there
is no easy way to work around that.  However, I believe that the initial
sanity checking at startup will catch that one, as it will check if the
directories it needs exists.

This patch has only gone through simple basic testing, with both too few
privileges and with proper privileges to the CCD directory.  With wrong
privileges, the following error can be found if CN=Test client

  Fri May  2 00:00:10 2014 us=281993 127.0.0.1:41017 Could not access file
'/etc/clients/Test client': Permission denied (errno=13)

[v2 - use openvpn_errno() instead of errno, for better platform support]

Trac: #277
Trac-URL: https://community.openvpn.net/openvpn/ticket/277
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <1398990504-4239-1-git-send-email-dazo@users.sourceforge.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8688
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoDrop incoming fe80:: packets silently now.
Gert Doering [Fri, 6 Jun 2014 18:43:55 +0000 (20:43 +0200)] 
Drop incoming fe80:: packets silently now.

IPv6 has the concept of "link local" addresses, fe80::<host id>, which
normally are present on every link, and are used for stuff like DHCPv6,
neighbor discovery, etc.

OpenVPN point-to-multipoint mode currently does neither configure them on
tun interfaces, nor are they handled in a meaningful way if a client OS
always has them (like Windows or Solaris) - so the log fills with many
lines of "MULTI: bad source address from client [fe80::...]", serving
no useful purpose.

This patch just recognizes IPv6 LL packets and silently drops them.

Further patches can build on this and add full link-local support, which
would require address learning (as the addresse are based on host IDs, not
assigned by the server).

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <1402080235-24409-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8773

11 years agorefine assertion to allow other modes than CBC
Heiko Hund [Thu, 16 Aug 2012 08:38:50 +0000 (10:38 +0200)] 
refine assertion to allow other modes than CBC

cipher_ctx_final() only returns an outlen in CBC mode. If CFB or OFB
are used the assertion outlen == iv_len is always false.

There's no CBC mode defined for the GOST 28147-89 block cipher. Hence
this patch is needed for it to work. It's needed for other ciphers like
BF-CFB as well, though.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <538A00AA.7090007@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8748
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoFix --disable-ssl builds, were broken by cleanup in 63dc03d.
Steffan Karger [Mon, 2 Jun 2014 19:23:39 +0000 (21:23 +0200)] 
Fix --disable-ssl builds, were broken by cleanup in 63dc03d.

Wrap ssl_verify.h in "#if defined(ENABLE_CRYPTO) && defined(ENABLE_SSL)" to
make it empty for --disable-ssl builds.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1401737019-15702-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8763
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoAdd (default disabled) --enable-werror option to configure
Steffan Karger [Thu, 29 May 2014 10:39:07 +0000 (12:39 +0200)] 
Add (default disabled) --enable-werror option to configure

Useful for example during development or automated builds, to make the
build error out if new warnings are introduced.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1401359947-31144-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8747
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoRemove unused variable 'proxy' from socket_restart_pause()
Steffan Karger [Sun, 1 Jun 2014 17:58:56 +0000 (19:58 +0200)] 
Remove unused variable 'proxy' from socket_restart_pause()

Variable 'proxy' was set but never read, so remove it.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1401645536-27849-6-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8750
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoRemove dependency on manage.h from ssl_verify.h
Steffan Karger [Sun, 1 Jun 2014 17:58:55 +0000 (19:58 +0200)] 
Remove dependency on manage.h from ssl_verify.h

verify_user_pass_enabled() is a function on a tls_session, and belongs in
ssl.c. Moving the function removes the dependency on manage.h.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1401645536-27849-5-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8754
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoMove #include "ssl_verify.h" from ssl.h to the source files that need it.
Steffan Karger [Sun, 1 Jun 2014 17:58:54 +0000 (19:58 +0200)] 
Move #include "ssl_verify.h" from ssl.h to the source files that need it.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1401645536-27849-4-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8749
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoFix ssl.c, ssl_verify_* includes
Steffan Karger [Sun, 1 Jun 2014 17:58:53 +0000 (19:58 +0200)] 
Fix ssl.c, ssl_verify_* includes

* ssl.c: remove three unneeded includes
* ssl_verify_polarssl.h: remove two unneeded includes
* ssl_verify_openssl.c: add missing ssl_verify_openssl.h and error.h
  includes, and reorder includes.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1401645536-27849-3-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8753
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoUse generic openvpn_x509_cert_t in ssl_verify_polarssl.c
Steffan Karger [Sun, 1 Jun 2014 17:58:52 +0000 (19:58 +0200)] 
Use generic openvpn_x509_cert_t in ssl_verify_polarssl.c

For symmetry with ssl_verify_openssl.c and release/2.3 branch.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1401645536-27849-2-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8752
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoFix merge error in a6c573d, the ssl ctx is now abstracted.
Steffan Karger [Wed, 28 May 2014 19:40:34 +0000 (21:40 +0200)] 
Fix merge error in a6c573d, the ssl ctx is now abstracted.

Between the origin patch submission (2011) and now the cipher abstraction
layer has been added. This patch slipped through without proper adjustment.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <53863C41.1020408@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8745
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoMerge get_default_gateway() implementation for all 4+1 BSD variants.
Gert Doering [Tue, 14 Jan 2014 13:33:18 +0000 (14:33 +0100)] 
Merge get_default_gateway() implementation for all 4+1 BSD variants.

This was 3 times mostly the same code, with the 4 traditional BSDs
only differing in a single line, while MacOS X had more refined code
to do not only gateway determination, but also netmask, interface name
and MAC address.

The MacOS X code works perfectly well on the other BSDs *if* one macro
is #ifdef'ed to use "(uint32_t)" on MacOS X and "(long)" on all other
BSDs, 32 and 64 bit variants.  API change by OSX when going to 64bit.

Tested on FreeBSD 8.3/i386, FreeBSD 9.1/amd64, NetbSD 5.1/amd64,
OpenBSD 4.9/i386, OpenBSD 5.4/amd64 (= all affected platforms except
DragonFly BSD).

See also trac#42 and trac#340.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Lazy-Ack-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1389706398-26922-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8233

11 years agoRemove unneeded defines (were needed for pre-0.9.7 OpenSSL).
Steffan Karger [Sun, 25 May 2014 19:18:21 +0000 (21:18 +0200)] 
Remove unneeded defines (were needed for pre-0.9.7 OpenSSL).

Since we now require OpenSSL 0.9.8, we don't need these anymore.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1401045501-12343-4-git-send-email-steffan@karger.me>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoRemove unneeded wrapper functions in crypto_openssl.c
Steffan Karger [Sun, 25 May 2014 19:18:20 +0000 (21:18 +0200)] 
Remove unneeded wrapper functions in crypto_openssl.c

Both EVPCipherInit_ov() and EVPCipherUpdate_ov() wrapped OpenSSL functions
without any changes, so lets just use the functions directly.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1401045501-12343-3-git-send-email-steffan@karger.me>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoRemove function without effect (cipher_ok() always returned true).
Steffan Karger [Sun, 25 May 2014 19:18:19 +0000 (21:18 +0200)] 
Remove function without effect (cipher_ok() always returned true).

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1401045501-12343-2-git-send-email-steffan@karger.me>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoUse SSL_MODE_RELEASE_BUFFERS if available
Cristian Rodriguez [Sun, 25 May 2014 13:52:58 +0000 (15:52 +0200)] 
Use SSL_MODE_RELEASE_BUFFERS if available

Sets SSL_MODE_RELEASE_BUFFERS if available, to keep openSSL memory
usage as low as possible.

For more info, see
http://www.imperialviolet.org/2010/06/25/overclocking-ssl.html
https://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html

See also trac #157

Signed-off-by: Cristian Rodriguez <crrodriguez@opensuse.org>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <5381FEFF.1040609@karger.me>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoFixed some compile issues with show_library_versions()
James Yonan [Thu, 8 May 2014 22:50:36 +0000 (16:50 -0600)] 
Fixed some compile issues with show_library_versions()

* Refactored show_library_versions to work around the fact
  that some compilers (such as MSVC 2008) can't handle #ifdefs
  inside of macro references.

* Declare show_library_versions() in options.h because it's
  referenced by other files such as openvpn.c.

* Declare get_ssl_library_version() as returning const char *,
  to avoid loss of const qualifier in ssl_openssl.c.

Signed-off-by: James Yonan <james@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1399589436-8730-7-git-send-email-james@openvpn.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8711
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit a91a2d6ad7b139ec78d61c8616b8447847e9ecc6)

11 years agoDefine PATH_SEPARATOR for MSVC builds.
James Yonan [Thu, 8 May 2014 22:50:35 +0000 (16:50 -0600)] 
Define PATH_SEPARATOR for MSVC builds.

Signed-off-by: James Yonan <james@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1399589436-8730-6-git-send-email-james@openvpn.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8714
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 3e8e496008f6634234d5867a22d7a1c03a5bf164)

11 years agoConditionalize calls to print_default_gateway on !ENABLE_SMALL
Gert Doering [Tue, 29 Apr 2014 21:09:39 +0000 (23:09 +0200)] 
Conditionalize calls to print_default_gateway on !ENABLE_SMALL

Calls to print_default_gateway() depended on #ifdef ENABLE_DEBUG, but
the actual function wasn't compiled in #ifdef ENABLE_SMALL, so the
combination "configure --enable-small --enable-debug" didn't work. Fix.

Fix trac #397

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <1398805779-29376-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8670

11 years agoFix is_ipv6 in case of tap interface.
Dmitrij Tejblum [Sat, 8 Feb 2014 15:33:49 +0000 (19:33 +0400)] 
Fix is_ipv6 in case of tap interface.

While checking a packet on a TAP interface, is_ipv_X() in proto.c
insist that the ethertype must be OPENVPN_ETH_P_IPV4, even if
the protocol is IPv6. So the protocol never match, and, thus,
mssfix doesn't work for IPv6 on TAP interface. Fix that.

Signed-off-by: Dmitrij Tejblum <dt@yandex.ru>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1391873629-14388-1-git-send-email-dt@yandex.ru>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8259
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoFix build system to accept non-system crypto library locations for plugins.
Steffan Karger [Mon, 21 Apr 2014 11:37:18 +0000 (13:37 +0200)] 
Fix build system to accept non-system crypto library locations for plugins.

Flags like {OPEN,POLAR}SSL_CFLAGS were used by the core build, but not by
the plugins. However, all plugins include openvpn-plugin.h, which need
crypto/ssl headers.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1398080238-19662-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8576
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoMore IPv6-related updates to the openvpn man page.
Gert Doering [Sat, 26 Apr 2014 11:30:54 +0000 (13:30 +0200)] 
More IPv6-related updates to the openvpn man page.

Point to correct kernel version for --multihome and IPv4-mapped
addresses (3.15, Tore Anderson).

Remove old reference to http://www.greenie.net/ from the IPv6 section,
as the code and documentation in here is more current than on that site.
Some more additions and clarifications.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Tore Anderson <tore@fud.no>
Message-Id: <1398511854-3609-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8642

11 years agoMake serial env exporting consistent amongst OpenSSL and PolarSSL builds.
Steffan Karger [Sun, 27 Apr 2014 08:49:20 +0000 (10:49 +0200)] 
Make serial env exporting consistent amongst OpenSSL and PolarSSL builds.

This changes the representation of the tls_serial_{n} environment variable
from hex to decimal for PolarSSL builds, to match OpenSSL build behaviour.

Because hex representation for serials makes sense too, and to ease
transition for PolarSSL users, added tls_serial_hex_{n} that exports the
serial in hex represenation for both crypto library backends.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1398588561-18964-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8649
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoFix OCSP_check.sh to also use decimal for stdout verification.
Steffan Karger [Sun, 27 Apr 2014 08:49:21 +0000 (10:49 +0200)] 
Fix OCSP_check.sh to also use decimal for stdout verification.

This is an extra fix needed on top of 959d607, which already changes the
serial parameter to correctly use decimal representation.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1398588561-18964-2-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8650
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoChange signedness of hash in x509_get_sha1_hash(), fixes compiler warning.
Steffan Karger [Sun, 27 Apr 2014 07:55:48 +0000 (09:55 +0200)] 
Change signedness of hash in x509_get_sha1_hash(), fixes compiler warning.

hash was cast from char * to unsigned char * at the return of the function.
This patch removes the implicit cast by declaring hash as unsigned char * .

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1398585348-7969-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8647
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoRewrite manpage section about --multihome
Gert Doering [Fri, 25 Apr 2014 19:19:15 +0000 (21:19 +0200)] 
Rewrite manpage section about --multihome

Part of the information was confusing, part was outdated, and part was
just not making sense.  Pointed out in trac#348.

Also add note about Linux IPv4-mapped issues as per trac#306.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1398453555-19706-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8635

11 years agoRepair --multihome on FreeBSD for IPv4 sockets.
Gert Doering [Sun, 19 Jan 2014 20:51:37 +0000 (21:51 +0100)] 
Repair --multihome on FreeBSD for IPv4 sockets.

The code in link_socket_write_udp_posix_sendmsg() for the IP_RECVDESTADDR
case was sending a too-large control message (sizeof openvpn_pktinfo,
which is a union for IPv4+IPv6) instead of just openvpn_in4_pktinfo,
leading to sendmsg() refusing to send the packet.

Use RFC 2292 macros for alignment + size calculation.

Fix trac#327

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Lazy-Ack-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1390164697-1590-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8250

11 years agoFix man page and OSCP script: tls_serial_{n} is decimal
Arne Schwabe [Fri, 28 Mar 2014 10:07:01 +0000 (11:07 +0100)] 
Fix man page and OSCP script: tls_serial_{n} is decimal

Commit 7d5e26cbb53 fixed extracting serial but did not change the format,
which always has been decimal. This patch fixes the manpage and
OSCP.sh script to conform with the implementation.
Acked-by: James Yonan <james@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1396001222-5033-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8409

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoAdd an elliptic curve testing cert chain to the sample keys
Steffan Karger [Wed, 23 Apr 2014 22:43:38 +0000 (00:43 +0200)] 
Add an elliptic curve testing cert chain to the sample keys

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1398293018-8581-3-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8601
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoAdd support for elliptic curve diffie-hellmann key exchange (ECDH)
Steffan Karger [Wed, 23 Apr 2014 22:31:08 +0000 (00:31 +0200)] 
Add support for elliptic curve diffie-hellmann key exchange (ECDH)

This patch is based on Jan Just Keijser's patch from Feb 7, 2012.

When OpenSSL 1.0.2+ or PolarSSL is used, lets the crypto library do the
heavy lifting. For OpenSSL builds, if a user specifies a curve using
--ecdh-curve, it first tries to override automatic selection using that
curve.

For older OpenSSL, tries the following things (in order of preference):
 * When supplied, use the ecdh curve specified by the user.
 * Try to extract the curve from the private key, use the same curve.
 * Fall back on secp384r1 curve.

Note that although a curve lookup might succeed, OpenSSL 1.0.0 and older do
*not* support TLSv1.1 or TLSv1.2, which means no that no EC-crypto can be
used.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <53597BEA.6080408@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8625
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoMinor t_client.sh cleanups
Gert Doering [Sun, 20 Apr 2014 18:41:01 +0000 (20:41 +0200)] 
Minor t_client.sh cleanups

- remove built tests/t_client.sh script on "make clean"
- ignore Linux iproute2 "ssthresh <n>" output that sometimes shows up
  in "ip -6 route show" and breaks before/after comparison

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1398019261-30180-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8557

11 years agoUse native strtoull() with MSVC 2013.
James Yonan [Mon, 21 Apr 2014 07:10:03 +0000 (01:10 -0600)] 
Use native strtoull() with MSVC 2013.

MSVC 2013 C library now defines strtoull() function,
so use the native implementation when available.

Signed-off-by: James Yonan <james@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1398064204-26476-3-git-send-email-james@openvpn.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8561
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoUpdate openvpn-plugin.h for PolarSSL 1.3.
Steffan Karger [Mon, 21 Apr 2014 09:52:51 +0000 (11:52 +0200)] 
Update openvpn-plugin.h for PolarSSL 1.3.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <5354F0F2.5080200@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8567
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoImprove error reporting during key/cert loading with PolarSSL.
Steffan Karger [Tue, 4 Feb 2014 12:58:05 +0000 (13:58 +0100)] 
Improve error reporting during key/cert loading with PolarSSL.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: James Yonan <james@openvpn.net>
Message-Id: <53528943.3090205@fox-it.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8555
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoUpgrade to PolarSSL 1.3
Steffan Karger [Tue, 4 Feb 2014 12:57:15 +0000 (13:57 +0100)] 
Upgrade to PolarSSL 1.3

This removes support for PolarSSL 1.2. The mimimum version of PolarSSL
required is now 1.3.3. The upgrade brings OpenVPN-with-PolarSSL:

* Support for EC-crypto in TLS (but not yet for external
  pkcs11/management keys)
* Support for AES-NI (if PolarSSL is compiled with AES-NI support)

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: James Yonan <james@openvpn.net>
Message-Id: <53528943.3090205@fox-it.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8555
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoAdd SSL library version reporting.
Gert Doering [Sun, 13 Apr 2014 15:29:32 +0000 (17:29 +0200)] 
Add SSL library version reporting.

Print the version of the SSL and LZO library (if any) used.

SSL library version is also sent as IV_SSL=<version> to the server if
--push-peer-info is enabled.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20140416152456.GI16637@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8537

11 years agoIPv6 address/route delete fix for Win8
Gert Doering [Sun, 13 Apr 2014 11:12:02 +0000 (13:12 +0200)] 
IPv6 address/route delete fix for Win8

Use "store=active" for IPv6 address and route deletion - seems to be
required on Windows 8 and up, and not doing it will break OpenVPN
reconnection (old addresses are not properly deleted, thus address can
not be configured on connect).

Reported-by: Cedric <cedric+openvpn@bgtn.net>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Cedric Tabary <cedric+openvpn@bgtn.net>
Message-Id: <20140413170648.GU16637@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8499

11 years agoFix SOCKSv5 method selection
Yawning Angel [Mon, 10 Mar 2014 03:47:58 +0000 (03:47 +0000)] 
Fix SOCKSv5 method selection

So, RFC 1928 doesn't say anything about the METHODS field in the Method
Selection message being ordered in terms of preference or anything, and
the server is free to pick any of the METHODS offered by the client.

Always sending a Method Selection message with NO AUTHENTICATION REQUIRED
and USERNAME/PASSWORD set is broken on two fronts:

 * If the OpenVPN client can't handle the server picking USERNAME/PASSWORD
   due to the credentials being missing, it shouldn't offer it to the
server.

 * If the OpenVPN client has credentials, then it should always attempt to
   authenticate.  This is a security product.  "You can misconfigure it and
   it will work" is not acceptable.  Setting a username/password when the
   SOCKS server doesn't require/support that as an option is the user not
   configuring it correctly, and should be treated as such.

Also verify that the SOCKS server returned the auth that was requested.

URL: https://github.com/OpenVPN/openvpn/pull/14
Fix trac #377, trac #148
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20140413130102.GR16637@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8488

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoFix typo in sample build script to use LDFLAGS
kangsterizer [Sun, 13 Apr 2014 11:15:00 +0000 (13:15 +0200)] 
Fix typo in sample build script to use LDFLAGS

Came in as github pull request #15

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-By: Arne Schwabe <arne@rfc2549.org>
11 years agoWork around Solaris getaddrinfo() returing ai_protocol=0
Arne Schwabe [Mon, 7 Apr 2014 20:12:05 +0000 (22:12 +0200)] 
Work around Solaris getaddrinfo() returing ai_protocol=0

Create_socket() and sub-functions assume that the ai_protocol value
returned by getaddrinfo() is IPPROTO_UDP or IPPROTO_TCP.  On Solaris,
it is "0", because Solaris's socket() call will then "select the right
protocol" - but it breaks our code.  So remove ASSERT()s on ai_protocol,
and also accept properly set ai_socktype (SOCK_DGRAM/SOCK_STREAM) values
if ai_protocol is not set.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20140407201711.GN16637@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8428

11 years agofix route struct name
Heiko Hund [Tue, 1 Apr 2014 10:06:43 +0000 (12:06 +0200)] 
fix route struct name

This slipped in with commit d0085293.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1396346803-31772-1-git-send-email-heiko.hund@sophos.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8421
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoconfigure.ac: use CPPFLAGS for SSL_OP_NO_TICKET check
Steffan Karger [Mon, 31 Mar 2014 22:33:55 +0000 (00:33 +0200)] 
configure.ac: use CPPFLAGS for SSL_OP_NO_TICKET check

AC_EGREP_CPP uses CPPFLAGS, not CFLAGS. Make sure the macro can find
OpenSSL by temporarily adding OPENSSL_CRYPTO_FLAGS to CPPFLAGS.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Heiko Hund <heiko.hund@sophos.com>
Message-Id: <5339EFFC.6090908@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8419
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoFix crash when using --inetd.
Gert Doering [Sun, 30 Mar 2014 12:09:36 +0000 (14:09 +0200)] 
Fix crash when using --inetd.

Change "local" argument to socket_do_listen() to avoid calling
"local->ai_addr" in the caller for the "do_listen == FALSE" case,
in which case it could be NULL.

Also, ensure "ai" is always initialized in socket_listen_accept() for
the "!remote_dynamic" case - otherwise it will sometimes(!) crash in
addrlist_match() later on.

Get rid of spurious operator precedence warning concerning
GETADDR_CACHE_MASK.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1396181376-32022-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8412

11 years agoFix assert when using port-share
Arne Schwabe [Fri, 21 Mar 2014 13:18:44 +0000 (14:18 +0100)] 
Fix assert when using port-share

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1395407925-25518-12-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8369

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoClean up of socket code.
Arne Schwabe [Fri, 21 Mar 2014 13:18:43 +0000 (14:18 +0100)] 
Clean up of socket code.

Let socket_create take struct addrinfo as argument and use the entries of
addrinfo to create the socket.

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1395407925-25518-11-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8370

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoconfigure.ac: check for SSL_OP_NO_TICKET flag in OpenSSL
Steffan Karger [Sun, 23 Mar 2014 13:07:47 +0000 (14:07 +0100)] 
configure.ac: check for SSL_OP_NO_TICKET flag in OpenSSL

SSL_OP_NO_TICKET tells OpenSSL to disable "stateless session resumption".
This is something we do not want nor need, but could potentially be used
for a future attack. OpenVPN 2.4 requires the flag to be set and will fail
configure if the flag is not present.
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <CAA1AbxJh17KYmVU1BVa5kp4iJsUJT+xnXp0rVU_3g3c5hPnqDQ@mail.gmail.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8389

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoDisable unsupported TLS cipher modes by default, cleans --show-tls output.
Steffan Karger [Sat, 1 Mar 2014 14:36:15 +0000 (15:36 +0100)] 
Disable unsupported TLS cipher modes by default, cleans --show-tls output.

This explicitly disables a number of tls ciphers that OpenVPN has currently
no support for. OpenSSL will automatically detect this during negotiation,
but --show-tls would erroneously show a number of unsupported ciphers.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1393684575-28112-3-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8318
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoAdd openssl-specific common cipher list names to ssl.c.
Steffan Karger [Sat, 1 Mar 2014 14:36:14 +0000 (15:36 +0100)] 
Add openssl-specific common cipher list names to ssl.c.

This adds a number of commonly used cipher list names to ssl.c, which makes
OpenVPN not give a "translation not found" warning when using these.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1393684575-28112-2-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8316
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoBump minimum OpenSSL version to 0.9.8
Steffan Karger [Sun, 23 Mar 2014 13:53:01 +0000 (14:53 +0100)] 
Bump minimum OpenSSL version to 0.9.8

OpenSSL 0.9.7 and older are considered obsolete (see
http://www.openssl.org/news/news.html). This patch updates configure.ac to
require OpenSSL 0.9.8 or newer, and removes a number of #ifdefs that are
now no longer needed.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1395582781-27966-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8392
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoAdd gateway and device to android control messages
Arne Schwabe [Fri, 21 Mar 2014 13:18:41 +0000 (14:18 +0100)] 
Add gateway and device to android control messages

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1395407925-25518-9-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8368

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoDon't show the connection profile store in options->ce if there is a connection_list...
Arne Schwabe [Fri, 21 Mar 2014 13:18:40 +0000 (14:18 +0100)] 
Don't show the connection profile store in options->ce if there is a connection_list defined.

Entries in options->ce are never used and overwritten by the first usable
connection profile on initialisation.

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1395407925-25518-8-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8377

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoFix for server selecting address family
Arne Schwabe [Fri, 21 Mar 2014 13:18:39 +0000 (14:18 +0100)] 
Fix for server selecting address family

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1395407925-25518-7-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8371

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoIntroduce an option to resolve dns names in advance for --remote, --local and --http...
Arne Schwabe [Sun, 23 Mar 2014 12:13:06 +0000 (13:13 +0100)] 
Introduce an option to resolve dns names in advance for --remote, --local and --http-proxy

Also introduce x_gc_addspeical function that allows to add objects with a
custom free function to the gc.

Some additional addrinfo cleanup

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1395576786-17507-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8386

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoAdjusted autotools files to build more cleanly on newer autoconf/automake versions
David Sommerseth [Wed, 15 Jan 2014 16:36:04 +0000 (17:36 +0100)] 
Adjusted autotools files to build more cleanly on newer autoconf/automake versions

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <1389803764-5879-1-git-send-email-davids@redhat.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8239
Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoImplement an easy parsable log output that allows access to flags of the log message
Arne Schwabe [Fri, 21 Mar 2014 13:18:37 +0000 (14:18 +0100)] 
Implement an easy parsable log output that allows access to flags of the log message

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1395407925-25518-5-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8374

Signed-off-by: Gert Doering <gert@greenie.muc.de>
11 years agoWorkaround broken Android 4.4 VpnService API for persist-tun mode
Arne Schwabe [Fri, 21 Mar 2014 13:18:36 +0000 (14:18 +0100)] 
Workaround broken Android 4.4 VpnService API for persist-tun mode

In Android 4.4 it is not possible to open a new tun device and then close
the old tun device without breaking the whole VPNService stack until the
device is rebooted.

Add new management method to ask the UI what method should be taken to
ensure the optimal solution for the situation.  Then do open-before-close
or close-before-open inside open_tun() as requested.

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1395407925-25518-4-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8373

Signed-off-by: Gert Doering <gert@greenie.muc.de>