]> git.ipfire.org Git - thirdparty/openvpn.git/log
thirdparty/openvpn.git
12 years agoTLS version negotiation
James Yonan [Tue, 11 Jun 2013 04:59:30 +0000 (22:59 -0600)] 
TLS version negotiation

Updated the TLS negotiation logic to adaptively try to connect using
the highest TLS version supported by both client and server.
Previously, OpenVPN (when linked with OpenSSL) would always connect
using TLS 1.0.

Also added tls-version-min directive to force a higher TLS version
than 1.0:

tls-version-min <version> ['or-highest'] -- sets the minimum
TLS version we will accept from the peer.  Examples for version
include "1.0" (default), "1.1", or "1.2".  If 'or-highest' is
specified and version is not recognized, we will only accept
the highest TLS version supported by the local SSL implementation.

Examples:

tls-version-min 1.1 -- fail the connection unless peer can
  connect at TLS 1.1 or higher.

tls-version-min 1.2 or-highest -- require that the peer
  connect at TLS 1.2 or higher, however if the local SSL
  implementation doesn't support TLS 1.2 (as it wouldn't
  if linked with an older version of OpenSSL), reduce the
  minimum required version to the highest version supported
  by the local SSL implementation (such as TLS 1.0).  This
  is intended to allow client configurations to target higher
  TLS versions that are supported on the server, even if some
  older clients don't support these versions yet.

 [
    This is a merged patch from on the following commits
    on git://github.com/jamesyonan/openvpn.git

    03a5599202bdc3ba07983dc4efdae387fb8fb436
    d23005413b0e0f28a3c48a6342f494763d5c9b40
 ]

Signed-off-by: James Yonan <james@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
URL: http://thread.gmane.org/gmane.network.openvpn.devel/7743
URL: http://thread.gmane.org/gmane.network.openvpn.devel/7744
Message-Id: 51C77F12.1090802@openvpn.net
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoautoconf: Fix typo
David Sommerseth [Fri, 7 Jun 2013 10:15:30 +0000 (12:15 +0200)] 
autoconf: Fix typo

In config.h, it would state:

      /* Enable systemd support */
      #define ENABLE_PLUGIN 1

instead of

      /* Enable plug-in support */
      #define ENABLE_PLUGIN 1

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1370600130-6075-1-git-send-email-dazo@users.sourceforge.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7658
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoplugin: Extend the plug-in v3 API to identify the SSL implementation used
David Sommerseth [Wed, 3 Jul 2013 19:17:10 +0000 (21:17 +0200)] 
plugin: Extend the plug-in v3 API to identify the SSL implementation used

OpenVPN would segfault unexpectedly if it would be compiled against
PolarSSL
and the plug-in would expect OpenSSL, or vice-versa.  This segfault would
not appear before the plug-in would try to access functions which would
be available if the plug-in and OpenVPN uses the same SSL implementation.

This patch adds a member to the plug-in initialisation function, which
identifies the SSL implementation.

The log_v3 plug-in is updated accordingly + a simple fix to make it
buildable again using the ./build script.

A minor documentation error in the openvpn-plugin.h was also
corrected, where it mentioned OPENVPN_PLUGIN_VERSION instead of
OPENVPN_PLUGINv3_STRUCTVER.

 v2 - add const ovpnSSLAPI ssl_api at the end of
      struct openvpn_plugin_args_open_in and not in the "middle"

 v3 - fix bug in plug-in init, as the SSLAPI was located wrong in the
      args struct sent to the openvpn_plugin_open_v3() function.

 v4 - Ensure SSLAPI got a sane/known value if SSL is disabled or unknown

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1372879030-10576-1-git-send-email-dazo@users.sourceforge.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7754
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoRemove the --disable-eurephia configure option
David Sommerseth [Fri, 7 Jun 2013 10:15:23 +0000 (12:15 +0200)] 
Remove the --disable-eurephia configure option

This "feature" has been enabled since OpenVPN 2.2 without any reports that
this has been causing issues.  All it does is to add an extra environment
variable 'tls_digest_{n}' with the certificate SHA1 fingerprint/digest
hash.

Lets just simplify things by removing the possibility to disable this
environment variable.

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1370600123-6029-1-git-send-email-dazo@users.sourceforge.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7660
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoman page: Update man page about the tls_digest_{n} environment variable
David Sommerseth [Fri, 7 Jun 2013 10:15:11 +0000 (12:15 +0200)] 
man page: Update man page about the tls_digest_{n} environment variable

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1370600111-5983-1-git-send-email-dazo@users.sourceforge.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7659
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoAdd support of utun devices under Mac OS X
Arne Schwabe [Fri, 21 Jun 2013 10:48:28 +0000 (12:48 +0200)] 
Add support of utun devices under Mac OS X

Mac OS X 10.7+ natively supports tun devices (called utun). The "standard"
utun.ko driver is sometimes problematic (e.g. VmWare Fusion 5 and tun.ko
do not work together).

When OpenVPN is compiled with utun support it will if no dev-node is given
first try to use utun and if that is not available will try the
traditional tun devices

v2: Fixed tap support, get device name via ioctl, add manage
v3.1: Fix compiling without if/utun.h, fix manage errors
v4/v5: Don't try open to dynamically open utun0 -255 when early utun
initialization fails, fix fallback to tun, give fatal error message when
utun fails but no tun fallback should be done
v6: add commit message change log, replace strstr with strncmp, move
v7: Throw error if a user does the strange combination of --dev tun
--dev-type tap and --dev-node utun

A lot good input on earlier patches by Jonathan K. Bullard
<jkbullard@gmail.com>

Parts of the patches are inspired from Peter Sagerson's
<psagers@ignorare.net> utun patch
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Tested-by: Jonathan K. Bullard <jkbullard@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1371811708-8528-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7739
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoPATCHv3 Remove unused variables or put them to the defines they are being used in
Arne Schwabe [Mon, 15 Apr 2013 21:06:39 +0000 (23:06 +0200)] 
PATCHv3 Remove unused variables or put them to the defines they are being used in

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

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoImprove documentation and help text for --route-ipv6.
Gert Doering [Sat, 18 May 2013 10:43:01 +0000 (12:43 +0200)] 
Improve documentation and help text for --route-ipv6.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1368873781-29552-1-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/7598
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoAdd support for client-cert-not-required for PolarSSL.
Tamas TEVESZ [Sat, 8 Jun 2013 05:00:16 +0000 (07:00 +0200)] 
Add support for client-cert-not-required for PolarSSL.

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: alpine.GSO.2.03.1306080732510.23277@extreme.hu
URL: http://article.gmane.org/gmane.network.openvpn.devel/7667
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoDo not pass struct tls_session* as void* in key_state_ssl_init().
Steffan Karger [Sun, 19 May 2013 08:01:29 +0000 (10:01 +0200)] 
Do not pass struct tls_session* as void* in key_state_ssl_init().

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 51B1DBEF.1090705@fox-it.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/7664
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoFix another #ifdef/#if P2MP_SERVER
Arne Schwabe [Fri, 31 May 2013 15:26:32 +0000 (17:26 +0200)] 
Fix another #ifdef/#if P2MP_SERVER

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

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoMove checking of script file access into set_user_script
Arne Schwabe [Thu, 30 May 2013 21:02:17 +0000 (23:02 +0200)] 
Move checking of script file access into set_user_script

At the moment script are only checked if P2MP_SERVER is defined. For
CLIENT_ONLY openvpn script were never checked.
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1369947737-26081-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7635

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoMove settings of user script into set_user_script function
Arne Schwabe [Thu, 30 May 2013 20:26:43 +0000 (22:26 +0200)] 
Move settings of user script into set_user_script function

This also fixes commit 567bfc06d051b60e9cdca1f5bb468631b899682a if not all
script options are available by setting options->user_script_used
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1369945603-17169-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7634

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoFix #ifdefs for P2MP_SERVER
Arne Schwabe [Thu, 30 May 2013 21:34:40 +0000 (23:34 +0200)] 
Fix #ifdefs for P2MP_SERVER

(Fix check introduced by commit a8be73799be1639, testing with #ifdef
instead of #if - P2MP_SERVER is always defined, and can be "0" or "1")

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

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoProvide more accurate warning message
Davide Brini [Thu, 30 May 2013 14:20:55 +0000 (16:20 +0200)] 
Provide more accurate warning message

Very simple fix.

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <0LzcMG-1ULZ4T0Fuc-014gq9@mail.gmx.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7628

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoOnly print script warnings when a script is used. Remove stray mention of script...
Arne Schwabe [Thu, 30 May 2013 13:27:08 +0000 (15:27 +0200)] 
Only print script warnings when a script is used. Remove stray mention of script-security system.

Acked-by: Jan Just Keijser <janjust@nikhef.nl>
Message-Id: <1369920428-11350-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7625

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoFix problem with UDP tunneling due to mishandled pktinfo structures.
Gert Doering [Thu, 30 May 2013 11:31:24 +0000 (13:31 +0200)] 
Fix problem with UDP tunneling due to mishandled pktinfo structures.

In link_socket_write_udp_posix_sendmsg(), pktinfo structures for ipv4 and
ipv6 are going out of scope before actually calling sendmsg(), so depending
on compiler optimization, garbage is passed to sendmsg() - fix by using
"union openvpn_pktinfo" and having that in scope all the time.

Problem reported and patch provided by "danta" in trac#297

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
URL: https://community.openvpn.net/openvpn/ticket/297
Message-ID: <20130530184427.GP20843@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7629

12 years agoMake push-peer-info visible in "normal" per-instance environment.
Gert Doering [Sun, 5 May 2013 12:36:13 +0000 (14:36 +0200)] 
Make push-peer-info visible in "normal" per-instance environment.

Without this patch, peer-info pushed by clients in the TLS handshake
is only visible on the management interface, and only if
--management-client-auth is enabled.

With this patch, received records are sanitized and put into the normal
"multi instance" environment, where it can be evaluated by --client-connect
or --auth-user-pass-verify scripts and plugins, etc.  Only records matching
a fairly strict "name=value" format are accepted, and only names starting
with IV_ or UV_ are exported, to avoid clients sending funny stuff and
playing havoc with script/plugin environments on the server.  In the
"value" part, spaces, non-printable characters and shell metacharacters
are replaced by '_'.

The change is somewhat invasive as reception of the peer_info string was
only done when username+password are expected from the client, but the
data is always there (if the client sends no username/password, it will
send 0-length strings, so always extracting 3 strings is safe).  Also,
the sanitation function validate_peer_info_line() and the opts->peer_info
field were only compiled in #ifdef MANGEMENT_DEF_AUTH...

Patch v3: do not call the old man_output_peer_info_env() anymore, unless
a management env-filter has been set (= ensure IV_ and UV_ stuff is sent
at most *once*, and exactly the way OpenVPN AS expects it).  Add
substituting of "bad" characters in the environment values.

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

12 years agoAlways push basic set of peer info values to server.
James Yonan [Mon, 20 May 2013 10:13:21 +0000 (12:13 +0200)] 
Always push basic set of peer info values to server.

On the client, allow certain peer info fields to be pushed even if
push-peer-info isn't specified in the config.

This is needed to allow the compression handshake to work correctly
(i.e. where the client indicates its support for LZO and/or Snappy).

Fields that have privacy implications such as Mac Address and UV_*
environment variables will not be pushed to the server as before unless
push-peer-info is specified by client config.

v1: equivalent to OpenVPN SVN r8225 (2.1.21c)

v2: distinguish 3 levels of peer-info detail

  --push-peer-info specified --> send all we have
  --pull           specified --> send basic set, as per r8225
  default                    --> send nothing (do not leak from server)

v3: undo extra whitespace changes in v1 and v2

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

12 years agomake 'explicit-exit-notify' pullable again
Jan Just Keijser [Fri, 24 May 2013 12:36:32 +0000 (14:36 +0200)] 
make 'explicit-exit-notify' pullable again

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <519F5ED0.4070109@nikhef.nl>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7605

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoFix usage of 'compression ...' from global config.
Gert Doering [Fri, 19 Apr 2013 17:41:08 +0000 (19:41 +0200)] 
Fix usage of 'compression ...' from global config.

The new compression framework introduced by SVN r8206 only works for
a P2MP server if the compression settings are re-installed for each
client via management interface, ccd/ file or client-connect script,
but the "global" settings get lost due to (needlessly) clearing the
c2.comp_context in the per-client instance.  Fixed.  (also trac#273)

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

12 years agoAdded support for the Snappy compression algorithm
James Yonan [Tue, 18 Sep 2012 06:33:34 +0000 (08:33 +0200)] 
Added support for the Snappy compression algorithm

Added support for the Snappy compression algorithm which has shown to
have considerably better compression speed than LZO at a comparable
compression ratio.

To enable Snappy add:

  compress snappy

to both client and server config files.

Alternatively, enable compression framing on the client:

  compress

and have the server selectively push "compress snappy" to the client.

This change also extends the client capability handshake to include
IV_SNAPPY so the server can be aware that a connecting client supports
Snappy.

Note that the Snappy implementation also includes an improved framing
approach where the first byte of the compressed payload is replaced by
the compression control byte (the first payload byte is moved to the end
of the packet).  This solves off-by-one alignment issues, which improves
performance on ARM.

By default, the configure script will try to build with Snappy support.
To disable, use the --disable-snappy option.

The --enable-lzo-stub configure directive is now --enable-comp-stub
(because it's not actually "lzo" but "compression-enabled packet framing")

Add compression overhead to extra buffer unconditionally, as long
as USE_COMP is defined.

OpenVPN SVN r8206 (2.1.21a) and r8212 (2.1.21b)

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1366393268-27392-3-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7531
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoFix Windows script execution when called from script hooks
Josh Cepek [Thu, 16 May 2013 14:09:23 +0000 (09:09 -0500)] 
Fix Windows script execution when called from script hooks

Console applications under Windows, such as batch scripts, require the
CREATE_NO_WINDOW process flag when run without an actual console window
present. This change allows such scripts to execute and impact the hook
status by way of their return code.

Fixes bug #240.

Signed-off-by: Josh Cepek <josh.cepek@usa.net>
Acked-by: Heiko Hund <heiko.hund@sophos.com>
Message-Id: <kn2pao$5sv$1@ger.gmane.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7594
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoFix NULL-pointer crash in route_list_add_vpn_gateway().
Gert Doering [Fri, 3 May 2013 19:13:24 +0000 (21:13 +0200)] 
Fix NULL-pointer crash in route_list_add_vpn_gateway().

Add ASSERT() check to route_list_add_vpn_gateway() to ensure that *rl
is valid (and if not, crash with a somewhat more meaningful message than
"segmentation violation").  For the actual bugfix, change init code to
always allocate a "struct route_list" for IPv4, even if no --route options
have been seen in the config.

Fix trac#281 and trac#258.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Josh Cepek <josh.cepek@usa.net>
Message-Id: <1367608404-2257-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7581

12 years agoUse constrain_int() instead of MIN()+syshead.c compat definition - v2.
Gert Doering [Mon, 6 May 2013 07:55:41 +0000 (09:55 +0200)] 
Use constrain_int() instead of MIN()+syshead.c compat definition - v2.

Reverts commit 15ca5c297b556fbb, instead change ssl_openssl.c to use
"constrain_int()", which already exists in "integer.h".

Using this instead of min_int() ensures that the result is always bounded
to 0...256 even in the case of a potential MAX_INT overflow.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1367826941-22412-1-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/7586
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoFix segfault when enabling pf plug-ins
svimik [Thu, 29 Sep 2011 11:41:34 +0000 (13:41 +0200)] 
Fix segfault when enabling pf plug-ins

This fixes an issue where a segfault happens in pf_cn_test() if no
packet filtering rules have been parsed.  See the trac ticket for
more details.

Trac: 163
Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: David Sommerseth <davids@redhat.com>
12 years agoFix proto tcp6 for server & non-P2MP modes
Josh Cepek [Thu, 2 May 2013 21:17:37 +0000 (16:17 -0500)] 
Fix proto tcp6 for server & non-P2MP modes

This fix adds support for using tcp6 as a proto in server or non-P2MP
modes, resolving a failed ASSERT in such cases.

Fixes the crash in trac#288.

Signed-off-by: Josh Cepek <josh.cepek@usa.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <klul5d$8ta$1@ger.gmane.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7578
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoDocument the Android implementation in OpenVPN
Arne Schwabe [Tue, 30 Apr 2013 20:33:17 +0000 (22:33 +0200)] 
Document the Android implementation in OpenVPN

Also fix a minor mistake in the manpage.

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

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoEmulate persist-tun on Android
Arne Schwabe [Fri, 26 Apr 2013 19:59:32 +0000 (21:59 +0200)] 
Emulate persist-tun on Android

On Android changing the configuration of tun is not possible. So instead
of reconfiguring the tun device, open a new tun device and close the old
one if needed.

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

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoAndroid platform specific changes.
Arne Schwabe [Tue, 30 Apr 2013 19:29:11 +0000 (21:29 +0200)] 
Android platform specific changes.

On Android 4.0 (TARGET_ANDROID) the real opening of the tun is handled by
the (Java) application controlling OpenVPN. Instead of calling
ifconfig/route call the management to do the work. When running openvpn as
root openvpn should be compiled as TARGET_LINUX

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1367350151-23089-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7570
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoAdd ability to send/receive file descriptors via management interface
Arne Schwabe [Fri, 26 Apr 2013 19:54:04 +0000 (21:54 +0200)] 
Add ability to send/receive file descriptors via management interface

Used for communicating with the Java side on Android to send
to-be-protected socket fd, and to receive tun fd.

For now under #ifdef ANDROID

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

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoAllow routes to be set before opening tun, similar to ifconfig before opening tun
Arne Schwabe [Sun, 28 Apr 2013 14:32:39 +0000 (16:32 +0200)] 
Allow routes to be set before opening tun, similar to ifconfig before opening tun

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

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoImprove the git revision tracking
David Sommerseth [Fri, 19 Apr 2013 11:21:54 +0000 (13:21 +0200)] 
Improve the git revision tracking

This removes the single 'git revision' line from the --version screen and
moves this information on the top, together with the OpenVPN version.

In addition this patch adds two git flags after the git committish.  If
there exists changed but unstaged files when the build was done, a '+' is
appended after the committish.  If there exists staged files (files which
have been added with 'git add') a '*' will be appended.  These flags are
not exclusive.

This also simplifies the config-version.h generation by not using
sed parsing a template.  It's just two lines which are generated, so
no need to complicate things more than needed.

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

12 years agoFixed usage of stale define USE_SSL to ENABLE_SSL
Steffan Karger [Mon, 15 Apr 2013 08:45:28 +0000 (10:45 +0200)] 
Fixed usage of stale define USE_SSL to ENABLE_SSL

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <516BCEA2.6000608@fox-it.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7509
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoPrint "Virtual IPv6 Address" on management interface queries [v4]
Gert Doering [Wed, 10 Apr 2013 18:55:37 +0000 (20:55 +0200)] 
Print "Virtual IPv6 Address" on management interface queries [v4]

Add extra column to management queries for "status 2" or "status 3"
after "Virtual Address", empty if no IPv6 address assigned to this
client (or IPv6 not active at all).

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

12 years agoPrint client id only if compiled with man agent support. Otherwise
Arne Schwabe [Thu, 11 Apr 2013 13:34:38 +0000 (15:34 +0200)] 
Print client id only if compiled with man agent support. Otherwise
print an empty string.

Also use %lu instead of %u for printing unsigned long int

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

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoAdd the client id (CID) to the output of the status command
Arne Schwabe [Fri, 31 Aug 2012 14:19:13 +0000 (16:19 +0200)] 
Add the client id (CID) to the output of the status command

This add adds CID which is needed by a few other management commands to
the status output. This will change the output of status in the same way
commit ca18a638aa7cf316611f893127ba44131e57083c did.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1346422753-19520-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7021
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoFixed tls-cipher translation bug in openssl-build
Steffan Karger [Thu, 4 Apr 2013 19:53:07 +0000 (21:53 +0200)] 
Fixed tls-cipher translation bug in openssl-build

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1CED409804E2164C8104F9E623B08B9013BC28A538@FOXDFT02.FOX.local>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7480
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoFix directly connected routes for "topology subnet" on Solaris.
Gert Doering [Tue, 26 Mar 2013 16:09:35 +0000 (17:09 +0100)] 
Fix directly connected routes for "topology subnet" on Solaris.

This basically brings back the previously-working metric setting for
directly connected routes (add a "0" to the "route add" command) on
Solaris/OpenSolaris.  It was working in f0eac1a59790, and got broken
by the route.c/route.h refactoring in 576dc96ca1ef1 - the patch
un-does that change to the TARGET_SOLARIS code, plus adds some more
descriptive comments.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Josh Cepek <josh.cepek@usa.net>
Message-Id: <1364314175-20758-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7460

12 years agoAdd MIN() compatibility macro
Gert Doering [Sat, 23 Mar 2013 09:28:48 +0000 (10:28 +0100)] 
Add MIN() compatibility macro

commit 3b23b18dddb8f8f4a introduced usage of MIN(), and not all platforms
have the macro in "readily usable" system header files, most notably it's
missing on OpenSolaris and Android.  Add macro if not defined yet.

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

12 years agoUse constant time memcmp when comparing HMACs in openvpn_decrypt.
Steffan Karger [Tue, 19 Mar 2013 12:01:50 +0000 (13:01 +0100)] 
Use constant time memcmp when comparing HMACs in openvpn_decrypt.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoFixed autoconf script to properly detect missing pkcs11 with polarssl.
Steffan Karger [Fri, 22 Mar 2013 08:54:25 +0000 (09:54 +0100)] 
Fixed autoconf script to properly detect missing pkcs11 with polarssl.

When polarssl is compiled without pkcs11 support, or a required
pkcs11-helper library is missing, configure will now issue an error.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1363942465-3251-7-git-send-email-steffan.karger@fox-it.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7441
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoSwitch to IANA names for TLS ciphers.
Steffan Karger [Fri, 22 Mar 2013 08:54:24 +0000 (09:54 +0100)] 
Switch to IANA names for TLS ciphers.

Added translation table and functions to translate between TLS OpenSSL
and IANA (IETF) cipher suite names. The previously used OpenSSL names
are still accepted, but a deprecation warning is issued.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1363942465-3251-6-git-send-email-steffan.karger@fox-it.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7439
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoConfig compatibility patch. Added translate_cipher_name.
Steffan Karger [Fri, 22 Mar 2013 08:54:23 +0000 (09:54 +0100)] 
Config compatibility patch. Added translate_cipher_name.

Added translate_cipher name to crypto_openssl.c and crypto_polarssl.c
to translate between OpenVPN(/OpenSSL) and PolarSSL data channel
cipher algorithm names. OpenSSL does not require any translating,
PolarSSL does for a small number of algorithms. This improves on
config file compatibility between the OpenSSL and PolarSSL builds.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1363942465-3251-5-git-send-email-steffan.karger@fox-it.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7435
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoImprove verify_callback messages
Steffan Karger [Fri, 22 Mar 2013 08:54:22 +0000 (09:54 +0100)] 
Improve verify_callback messages

Print the *flags argument, which - for PolarSSL-1.2 - contains the reasons
that the certificate failed (pre-)verification.

Signed-off-by: Joachim Schipper <joachim.schipper@fox-it.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1363942465-3251-4-git-send-email-steffan.karger@fox-it.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7437
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoImprove PolarSSL key_state_read_{cipher, plain}text messages
Steffan Karger [Fri, 22 Mar 2013 08:54:21 +0000 (09:54 +0100)] 
Improve PolarSSL key_state_read_{cipher, plain}text messages

Instead of logging the fact that an error occured, log the error code and
description (when available in the PolarSSL build).

Signed-off-by: Joachim Schipper <joachim.schipper@fox-it.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1363942465-3251-3-git-send-email-steffan.karger@fox-it.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7440
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoPolarSSL-1.2 support
Steffan Karger [Fri, 22 Mar 2013 08:54:20 +0000 (09:54 +0100)] 
PolarSSL-1.2 support

Add support for PolarSSL-1.2, which has changed the API in several places.
This is a minimal port, new features have not been enabled. Only PolarSSL
1.2.5 and newer are accepted, as earlier versions contain unresolved
(security) issues.

Signed-off-by: Joachim Schipper <joachim.schipper@fox-it.com>
Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Message-Id: <1363942465-3251-2-git-send-email-steffan.karger@fox-it.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7436
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years ago(updated) [PATCH] Warn when using verb levels >=7 without debug
Josh Cepek [Wed, 20 Mar 2013 18:22:25 +0000 (13:22 -0500)] 
(updated) [PATCH] Warn when using verb levels >=7 without debug

On 3/20/2013 11:42, Arne Schwabe wrote:

> ACK. But I would change "debug verb" to "debug verbosity" and I think
> there should be no comma before "but"

This text change makes sense: I've adjusted it to read "NOTE: debug
verbosity..." and saved another byte removing the comma.

Updated patch attached.

--
Josh

>From d41a0237220f2fea6647a508a2ab07263e0f160b Mon Sep 17 00:00:00 2001
From: Josh Cepek <josh.cepek@usa.net>
Date: Tue, 19 Mar 2013 22:52:12 -0500
Subject: [PATCH] Warn when using verb levels >=7 without debug

This patch adds a log warning when using --verb levels at 7 or higher
when running on builds lacking debug support. Since official builds are
now built with enable_debug=no, this warning will help developers
identify why expected debug messages may not be present in log output.

The test and message output code is omitted when built with
enable_debug=yes or enable_small=yes.

Signed-off-by: Josh Cepek <josh.cepek@usa.net>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <kicup2$gfv$1@ger.gmane.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7425
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoFix parameter listing in non-debug builds at verb 4
Josh Cepek [Thu, 21 Feb 2013 15:50:38 +0000 (09:50 -0600)] 
Fix parameter listing in non-debug builds at verb 4

When built with enable_debug=no, the parameter output expected at --verb
4 is not printed due to use of #ifdef ENABLE_DEBUG in the responsible
code sections. This appears to be a mistake when looking at the
configure help text for enable_small and enable_debug.

This change keys the relevant code off of enable_small instead,
including the parameter listing when enale_small=no (the
configure-script default.) Most of this code is in options.c, with some
callers present in plugin.c/h and route.c/h. No function code is
changed, just the #ifdef values to use the small feature instead of
debug.

This means builds no longer need enable_debug=yes in order to get the
expected log output at verb 4.

Signed-off-by: Josh Cepek <josh.cepek@usa.net>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <437RBuq1U8032S07.1361465626@web07.cms.usa.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7361
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoPermit pool size of /64.../112 for ifconfig-ipv6-pool
Gert Doering [Sun, 20 Jan 2013 18:50:38 +0000 (20:50 +0200)] 
Permit pool size of /64.../112 for ifconfig-ipv6-pool

(Leftover check from the early days where --server-ipv6 also only
accepted /64 - nowadays we handle smaller pools just fine)

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

12 years agoRepair "tcp server queue overflow" brokenness, more <stdbool.h> fallout.
Gert Doering [Mon, 11 Mar 2013 20:03:20 +0000 (21:03 +0100)] 
Repair "tcp server queue overflow" brokenness, more <stdbool.h> fallout.

Return value of mbuf_len() wrong - it's returning a length value, not
a yes/no value - so when the queue length approached 65 (full!), it
still only returned "1", leading to MBUF overflow later on.  Change
from "bool" to "unsigned int", misbehaviour gone...

This fixes OpenVPN trac ticket #263.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Peter Caprioli <petercap@kth.se>
Message-Id: <20130312100706.GN953@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7396
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoRemove unused function no_tap_ifconfig
Arne Schwabe [Mon, 11 Mar 2013 20:10:51 +0000 (21:10 +0100)] 
Remove unused function no_tap_ifconfig

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1363032651-23934-4-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7388
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoMove static prototype definition from header into c file
Arne Schwabe [Mon, 11 Mar 2013 20:10:50 +0000 (21:10 +0100)] 
Move static prototype definition from header into c file

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1363032651-23934-3-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7389

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoRemove unused function xor
Arne Schwabe [Mon, 11 Mar 2013 20:10:48 +0000 (21:10 +0100)] 
Remove unused function xor

The function name xor is also a reserved keyword in C++

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1363032651-23934-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7390
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoadd new option for X.509 name verification
Heiko Hund [Thu, 7 Mar 2013 15:36:41 +0000 (16:36 +0100)] 
add new option for X.509 name verification

Add the option --verify-x509-name to provide the functionality
of the now deprecated --tls-remote.

The new option accepts RFC 2253 subject DNs only and compares
RDN or RDN prefix only if configured explicitly.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: 1362670601-18660-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/7376
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agomake --tls-remote compatible with pre 2.3 configs
Heiko Hund [Fri, 22 Feb 2013 09:44:21 +0000 (10:44 +0100)] 
make --tls-remote compatible with pre 2.3 configs

In openvpn 2.3.0 the semantics of the --tls-remote option changed.
That broke more configurations than anticipated. To not break
configurations that use --tls-remote with a legacy OpenSSL style DN
anymore, it is now detected when such a DN is configured. When
necessary the --compat-names option is then automatically enabled.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: 1361526263-1740-3-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/7366
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoreintroduce --no-name-remapping option
Heiko Hund [Fri, 22 Feb 2013 09:44:20 +0000 (10:44 +0100)] 
reintroduce --no-name-remapping option

The option is just an alias for --compat-names no-remapping and is
introduced so pre-2.3 server configurations don't break.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: 1361526263-1740-2-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/7364
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoFix corner case in NTLM authentication (trac #172)
Christian Niessner [Thu, 7 Mar 2013 18:37:58 +0000 (19:37 +0100)] 
Fix corner case in NTLM authentication (trac #172)

The problem is located in the file proxy.c within
"establish_http_proxy_passthru": To keep buffers small long
base64-encoded NTLM-Strings are truncated.

But the truncating is done on a wrong place: base 64 strings can be
cut every 4 chars. the buffer is 128 bytes - including the terminating
\0, so the usable data is only 127 bytes. And decoding a 127 char
base64 string fails... this is why the ntlm authentication fails in
certain cases (long strings)...

Acked-by: Joerg Willmann <joe@clnt.de>
URL: https://community.openvpn.net/openvpn/ticket/172

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agofix build with automake 1.13(.1)
Christian Hesse [Tue, 8 Jan 2013 08:39:12 +0000 (09:39 +0100)] 
fix build with automake 1.13(.1)

AM_CONFIG_HEADER has been deprecated for some time, finally it is removed
on automake 1.13. The attached patch replaces it with AC_CONFIG_HEADERS and
fixes build process with latest automake.

Acked-by: Matthias Andree <matthias.andree@gmx.de>
Message-Id: 20130108093912.7ae7c6f8@leda
URL: http://article.gmane.org/gmane.network.openvpn.devel/7222

Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoIgnore UTF-8 byte order mark
Heiko Hund [Mon, 4 Feb 2013 11:39:25 +0000 (11:39 +0000)] 
Ignore UTF-8 byte order mark

Currently openvpn exits when reading configuration from a file
that has an UTF-8 byte order mark (EF BB BF) at its start.

While it is useless to put a BOM into UTF-8 encoded files, the
Unicode standard [1] permits it (on page 36):

  "Use of a BOM is neither required nor recommended for UTF-8,
  but may be encountered in contexts where UTF-8 data is converted
  from other encoding forms that use a BOM or where the BOM is
  used as a UTF-8 signature."

Notepad.exe, the default text editor on Windows, always puts the BOM
into UTF-8 encoded files when saving them. Others may do as well.

Just ignoring the UTF-8 BOM will make config files with UTF-8 BOM
readable.

[1] http://www.unicode.org/versions/Unicode5.0.0/ch02.pdf

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1359977966-31724-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/7342
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoCleaned up and updated INSTALL
Samuli Seppänen [Fri, 25 Jan 2013 09:59:34 +0000 (11:59 +0200)] 
Cleaned up and updated INSTALL

- Changed "Supported platforms" to reflect current support status of the
  mentioned operatingsystems
- Removed mentions of the obsolete Python and domake-win buildsystems
- Added mention of official Debian/RPM packages
- Added links to the Wiki
- Added mention of the new openvpn-build cross-compile environment
- Added PolarSSL to and removed pthreads from the "Optional" section
- Added mention of t_client.sh test framework
- Removed some very old (pre-2005) nuggets of (obsolete) information
- Other minor cleanups
- Some reorganization

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1359107974-1481-1-git-send-email-samuli@openvpn.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/7303
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoUpdated README
Samuli Seppänen [Fri, 25 Jan 2013 08:12:19 +0000 (10:12 +0200)] 
Updated README

Added links to easy-rsa, tap-windows and openvpn-build and fixes some paths

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1359101540-976-4-git-send-email-samuli@openvpn.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/7296
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoAdded cross-compilation information INSTALL-win32.txt
Samuli Seppänen [Fri, 25 Jan 2013 08:12:18 +0000 (10:12 +0200)] 
Added cross-compilation information INSTALL-win32.txt

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1359101540-976-3-git-send-email-samuli@openvpn.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/7295
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoRemoved ChangeLog.IPv6
Samuli Seppänen [Fri, 25 Jan 2013 08:12:17 +0000 (10:12 +0200)] 
Removed ChangeLog.IPv6

Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1359101540-976-2-git-send-email-samuli@openvpn.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/7297
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoEnable TCP_NODELAY configuration on FreeBSD.
Matthias Andree [Sat, 12 Jan 2013 12:41:17 +0000 (13:41 +0100)] 
Enable TCP_NODELAY configuration on FreeBSD.

The missing #include <netinet/tcp.h> causes a defined(TCP_NODELAY) to
fail.  I have added the patch to the FreeBSD ports OpenVPN 2.2.2 and
2.3.0, and confirmed (with strings ... | grep) that the TCP_NODELAY code
is now part of the executable on amd64, and results in this log output:

Sat Jan 12 13:39:18 2013 Listening for incoming TCP connection on [undef]
Sat Jan 12 13:39:18 2013 Socket flags: TCP_NODELAY=1 succeeded

Obtained from: https://community.openvpn.net/openvpn/ticket/158
Credits to: M. Nottebrock

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1357994477-29981-1-git-send-email-matthias.andree@gmx.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/7230
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoman page patch for missing options
Jan Just Keijser [Sun, 3 Feb 2013 12:47:01 +0000 (13:47 +0100)] 
man page patch for missing options

man page patch to include the options that were made connection-entry
specific in 2.3.0

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-ID: 510E4344.6010608@nikhef.nl
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoRemove dead code path and putenv functionality
Arne Schwabe [Sun, 3 Feb 2013 11:12:31 +0000 (12:12 +0100)] 
Remove dead code path and putenv functionality

The construct_name_value function call will always fail so this code path
is never used. Since we now always have a valid environment in
static_context->c2.es it is better to have a ASSERT(es) than to call this
code patch.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1359889951-3369-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/7323
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoUpdate README.IPv6 to match what is in 2.3.0
Gert Doering [Fri, 25 Jan 2013 11:39:14 +0000 (12:39 +0100)] 
Update README.IPv6 to match what is in 2.3.0

IPv6 is no longer provided by external patches - all has been
integrated.  Document that fact, point at the new configuration options,
and at potential caveats.

Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1359113954-25768-1-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/7305
Signed-off-by: Gert Doering <gert@greenie.muc.de>
12 years agoclose more file descriptors on exec
Heiko Hund [Fri, 1 Feb 2013 14:19:14 +0000 (15:19 +0100)] 
close more file descriptors on exec

Don't inherit the --status and --ifconfig-pool-persist, and on Linux
the epoll(7), file descriptors to scripts and other processes that
may be forked by plugins.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1359728354-9405-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/7312
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoFix client crash on double PUSH_REPLY.
Gert Doering [Tue, 25 Dec 2012 12:41:50 +0000 (13:41 +0100)] 
Fix client crash on double PUSH_REPLY.

Introduce an extra bool variable c2.pulled_options_md5_init_done to
keep track of md5_init state of pulled_options_state - avoid accessing
uninitialized state when a second PUSH_REPLY comes in (which only happens
under very particular circumstances).

Bug tracked down by Arne Schwabe <arne@rfc2549.rrg>.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: 20121225124856.GT22465@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/7216
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoFix parameter type for IP_TOS setsockopt on non-Linux systems.
Gert Doering [Wed, 19 Dec 2012 21:12:41 +0000 (22:12 +0100)] 
Fix parameter type for IP_TOS setsockopt on non-Linux systems.

Linux uses uint8_t, all BSD based stacks and Solaris use "int"  (Windows
documentation says "DWORD" and "do not use, use QoS API instead").

Bug reported and fix provided by Torsten Vielhak and Jeremie Le Hen.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 20121219212619.GN22465@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/7207
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoFix option inconsistency warnings about "proto" and "tun-ipv6"
Gert Doering [Sun, 16 Dec 2012 21:15:20 +0000 (22:15 +0100)] 
Fix option inconsistency warnings about "proto" and "tun-ipv6"

"tun-ipv6" is only sent in option string if running in point-to-point
mode (= not --server and not --client or --pull), because in those
scenarios it's usually pushed by the server, and the client does not
yet have it when comparing options -> needless warning.

Completely ignore "proto" values when comparing option strings - this
is in preparation for removing proto from the option string in a future
release, and to avoid warnings when 2.3 talks to this future release.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1355692520-24362-1-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/7194
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoImplement --mssfix handling for IPv6 packets.
Gert Doering [Sun, 2 Dec 2012 21:11:12 +0000 (22:11 +0100)] 
Implement --mssfix handling for IPv6 packets.

Rename process_ipv4_header() to process_ip_header() and PIPV4_MSSFIX
flag to PIP_MSSFIX, to make visible that it's no longer IPv4-only.

Inside process_ip_header(), call out to mss_fixup_ipv6() if --mssfix
is active and IPv6 packet seen.

Rename mss_fixup() to mss_fixup_ipv4(), implement mss_fixup_ipv6().

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: 1354482672-16136-2-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/7173
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoFix the proto is used inconsistently warning
Arne Schwabe [Tue, 4 Dec 2012 19:42:54 +0000 (20:42 +0100)] 
Fix the proto is used inconsistently warning

Fix the "WARNING: 'proto' is used inconsistently, local='proto UDP',
remote='proto UDPv6'." message.

Note that the on wire strings are now always TCPv4 and UDPv4 to be
compatible to pre2.3

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1354650174-25601-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/7175
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoRemove dnsflags_to_socktype, it is not used anywhere
Arne Schwabe [Fri, 30 Nov 2012 19:17:47 +0000 (20:17 +0100)] 
Remove dnsflags_to_socktype, it is not used anywhere

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1354303076-13606-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/7160
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoThe get_default_gateway() function uses warn() instead of msg()
David Sommerseth [Thu, 29 Nov 2012 13:16:12 +0000 (14:16 +0100)] 
The get_default_gateway() function uses warn() instead of msg()

A report on #openvpn pointed out that in his setup three warnings
appeard on the console when starting up.

    $ sudo /usr/local/etc/rc.d/openvpn restart
    Stopping openvpn.
    Waiting for PIDS: 33031.
    Starting openvpn.
    openvpn: writing to routing socket: No such process
    openvpn: writing to routing socket: No such process
    openvpn: writing to routing socket: No such process
    $

This setup is on FreeBSD using jails with strict access to the
routing table.

After looking at the code path, this error was found in the BSD
sections for get_default_gateway().  But it was using the warn()
call instead of msg(M_WARN|M_ERRNO, ...) which causes these
warnings to go to stderr instead of the log file.

The warning string is also slightly modified to better explain
what fails.

Reported-by: Thomas Steen Rasmussen <thomas@gibfest.dk>
Tested-by: Thomas Steen Rasmussen <thomas@gibfest.dk>
Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1354194972-5388-1-git-send-email-dazo@users.sourceforge.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/7149

12 years agoAvoid recursion in virtual_output_callback_func()
David Sommerseth [Fri, 16 Nov 2012 11:02:06 +0000 (12:02 +0100)] 
Avoid recursion in virtual_output_callback_func()

This solves a SEGV situation when using the management API while OpenVPN
is closing down.

The situation happens when the management socket has closed and OpenVPN
tries to write an error about this to the management socket.  What happens
is that

 virtual_output_callback_func() is called, which then calls
 -> man_output_list_push_finalize()
    -> man_output_standalone()
       -> man_write()  <-- this does the socket write
          -> man_io_error()
             -> x_msg()
                -> virtual_output_print()
                   -> virtual_output_callback_func() (recursion start)

virtual_output_callback_func() do have a mechanism to avoid recursion,
but that did not keep the recurse counter when
man_output_list_push_finalize()
is called.

This patch just reorganise the recursion block to also keep the counter
while
calling the other functions from virtual_output_callback_func()

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

12 years agoProperly require --key even if defined(MANAGMENT_EXTERNAL_KEY)
Arne Schwabe [Mon, 26 Nov 2012 14:33:09 +0000 (15:33 +0100)] 
Properly require --key even if defined(MANAGMENT_EXTERNAL_KEY)

When specifying --tls-client --cert ... without a --key (or --pkcs11)
option, OpenVPN should complain:
"You must define private key file (--key)...".  Ensure that this
works even when compiling with MANAGMENT_EXTERNAL_KEY.

Also fix the other instance where this logic is broken

Orginal-Patch-by: Found by Joachim Schipper <joachim.schipper@fox-it.com>
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1353940389-31075-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/7143
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoFix typo in ./configure message
Joachim Schipper [Mon, 26 Nov 2012 14:32:21 +0000 (15:32 +0100)] 
Fix typo in ./configure message

Signed-off-by: Joachim Schipper <joachim.schipper@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1CED409804E2164C8104F9E623B08B901323D0B186@FOXDFT02.FOX.local
URL: http://article.gmane.org/gmane.network.openvpn.devel/7142
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agodoc/management-notes.txt: fix typo
Joachim Schipper [Mon, 26 Nov 2012 14:31:45 +0000 (15:31 +0100)] 
doc/management-notes.txt: fix typo

Signed-off-by: Joachim Schipper <joachim.schipper@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1CED409804E2164C8104F9E623B08B901323D0B184@FOXDFT02.FOX.local
URL: http://article.gmane.org/gmane.network.openvpn.devel/7141
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoError message if max-routes used incorrectly
Arne Schwabe [Mon, 19 Nov 2012 18:12:17 +0000 (19:12 +0100)] 
Error message if max-routes used incorrectly

the route/route-ipv6/redirect-gateway options allocate the route structe
with max_routes number of routes. A max-routes after any of this commands
has no effect. This can be problematic
(http://code.google.com/p/ics-openvpn/issues/detail?id=101)

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1353348737-21920-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/7131
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoFix --show-pkcs11-ids (Bug #239)
Adriaan de Jong [Wed, 14 Nov 2012 09:03:12 +0000 (10:03 +0100)] 
Fix --show-pkcs11-ids (Bug #239)

Broken by 00b973f8af85c3ea8fa3cef80eec55e8dc139b27

Signed-off-by: Joachim Schipper <joachim.schipper@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Trac-ticket: 239
Message-Id: 1CED409804E2164C8104F9E623B08B901323A48384@FOXDFT02.FOX.local
URL: http://article.gmane.org/gmane.network.openvpn.devel/7129
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoReset the version.m4 version for the master branch
David Sommerseth [Fri, 16 Nov 2012 15:12:35 +0000 (16:12 +0100)] 
Reset the version.m4 version for the master branch

Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoFix double-free issue in pf_destroy_context()
David Sommerseth [Tue, 6 Nov 2012 09:59:01 +0000 (10:59 +0100)] 
Fix double-free issue in pf_destroy_context()

In commit dc7be6d078ba106f9b0de12f3e879c3561c3c537 the string_alloc() call
in pf_init_context() was modified to use the gc_arena object for memory
allocation.  What was not taken into consideration was that
pf_destroy_context() was also freeing memory allocated by string_alloc(),
and when pf_init_context() is calling gc_free() a double-free situation
showed up.

Lets remove the explict free, and let gc_free take care of all the memory
handling.

Reported-by: cuzz@163.com
Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1352196216-11560-1-git-send-email-dazo@users.sourceforge.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/7124

12 years agoRemove the support for using system() when executing external programs or scripts
David Sommerseth [Thu, 25 Oct 2012 12:22:30 +0000 (14:22 +0200)] 
Remove the support for using system() when executing external programs or scripts

This patch removes the support for the system() call, and enforces the
usage of execve() on the *nix platform and CreateProcessW() on Windows.
This is to enhance the overall security when calling external scripts.
Using system() is prone to shell expansions, which may lead to security
breaches.  Which is also why the execve() approach has been the default
since commit a82813527551f0e79c6d6ed5a9c1162e3c171bcf which
re-introduced the system() in Nov. 2008.

After having asked on the mailing list and checked around on the IRC
channels, the genereal consensus is that very few uses system() these
days.

The only annoyance I've been made aware of is that this will now
require adding a full path to the script interpreter together with the
script, and not just put in the script name alone.  But to just use the
script name in Windows, you had to configure --script-security with the
'system' flag earlier too.  So my conclusion is that it's better to add
a full path to the script interpreter in Windows and raise the overal
security with OpenVPN, than to continue to have a possible potentially
risky OpenVPN configuration just to make life "easier" for Windows
script users.

Removal of the system() call, also solves a nasty bug related to the
usage of putenv() on the *nix platforms.

For more information please see:
http://thread.gmane.org/gmane.network.openvpn.devel/7090
https://community.openvpn.net/openvpn/ticket/228

Trac-ticket: 228
Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1351539352-17371-1-git-send-email-dazo@users.sourceforge.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7114

12 years agoSupport UTF-8 --client-config-dir
Heiko Hund [Mon, 29 Oct 2012 13:16:37 +0000 (14:16 +0100)] 
Support UTF-8 --client-config-dir

If a common name (or user name, when used in conjunction with
--username-as-common-name) contains UTF-8 encoded characters their
octets get replaced by underscores. This becomes problematic when
user "Müller" and "Möller" need to have a CCD file and both would
receive options from the file "M__ller". The situation is even
worse for non-latin alphabets, where CCD file names consist of
underscores entirely.

This patch removes that limitation and also allows the file names
to contain any punctuation characters besided the resevered ones.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1351516597-11128-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/7110
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoFix display of plugin hook types
Heiko Hund [Mon, 29 Oct 2012 13:38:30 +0000 (14:38 +0100)] 
Fix display of plugin hook types

The OPENVPN_PLUGIN_ROUTE_PREDOWN hook was missing and displayed as
"PLUGIN_???" in the log.

OPENVPN_PLUGIN_ENABLE_PF was the only one that displayed the
OPENVPN_ prefix.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1351517910-11414-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/7111
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoMake git ignore some more files
David Sommerseth [Wed, 17 Oct 2012 17:41:43 +0000 (19:41 +0200)] 
Make git ignore some more files

Don't care about ./libtool (autogenerated) and test reports from t_client.sh

Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoOptions parsing demands unnecessary configuration if PKCS11 is used
Arne Schwabe [Wed, 17 Oct 2012 10:46:14 +0000 (12:46 +0200)] 
Options parsing demands unnecessary configuration if PKCS11 is used

In the old patch the if incorrectly closed the outer if condition.
(closes ticket #231)

Trac-ticket: 231
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1350470774-12511-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/7095
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoFixed a bug where PolarSSL gave an error when using an inline file tag.
Adriaan de Jong [Wed, 17 Oct 2012 09:39:25 +0000 (11:39 +0200)] 
Fixed a bug where PolarSSL gave an error when using an inline file tag.

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1350466765-23301-1-git-send-email-dejong@fox-it.com
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoFix v3 plugins to support returning values back to OpenVPN.
Kenneth Rose [Mon, 1 Oct 2012 18:47:02 +0000 (14:47 -0400)] 
Fix v3 plugins to support returning values back to OpenVPN.

There's a small implementation issue with the V3 plugin API
implementation.  V3 plugins cannot return data back to OpenVPN using
openvpn_plugin_args_func_return since
openvpn_plugin_args_func_return.return_list is always NULL.

This patch makes the behaviour identical to the V2 API (return_list is
again a proper out parameter).

Signed-off-by: Kenneth Rose <ken+openvpn@surfeasy.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: CAAUdgR8VZjaO0-thFPVoQkbZ1DNG3rx+gtYYLqyfocp3yns==w@mail.gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/7083
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoDocument man agent-external-key
Arne Schwabe [Mon, 1 Oct 2012 09:05:18 +0000 (11:05 +0200)] 
Document man agent-external-key

Adapt commit message from cf69617bbea45a15423c4188daa9386debcbe1ec for man
page and management documentation.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1349082318-985-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/7081
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoPreparing for v2.3_beta1 v2.3_beta1
David Sommerseth [Wed, 12 Sep 2012 14:12:28 +0000 (16:12 +0200)] 
Preparing for v2.3_beta1

Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoAdd --compat-names option
Heiko Hund [Tue, 11 Sep 2012 15:34:24 +0000 (17:34 +0200)] 
Add --compat-names option

With this option, users can basically undo the changes of the UTF-8
support commit 5e86fd93779482b90a191f929edebe414cd78a4f. It's here for
short term compatibility and should be removed again as soon as possible.

When OpenSSL is used, the subject strings will be in the proprietary
format again. Generally username, X.509 CN, and X.509 subject will again
be subject to '_' replacemant, unless the "no-remapping" flag is
also specified. That flag ensures compatibility with setups using the
--no-name-remapping option, that has been removed in 2.3.

[v2: More comments related to compat_flags() added by DS plus using
     COMPAT_FLAG_QUERY expclit]
[v3: Improved the man page entry for --compat-names, after suggestions
     from Bernhard R. Link]

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1347377664-15462-1-git-send-email-dazo@users.sourceforge.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/7053

12 years agoFix reconnect issues when --push and UDP is used on the server
David Sommerseth [Sun, 9 Sep 2012 01:30:46 +0000 (03:30 +0200)] 
Fix reconnect issues when --push and UDP is used on the server

When the server is configured with UDP and --push statements, reconnecting
often fails by the client never receiving PUSH_REPLY.  The client sends
PUSH_REQUEST and the server logs these requests but does not send them.

This bug got introduced in commit ff65da3a230b658b2c1d52dc1a48612e80a2eb42
which tries to avoid sending duplicated PUSH messages if the client/server
connection is slow.

This patch keeps this behaviour, but instead of a session wide PUSH_REPLY
block it sets an expiry time for the PUSH_REPLY block.  The expiry time
is set to 30 seconds.

Signed-off-by: David Sommerseth <davids@redhat.com>
Cc: James Yonan <james@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: James Yonan <james@openvpn.net>
Message-Id: 1347154246-20143-1-git-send-email-dazo@users.sourceforge.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/7044

12 years agomake "ipv6 ifconfig" on linux compatible with busybox ifconfig
Gert Doering [Tue, 11 Sep 2012 11:56:55 +0000 (13:56 +0200)] 
make "ipv6 ifconfig" on linux compatible with busybox ifconfig

We used to call "ifconfig tun0 inet6 add...".  The "inet6" part is
optional,
and not understood by busybox.  So now we call "ifconfig tun0 add ...",
which works on all supported Linux variants.

Tested on Gentoo, RHEL5+, Debian Lenny & up.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1347364615-26878-1-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/7052
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoAdd checks for external-key-managements
Arne Schwabe [Mon, 10 Sep 2012 14:39:33 +0000 (16:39 +0200)] 
Add checks for external-key-managements

Commit 4806cc102655f1a829d656f6deb83e5953c5eab2 fixed only part of the
problem. Since it removed the filename either the magic filename has to be
resurrected or all checks against priv_key_file need to take to check for
MF_EXTERNAL_KEY as well. This patch implements the extra checks

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1347287973-12398-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/7046
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoDocument that keep alive will double the second value in server mode and give a short...
Arne Schwabe [Mon, 3 Sep 2012 12:16:04 +0000 (14:16 +0200)] 
Document that keep alive will double the second value in server mode and give a short explanation why the value is chosen.

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

Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoDocument --management-client and --management-signal a bit better
Arne Schwabe [Wed, 8 Aug 2012 17:31:42 +0000 (19:31 +0200)] 
Document --management-client and --management-signal a bit better

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1344447102-22271-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/6962
Signed-off-by: David Sommerseth <davids@redhat.com>
12 years agoMerge getaddr_multi and getaddr6 into one function
Arne Schwabe [Tue, 7 Aug 2012 10:03:57 +0000 (12:03 +0200)] 
Merge getaddr_multi and getaddr6 into one function

the getaddr6 and getaddr_mutli functions are duplicates of each other.
Since we always require getaddrinfo to be present both function are merge
into one openvpn_getaddrinfo.

This functions also returns a standard struct addrinfo* so our resolve
interface is closer to the standard unix interface. The getaddr function
is a wrapper which provides backward compatibility for IPv4 addresses.
Ipv6 calls and calls to getaddr_multi are replaced with the new interface.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1344333837-22076-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/6959
Signed-off-by: David Sommerseth <davids@redhat.com>
[DS: Applied proper indenting on the changes wherever needed]