]> git.ipfire.org Git - thirdparty/openvpn.git/log
thirdparty/openvpn.git
13 years agoadd option --management-query-proxy
Heiko Hund [Wed, 11 Jul 2012 12:16:50 +0000 (14:16 +0200)] 
add option --management-query-proxy

Make openvpn query for proxy information through the
management interface. This allows GUIs to provide (automatically
detected) proxy information on a per connection basis.

This new option supersedes the undocumented --http-proxy-fallback
option and puts the responsibilty for HTTP proxy fallback handling
to the GUI caring for such.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Reviewed-by: James Yonan <james@openvpn.net>
Message-Id: 1342009010-9735-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6841
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
13 years agoremove unused show_connection_list debug function
Heiko Hund [Wed, 11 Jul 2012 13:38:49 +0000 (15:38 +0200)] 
remove unused show_connection_list debug function

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1342013929-10940-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6842
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
13 years agodon't treat socket related errors special anymore
Heiko Hund [Tue, 17 Jul 2012 16:25:16 +0000 (18:25 +0200)] 
don't treat socket related errors special anymore

WSAGetLastError() is just a wrapper for GetLastError(). So, there's
no need to differentiate between socket related and other errors.

This patch removes all special handling of socket errors in favor
of simplifying the codebase somewhat.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1342542316-32563-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6876
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
13 years agomake non-blocking connect work on Windows
Heiko Hund [Tue, 17 Jul 2012 16:19:53 +0000 (18:19 +0200)] 
make non-blocking connect work on Windows

Instead of EINPROGRESS WinSock2 returns WSAEWOULDBLOCK if a non-blocking
connect(2) cannot be completed immediately.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1342541993-32462-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6875
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
13 years agoFix compiling with --disable-management
Arne Schwabe [Thu, 5 Jul 2012 09:17:15 +0000 (11:17 +0200)] 
Fix compiling with --disable-management

Some of the  MANAGEMENT_QUERY_REMOTE were actually needed. Put #ifdef
ENABLE_MANAGMENT in their place

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1341479835-12963-1-git-send-email-arne@rfc2549.org
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
13 years agoUpdate version.m4 - we're past 2.3_alpha2 now
David Sommerseth [Mon, 2 Jul 2012 07:42:37 +0000 (09:42 +0200)] 
Update version.m4 - we're past 2.3_alpha2 now

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
13 years agoRepair "tap server" mode brokenness caused by <stdbool.h> fallout
Gert Doering [Sat, 30 Jun 2012 20:50:43 +0000 (22:50 +0200)] 
Repair "tap server" mode brokenness caused by <stdbool.h> fallout

Operator/Cast precedence wrong: casting mac[0] to (bool) first - giving
"1" for "any mac address that does not start with 00:" - and only then
bit-anding with "1" - thus always returning "true".  Which, in turn,
leads to "reject all incoming packets with 'bad source address'".

OpenVPN bug #216.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Fabian Knittel <fabian.knittel@lettink.de>
Message-Id: 1341089443-2287-1-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/6817
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
13 years agoSet the correct version number - 2.3_alpha2 v2.3_alpha2
David Sommerseth [Fri, 29 Jun 2012 13:47:23 +0000 (15:47 +0200)] 
Set the correct version number - 2.3_alpha2

Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoPrepare the OpenVPN v2.3_alpha2 release
David Sommerseth [Fri, 29 Jun 2012 08:34:47 +0000 (10:34 +0200)] 
Prepare the OpenVPN v2.3_alpha2 release

Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: msvc: chdir with change drive to script location
Alon Bar-Lev [Sat, 28 Apr 2012 18:51:58 +0000 (21:51 +0300)] 
build: msvc: chdir with change drive to script location

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Message-Id: 1335639118-16671-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6383
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: windows: convert argv (UCS-2 to UTF-8) at earliest
Alon Bar-Lev [Sat, 24 Mar 2012 20:31:10 +0000 (22:31 +0200)] 
cleanup: windows: convert argv (UCS-2 to UTF-8) at earliest

Discussed at [1].

Use wmain under windows, drop the custom parsing and shell32 linkage.

There is no need for gc magic as this allocation is static.

[1] http://permalink.gmane.org/gmane.network.openvpn.devel/5433

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Message-Id: 1332621070-28464-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6063
Tested-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: plugins: set defaults based on platform
Alon Bar-Lev [Tue, 26 Jun 2012 14:03:26 +0000 (17:03 +0300)] 
build: plugins: set defaults based on platform

pam cannot be compiled on OpenBSD and Windows.
down-root cannot be compiled on Windows.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Message-Id: 1340719406-12157-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6795
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoAdded notes about upgrading from 2.3-alpha1 and earlier to INSTALL-win32.txt
Samuli Seppänen [Tue, 26 Jun 2012 09:33:01 +0000 (12:33 +0300)] 
Added notes about upgrading from 2.3-alpha1 and earlier to INSTALL-win32.txt

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1340703181-9185-1-git-send-email-samuli@openvpn.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/6779
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: integrate plugins build into core build
Alon Bar-Lev [Mon, 14 May 2012 22:42:03 +0000 (01:42 +0300)] 
build: integrate plugins build into core build

As disucssed[1], keep plugins in repository.

1, Proper automake/libtool build.

2. Move example plugins to samples/sample-plugins.

3. Plugins are installed at LIBDIR/openvpn/plugins.

[1] http://comments.gmane.org/gmane.network.openvpn.devel/6436

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1337035323-27465-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6591
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoRemove ENABLE_CONNECTIONS ifdefs
Arne Schwabe [Mon, 18 Jun 2012 18:39:07 +0000 (20:39 +0200)] 
Remove ENABLE_CONNECTIONS ifdefs

Connections were always on for a long time. Note that ENABLE_MAMAGEMENT_REMOTE
was only depending on ENABLE_CONNECTIONS and is removed as well

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: James Yonan <james@openvpn.net>
Message-Id: 1340044749-10694-5-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/6744
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoRemove ENABLE_INLINE_FILES conditionals
Arne Schwabe [Mon, 18 Jun 2012 18:39:06 +0000 (20:39 +0200)] 
Remove ENABLE_INLINE_FILES conditionals

This code is always enabled and removing the #ifdef make the code a little bit clearer

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: James Yonan <james@openvpn.net>
Message-Id: 1340044749-10694-4-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/6746
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoCompletely remove ancient IANA port warning.
Arne Schwabe [Mon, 18 Jun 2012 18:39:05 +0000 (20:39 +0200)] 
Completely remove ancient IANA port warning.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1340044749-10694-3-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/6742
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoOnly use tmpdir if tmp_dir is really used.
Arne Schwabe [Mon, 18 Jun 2012 18:39:04 +0000 (20:39 +0200)] 
Only use tmpdir if tmp_dir is really used.

This fixes starting openvpn compiled as client only version of systems
that have no /tmp (Android). --tmp-dir could only be set if P2MP_SERVER
has been enabled too.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1340044749-10694-2-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/6741
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: pkcs11.c: resolve wanings
Alon Bar-Lev [Mon, 18 Jun 2012 17:35:04 +0000 (20:35 +0300)] 
cleanup: pkcs11.c: resolve wanings

src/openvpn/pkcs11.c:794:2: warning: passing argument 1 of
‘pkcs11h_setPINPromptHook’ from incompatible pointer type

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1340040904-23950-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6738
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoRemove #include "config.h" from ssl_polarssl.h
Gert Doering [Thu, 14 Jun 2012 14:41:37 +0000 (16:41 +0200)] 
Remove #include "config.h" from ssl_polarssl.h

This include is superfluous, as all callers already include config.h -
and under certain combinations of configure options and syshead.h

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Alon Bar-Lev <alon.barlev@gmail.com>
Message-Id: 20120614144454.GX1059@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/6723
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: add --with-special-build to provide special build string
Alon Bar-Lev [Sat, 5 May 2012 08:01:17 +0000 (11:01 +0300)] 
build: add --with-special-build to provide special build string

Special build string is printed when --version is specified.

Empty = no special build.

This is handy when building a snapshot or if not git repository.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1336204877-3564-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6435
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoUpdate TODO.IPv6 list
Gert Doering [Sun, 10 Jun 2012 15:41:31 +0000 (17:41 +0200)] 
Update TODO.IPv6 list

Clarify status of each already-done item for "IPv6 payload" TODOs.

Remove TODOs from "IPv6 transport" list that have been solved in
"IPv6 payload" work.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoAdd missing pieces to IPv6 route gateway handling.
Gert Doering [Sun, 10 Jun 2012 15:41:30 +0000 (17:41 +0200)] 
Add missing pieces to IPv6 route gateway handling.

OpenVPN on Linux (iproute2+ifconfig), FreeBSD and MacOS X (Darwin)
normally points routes directly towards the "tun" interface, obviating
the need for a gateway.  For "tap" interfaces, now add gateway spec to
linux route command, and replace "-iface <dev>" with gateway spec (both
together do not work) on FreeBSD and MacOS X.

Also adapt "route delete" appropriately, otherwise route will not be found.

All other platforms already use the gateway address for tun and tap,
because there's no way to install a route "towards an interface" there.

Remove warning about missing IPv6 route gateway handling.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1339342891-28443-5-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/6712
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoRemove warning about "explicit support for IPv6 tun devices is not provided for this...
Gert Doering [Sun, 10 Jun 2012 15:41:29 +0000 (17:41 +0200)] 
Remove warning about "explicit support for IPv6 tun devices is not provided for this OS" for MacOS X (because it *is*).

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1339342891-28443-4-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/6716
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoremove "*option" element in "struct route_ipv6"
Gert Doering [Sun, 10 Jun 2012 15:41:28 +0000 (17:41 +0200)] 
remove "*option" element in "struct route_ipv6"

this used to point to the "route_ipv6_option" that created this specific
route entry, but nobody ever queried this field -> dead code.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1339342891-28443-3-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/6714
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup and redefine metric handling for IPv6 routes
Gert Doering [Sun, 10 Jun 2012 15:41:27 +0000 (17:41 +0200)] 
cleanup and redefine metric handling for IPv6 routes

"no metric set" is now stored as "-1"
"metric 0" means "on-link route" (what the BSDs do)
properly initialize metric value to "0" for on-link IPv6 net on BSDs

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1339342891-28443-2-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/6710
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoFix reported compile issues on OSX 10.6.8
Frank de Brabander [Wed, 22 Feb 2012 19:49:15 +0000 (11:49 -0800)] 
Fix reported compile issues on OSX 10.6.8

This is not the a problem when building using the latest Mac OS X SDK.
I've did a quick search and it seems to be a more common issue on some
(old) Darwin platforms.

[ Additional review note from Gert Doering:

  IPV6_PKTINFO is part of the "extended socket API" defined in RFC2292.
  That RFC used IPV6_PKTINFO both for receiving the destination IPv6 address
  in UDP packets, and for setting the source address for outgoing packets.

  RFC2292 was updated by RFC3542, which renamed the "receive" function to
  IPV6_RECVPKTINFO, leaving the "sending" function as IPV6_PKTINFO - and,
  subsequently, in FreeBSD they have different "setsockopt()" opcodes.

  So, on a system that has *both*, we need to use IPV6_RECVPKTINFO for
  receving (turning it on with setsockopt) to make --multihome work, and
  IPV6_PKTINFO for sending (which we don't actually do).

  On a system that only has IPV6_PKTINFO, because it's API only implements
  2292 (MacOS up until 10.6), use IPV6_PKTINFO for setsockopt().

  Now, the interesting question is whether a 10.5-compiled openvpn.exe
  will behave correctly under 10.7 if --multihome is active...
]

Signed-off-by: Frank de Brabander <debrabander@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: eb2837a3-ce55-4f52-b2fe-f822efc661f7@l14g2000vbe.googlegroups.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/5591
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoImplement search for "first free" tun/tap device on Solaris
Gert Doering [Thu, 7 Jun 2012 15:38:17 +0000 (17:38 +0200)] 
Implement search for "first free" tun/tap device on Solaris

Without this patch, Solaris will do "--dev tun3" just fine, but "--dev tun"
will either use "tun0" if that is available, or fail.  With the patch, the
first available device is searched if "--dev tun" or "--dev tap" (without
a number) is specified.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 20120607174638.GW1059@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/6705
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agot_client.sh - fix for iproute2, print summary line
Gert Doering [Thu, 7 Jun 2012 15:35:53 +0000 (17:35 +0200)] 
t_client.sh - fix for iproute2, print summary line

Yet another postprocess-output fix for iproute2 (sometimes there was
no whitespace in the output, so substituting away expiry time failed).

Print summary line of succeeded and failed test sets at the very end.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 20120607174255.GV1059@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/6704
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoremove the --auto-proxy option from openvpn
Heiko Hund [Sun, 5 Feb 2012 12:47:09 +0000 (13:47 +0100)] 
remove the --auto-proxy option from openvpn

During discussion on FOSDEM 2012 it was decided that proxy auto detection
is best done in the GUI as it's highly platform specific and shouldn't be
handled in openvpn itself for every supported platform in openvpn itself.

This removes --auto-proxy from openvpn.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1328446029-30523-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/5333
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoAdd the name of the context where option is not allowed to the error message.
Arne Schwabe [Sat, 2 Jun 2012 13:03:40 +0000 (15:03 +0200)] 
Add the name of the context where option is not allowed to the error message.

Changes

Options error: option 'dhcp-option' cannot be used in this context

to

P:Options error: option 'dhcp-option' cannot be used in this context
([PUSH-OPTIONS])

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1338642223-20324-6-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/6646
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoExplain that route-nopull also causes the client to ignore dhcp options.
Arne Schwabe [Sat, 2 Jun 2012 13:03:39 +0000 (15:03 +0200)] 
Explain that route-nopull also causes the client to ignore dhcp options.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1338642223-20324-5-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/6649
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoAdd the query to the error message. Makes the diagnose what went wrong from logs...
Arne Schwabe [Sat, 2 Jun 2012 13:03:37 +0000 (15:03 +0200)] 
Add the query to the error message. Makes the diagnose what went wrong from logs easier.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1338642223-20324-3-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/6645
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: do not support <polarssl-1.1.0
Alon Bar-Lev [Thu, 7 Jun 2012 09:37:04 +0000 (12:37 +0300)] 
build: do not support <polarssl-1.1.0

Reported-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Message-Id: 1339061824-16542-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6686
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: support platforms that does not need explicit tun headers
Alon Bar-Lev [Sat, 2 Jun 2012 15:31:49 +0000 (18:31 +0300)] 
build: support platforms that does not need explicit tun headers

Both "generic" and Darwin have no special headers to use tap.

Fixes commit 7cacdfd4b7.

Reported-by: Arne Schwabe <arne@rfc2549.org>
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1338651109-15806-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6659
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: update INSTALL to recent changes
Alon Bar-Lev [Mon, 4 Jun 2012 04:45:07 +0000 (07:45 +0300)] 
build: update INSTALL to recent changes

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1338785107-592-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6676
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoRemove two unused functions
David Sommerseth [Thu, 3 May 2012 09:10:40 +0000 (11:10 +0200)] 
Remove two unused functions

Both is_persist_option() and is_stateful_restart() functions where never
used anywhere in the code.  Remove them.

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

13 years agobuild: cleanup: yet another forgotten brackets
Alon Bar-Lev [Sat, 5 May 2012 06:49:00 +0000 (09:49 +0300)] 
build: cleanup: yet another forgotten brackets

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1336200540-10327-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6434
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agot_client.sh iproute2 script fixes
Gert Doering [Fri, 1 Jun 2012 15:13:09 +0000 (18:13 +0300)] 
t_client.sh iproute2 script fixes

Test for existance of "iproute2" with "-n" (Alon)

Work around "ip -6 route show" behaviour on FC14 where some parts of
the IPv6 route cache would be displayed, which has no relevance to
OpenVPN but breaks before/after comparison.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 20120601151507.GE400@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/6637
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: add git revision to --version output if build from git repository
Alon Bar-Lev [Sat, 5 May 2012 06:39:42 +0000 (09:39 +0300)] 
build: add git revision to --version output if build from git repository

If source is located at git repository, acquire branch and revision
of head to be printed at --version output.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1336199983-9916-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6431
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: detect sys/wait.h required for *bsd
Alon Bar-Lev [Sat, 12 May 2012 09:02:18 +0000 (12:02 +0300)] 
build: detect sys/wait.h required for *bsd

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1336813338-9219-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6532
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: insall README* document using build system
Alon Bar-Lev [Sat, 12 May 2012 19:03:53 +0000 (22:03 +0300)] 
build: insall README* document using build system

Purpose: make distro packager task simpler, more flexible to provide
more documentation without changing the packaging script.

Remove installation related documents from rpm as package already
installed when viewed.

+Workaround rpm bug[1].

[1] http://rpm.org/ticket/836

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1336849433-23066-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6536
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: spec: we support openssl >= 0.9.7
Alon Bar-Lev [Mon, 14 May 2012 22:29:40 +0000 (01:29 +0300)] 
build: spec: we support openssl >= 0.9.7

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1337034580-26987-2-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6589
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: spec: make space/tab consistent
Alon Bar-Lev [Mon, 14 May 2012 22:29:39 +0000 (01:29 +0300)] 
cleanup: spec: make space/tab consistent

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1337034580-26987-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6590
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: update .gitignore
Alon Bar-Lev [Tue, 15 May 2012 22:21:15 +0000 (01:21 +0300)] 
cleanup: update .gitignore

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1337120475-3959-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6596
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: check minimum polarssl version
Alon Bar-Lev [Mon, 21 May 2012 11:04:14 +0000 (14:04 +0300)] 
build: check minimum polarssl version

Pre 1.1 is unsupported, API was changed.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Reviewed-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1337598254-32641-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6613
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agorepair t_client.sh test after build system revolution
Gert Doering [Sun, 27 May 2012 20:19:11 +0000 (23:19 +0300)] 
repair t_client.sh test after build system revolution

- run t_client.sh at "make check" time
- in t_client.sh, read t_client.rc from source *or* build dir (as before)
- @IP@ evaluates to "" now (not "ip") if iproute2 not found - adapt script
- introduce $SETUP_TIME_WAIT to delay "waiting for openvpn startup" longer
  than the default delay of 10 seconds - this is needed for test servers
  with a high network RTT

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 20120527202737.GV1161@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/6616
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoSome filesystems don't like ':', which is a path 'make dist' would use
David Sommerseth [Fri, 4 May 2012 14:37:00 +0000 (16:37 +0200)] 
Some filesystems don't like ':', which is a path 'make dist' would use

In commit 7a845401043dbd9c the version.m4 was modified to remove the
alpha1 tag.  But then Alon Bar-Lev noticed that NTFS wasn't happy about
the ':' character.  So let's rather just skip the complete 'git:'
prefix and use just 'master' instead.

Reported-by: Alon Bar-Lev <alon.barlev@gmail.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoChange version to indicate the master branch is not a version
David Sommerseth [Tue, 21 Feb 2012 14:11:38 +0000 (15:11 +0100)] 
Change version to indicate the master branch is not a version

This also indicates that we're way past the released 2.3-alpha1

Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoSimplify check_cmd_access() function
David Sommerseth [Wed, 2 May 2012 17:54:12 +0000 (19:54 +0200)] 
Simplify check_cmd_access() function

To avoid confusion between check_file_access() and check_cmd_access() in
the future, remove unneeded arguments from check_cmd_access()

As a command will always be a file, it should always check for CHKACC_FILE
and nothing else.  And as the commands always will need X_OK, check only
for that.

One change from earlier behaviour is that R_OK is not checked for.  The
reason is that only scripts require R_OK to work.  However, a system might
be installed with binaries with only X_OK set.  If a script is missing
R_OK, then the execution will fail due to lacking permissions.

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Alon Bar-Lev <alon.barlev@gmail.com>
Message-Id: 1335981252-7390-1-git-send-email-davids@redhat.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6391

13 years agobuild: windows: convert resources to UTF-8
Alon Bar-Lev [Sat, 28 Apr 2012 18:29:01 +0000 (21:29 +0300)] 
build: windows: convert resources to UTF-8

Visual Studio 2010 editor supports UTF-8 files, we can store files in
standard encoding.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1335637741-15721-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6380
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoClarified the docs and help screen about what a 'cmd' is
Jonathan K. Bullard [Sat, 31 Mar 2012 11:47:34 +0000 (07:47 -0400)] 
Clarified the docs and help screen about what a 'cmd' is

This also changes the descriptions of several options to note that they accept
a "command"; change the description of --client-connect and --client-disconnect
indicate that the temporary file's path is passed as the last argument to the
command, not the first argument; and Adds a description of --route-pre-down to
the descriptions of the other --route options.

[DS: This patch is based on parts of the options.c.diff and the complete
     openvpn.8.diff patch sent to the mailing list - where these docs changes
     are merged together into this patch]

Signed-off-by: Jonathan K. Bullard <jkbullard@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: CAEsd45RkyJw6yUk1Jwkip70HkCjKYoU+V=do3N7SH7JOaHBZdw@mail.gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6194
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoFix file access checks on commands
Jonathan K. Bullard [Sat, 31 Mar 2012 11:47:34 +0000 (07:47 -0400)] 
Fix file access checks on commands

The current implementation of check_file_access() does not consider that
some options take scripts and executables as input.  When some of these
commands are given arguments in the OpenVPN configuration,
check_file_access() would take those arguments as a part of the file name
to the command.  Thus the file check would fail.

This patch improves that by introducing a check_cmd_access() function which
first splits out the arguments to the command before checking if the file
with the command is available.

[DS: This patch is splitted out from the options.c.diff patch sent to the
     mailing list - where only the function changes is included here]

Signed-off-by: Jonathan K. Bullard <jkbullard@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: CAEsd45RkyJw6yUk1Jwkip70HkCjKYoU+V=do3N7SH7JOaHBZdw@mail.gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6194
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoRemoved stray "Fox-IT hardening" string.
Adriaan de Jong [Mon, 2 Apr 2012 07:28:06 +0000 (09:28 +0200)] 
Removed stray "Fox-IT hardening" string.

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1333351687-3732-5-git-send-email-dejong@fox-it.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6212
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: fix typo in --enable-save-password
Alon Bar-Lev [Fri, 27 Apr 2012 13:40:54 +0000 (16:40 +0300)] 
build: fix typo in --enable-save-password

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1335534054-14895-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6371
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: use stdbool.h if available
Alon Bar-Lev [Fri, 27 Apr 2012 12:09:15 +0000 (15:09 +0300)] 
build: use stdbool.h if available

If stdbool.h is available use it, otherwise create emulation.

basic.h defines a type 'bool' that conflicts with
the altivec keyword bool which has to be fixed upstream, see
bugs[1][2].

[1] https://bugs.gentoo.org/show_bug.cgi?id=293840
[2] https://bugs.gentoo.org/show_bug.cgi?id=297854

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1335528555-13225-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6363
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoUpdated README.polarssl with build system changes.
Adriaan de Jong [Mon, 2 Apr 2012 07:28:07 +0000 (09:28 +0200)] 
Updated README.polarssl with build system changes.

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1333351687-3732-6-git-send-email-dejong@fox-it.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6209
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoRemoved support for PolarSSL < 1.1
Adriaan de Jong [Mon, 2 Apr 2012 07:28:05 +0000 (09:28 +0200)] 
Removed support for PolarSSL < 1.1

PolarSSL 1.0 and earlier use only the Havege RNG. Havege is based on timing
certain operations, using the RDTSC instruction. Although this is fine on
bare metal PCs, the RDTSC instruction is virtualised on some virtual
machine implementations. This can result in issues on those virtual
machines. PolarSSL fixes this potential issue by also using platform
entropy.

To ensure that OpenVPN is always built against a decent RNG, PolarSSL <1.1
is therefore no longer supported.

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1333351687-3732-4-git-send-email-dejong@fox-it.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6211
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoUse POLARSSL_CFLAGS instead of POLARSSL_CRYPTO_CFLAGS in configure.ac
Adriaan de Jong [Mon, 2 Apr 2012 07:28:04 +0000 (09:28 +0200)] 
Use POLARSSL_CFLAGS instead of POLARSSL_CRYPTO_CFLAGS in configure.ac

Ensured that the used variable name actually matches the one advertised by configure.

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: Alon Bar-Lev <alon.barlev@gmail.com>
Message-Id: 1333351687-3732-3-git-send-email-dejong@fox-it.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6208
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoAdded a configuration option to enable prediction resistance in the PolarSSL random...
Adriaan de Jong [Mon, 2 Apr 2012 07:28:03 +0000 (09:28 +0200)] 
Added a configuration option to enable prediction resistance in the PolarSSL random number generator.

Signed-off-by: Eelse-jan Stutvoet <stutvoet@fox-it.com>
Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: James Yonan <james@openvpn.net>
Message-Id: 1333351687-3732-2-git-send-email-dejong@fox-it.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6213
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoAdded support for new PolarSSL 1.1 RNG
Adriaan de Jong [Mon, 2 Apr 2012 07:28:02 +0000 (09:28 +0200)] 
Added support for new PolarSSL 1.1 RNG

This patch, while retaining PolarSSL 1.0 support, introduces the PolarSSL 1.1 DRBG.
This RNG adds a number of features, including support for personalisation strings
and multiple entropy sources.

Personalisation strings have been implemented, based on PID, program name, place
within memory, and a hash of the user's certificate.

The entropy sources used are the platform default ones. Which ones these are
depends on how PolarSSL was built, but usually this includes:

 - /dev/urandom or the Windows CryptoAPI RNG
 - the HAVEGE RNG
 - the output of PolarSSL's hardclock() call (usually RDTSC)

Finally, this patch moves to only one instance of the RNG  per OpenVPN instance,
instead of one per keystate

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Signed-off-by: Eelse-jan Stutvoet <stutvoet@fox-it.com>
Acked-by: James Yonan <james@openvpn.net>
Message-Id: 1333351687-3732-1-git-send-email-dejong@fox-it.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6210
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocrash: packet_id_debug_print: sl may be null
Alon Bar-Lev [Sun, 8 Apr 2012 10:04:45 +0000 (13:04 +0300)] 
crash: packet_id_debug_print: sl may be null

Program received signal SIGSEGV, Segmentation fault.
packet_id_debug_print (msglevel=1174405255, p=0xa36bd0718,
pin=0x3de5feec1b0,
message=0xa330dde80 "PID_TEST", value=0) at
../../../src/openvpn/packet_id.c:504
504       for (i = 0; i < sl->x_size; ++i)

(gdb) print sl
$2 = (const struct seq_list *) 0x0

Reported in the past[1].

[1] http://thread.gmane.org/gmane.network.openvpn.devel/5466

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: James Yonan <james@openvpn.net>
Message-Id: 1333879485-2417-1-git-send-email-alon.barlev@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6259
Message-Id: 4F9A6B4B.7060502@openvpn.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/6350
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoClean-up: Presume that Linux is always IPv6 capable at build time
David Sommerseth [Fri, 27 Apr 2012 10:10:25 +0000 (12:10 +0200)] 
Clean-up: Presume that Linux is always IPv6 capable at build time

These days it is highly unlikely that OpenVPN will be built in a non-IPv6
capable Linux environment.  So remove compile-time related macros identifying
that.

This also solves an issue which was introduced in commit 51bd56f46f55177cf0f8b
where HAVE_TUN_PI is no longer detected.  The tun_pi struct is defined in
linux/if_tun.h, which will be checked for later on.  As this struct has history
in linux/if_tun.h all back to the beginning of the kernel git tree (2.6.12-rc2,
April 2005), it is considered not needed to check for this struct explicit.

[ v2: Commit 7c0a2b5f2b4409 modifies some of the checks this patch touches.  This
      patch just adopts to those changes ]

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Alon Bar-Lev <alon.barlev@gmail.com>
Message-Id: 1335521425-23391-1-git-send-email-davids@redhat.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6351

13 years agocleanup: add .gitattributes to control eol style explicitly
Alon Bar-Lev [Mon, 2 Apr 2012 11:37:41 +0000 (14:37 +0300)] 
cleanup: add .gitattributes to control eol style explicitly

Having the text auto detection is a risk, as the detection may detect
text files that are not text and vise versa.

Having global setting will create confusion and differentiate between
users. So this patch also move this to local repository.

Having git to check out files differently in different OS is also
a not correct, as checkouts may be used in shares or in *NIX emulation
environments, so it have no effect.

Another issue is packaging, if we change out the tree differently
in several OSes, we may have different package content, which is
something that should be avoided.

Currently any editor of MS supports LF end of lines, so there is no
need to convert source files while checking out.

The visual studio files should be stored as CRLF as they are generated
by visual studio every save, in a way that CRLF are added.

I handled only the files that may be touch by MS users.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Fabian Knittel <fabian.knittel@lettink.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoEnsure sys/un.h autoconf detection includes sys/socket.h
Adriaan de Jong [Thu, 12 Apr 2012 06:50:12 +0000 (08:50 +0200)] 
Ensure sys/un.h autoconf detection includes sys/socket.h

This is required to build an Android binary.

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: Alon Bar-Lev <alon.barlev@gmail.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: remove C++ comments
Alon Bar-Lev [Sat, 7 Apr 2012 17:42:27 +0000 (20:42 +0300)] 
cleanup: remove C++ comments

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Fabian Knittel <fabian.knittel@lettink.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: plugin: support C++ plugin
Alon Bar-Lev [Sat, 7 Apr 2012 17:40:40 +0000 (20:40 +0300)] 
cleanup: plugin: support C++ plugin

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Fabian Knittel <fabian.knittel@lettink.de>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: properly detect TUNSETPERSIST
Alon Bar-Lev [Sun, 8 Apr 2012 19:21:47 +0000 (22:21 +0300)] 
build: properly detect TUNSETPERSIST

Do not rely on system symbol throught sources
but on autoconf detection.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: properly detect netinet/ip.h structs
Alon Bar-Lev [Sun, 8 Apr 2012 19:22:09 +0000 (22:22 +0300)] 
build: properly detect netinet/ip.h structs

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: fix some statement left from conversion
Alon Bar-Lev [Sat, 7 Apr 2012 17:39:26 +0000 (20:39 +0300)] 
build: fix some statement left from conversion

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: gc usage
Alon Bar-Lev [Sun, 1 Apr 2012 13:46:28 +0000 (16:46 +0300)] 
cleanup: gc usage

Cleanup of "Use the garbage collector when retrieving x509 fields"
patch series.

Discussed at [1].

There should be an effort to produce common function prologue
and epilogue, so that cleanups will be done at single point.

[1] http://comments.gmane.org/gmane.network.openvpn.devel/5401

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: avoid using ~0 - windows
Alon Bar-Lev [Sun, 1 Apr 2012 12:12:37 +0000 (15:12 +0300)] 
cleanup: avoid using ~0 - windows

Use the following constants:
- METRIC_NOT_USED
- TUN_ADAPTER_INDEX_INVALID

Modified: Use MAXDWORD for route loop.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: avoid using ~0 - netmask
Alon Bar-Lev [Thu, 29 Mar 2012 09:16:41 +0000 (11:16 +0200)] 
cleanup: avoid using ~0 - netmask

Use IPV4_NETMASK_HOST constant.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: avoid using ~0 - ipv6
Alon Bar-Lev [Thu, 29 Mar 2012 09:16:40 +0000 (11:16 +0200)] 
cleanup: avoid using ~0 - ipv6

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: avoid using ~0 - generic
Alon Bar-Lev [Thu, 29 Mar 2012 09:16:39 +0000 (11:16 +0200)] 
cleanup: avoid using ~0 - generic

Use limits.h for maximum value.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: flags should not be bool
Alon Bar-Lev [Sun, 25 Mar 2012 11:27:02 +0000 (13:27 +0200)] 
cleanup: flags should not be bool

Discussed at [1][2][3].

[1] https://bugs.gentoo.org/show_bug.cgi?id=297854#c2
[2] https://297854.bugs.gentoo.org/attachment.cgi?id=214304
[3] http://sourceforge.net/mailarchive/forum.php?thread_name=20120325111517.GI1359%40greenie.muc.de&forum_name=openvpn-devel

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoMigrated x509_get_sha1_hash to use the garbage collector
Adriaan de Jong [Tue, 14 Feb 2012 10:11:26 +0000 (11:11 +0100)] 
Migrated x509_get_sha1_hash to use the garbage collector

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: James Yonan <james@openvpn.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoMigrated x509_get_serial to use the garbage collector
Adriaan de Jong [Tue, 14 Feb 2012 10:11:25 +0000 (11:11 +0100)] 
Migrated x509_get_serial to use the garbage collector

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: James Yonan <james@openvpn.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoMigrated x509_get_subject to use of the garbage collector
Adriaan de Jong [Tue, 14 Feb 2012 10:11:24 +0000 (11:11 +0100)] 
Migrated x509_get_subject to use of the garbage collector

This also cleans up a messy call in pkcs11.c to _openssl_get_subject, as discussed at FOSDEM.

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: James Yonan <james@openvpn.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoEnable pedantic in windows compilation
Alon Bar-Lev [Wed, 28 Mar 2012 18:43:15 +0000 (20:43 +0200)] 
Enable pedantic in windows compilation

Apparently -ansi undef WIN32 macro.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoFixed off-by-one in serial length calculation
Adriaan de Jong [Tue, 28 Feb 2012 16:29:47 +0000 (17:29 +0100)] 
Fixed off-by-one in serial length calculation

The serial length was one digit too short, resulting in missing digits
at the end of the certificate's stringified serial number.

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoRemove calls to OpenSSL when building with --disable-ssl
Igor Novgorodov [Tue, 28 Feb 2012 11:16:01 +0000 (15:16 +0400)] 
Remove calls to OpenSSL when building with --disable-ssl

Move OpenSSL calls out from the generic crypto layer and into the
OpenSSL specific layer.  Also don't load all algortihms if SSL
isn't enabled.

Error strings will also not be loaded into memory if ENABLE_SMALL
is configured.

Signed-off-by: Igor Novgorodov <igor@novg.net>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: msvc: upgrade to Visual Studio 2010 + fixups
Alon Bar-Lev [Sat, 24 Mar 2012 07:58:36 +0000 (09:58 +0200)] 
build: msvc: upgrade to Visual Studio 2010 + fixups

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: tap: search for tap header
Alon Bar-Lev [Mon, 26 Mar 2012 21:26:36 +0000 (23:26 +0200)] 
build: tap: search for tap header

Windows and solaris has something in common, in both
the tap header is external. So make the Windows tap-windows.h
search common to all platform.

Display an error if we cannot find tap header.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: openbsd: detect netinet/ip.h correctly
Alon Bar-Lev [Mon, 26 Mar 2012 21:26:35 +0000 (23:26 +0200)] 
build: openbsd: detect netinet/ip.h correctly

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: assume dlfcn is available on all supported platforms
Alon Bar-Lev [Mon, 26 Mar 2012 10:34:07 +0000 (12:34 +0200)] 
build: assume dlfcn is available on all supported platforms

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Tested-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: windows: set vendor to openvpn project + cleanups
Alon Bar-Lev [Sat, 24 Mar 2012 06:43:50 +0000 (08:43 +0200)] 
build: windows: set vendor to openvpn project + cleanups

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: enable lzo by default
Alon Bar-Lev [Sat, 24 Mar 2012 07:58:37 +0000 (09:58 +0200)] 
build: enable lzo by default

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: autoconf: misc sockets fixups
Alon Bar-Lev [Sat, 24 Mar 2012 07:58:34 +0000 (09:58 +0200)] 
build: autoconf: misc sockets fixups

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: ax_varargs.m4: fixups
Alon Bar-Lev [Sat, 24 Mar 2012 07:58:33 +0000 (09:58 +0200)] 
build: ax_varargs.m4: fixups

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: use tap-windows.h as external dependency
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:22 +0000 (22:12 +0200)] 
build: use tap-windows.h as external dependency

tap-windows.h is provided by the tap project

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: distribute samples in windows
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:21 +0000 (22:12 +0200)] 
build: distribute samples in windows

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: windows: install version.sh to allow installer read version
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:20 +0000 (22:12 +0200)] 
build: windows: install version.sh to allow installer read version

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: move wrappers into platform module
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:19 +0000 (22:12 +0200)] 
build: move wrappers into platform module

+ Some fixups within the platform.c functions.
- need to check environment set on Windows.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: move console related function into its own module
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:18 +0000 (22:12 +0200)] 
cleanup: move console related function into its own module

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: move inet_ntop(), inet_pton() emulation into compat
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:17 +0000 (22:12 +0200)] 
build: move inet_ntop(), inet_pton() emulation into compat

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: move daemon() emulation into compat
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:16 +0000 (22:12 +0200)] 
build: move daemon() emulation into compat

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: move gettimeofday() emulation to compat
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:15 +0000 (22:12 +0200)] 
build: move gettimeofday() emulation to compat

Remove all references to gettimeofday() from main project.

SIDE EFFECT: mingw will use its own internal gettimeofday().

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: split out compat
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:14 +0000 (22:12 +0200)] 
build: split out compat

compat should not use any of the main project headers or conventions,
it should be a standalone library that provides missing library
functions.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: move out config.h include from syshead
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:13 +0000 (22:12 +0200)] 
build: move out config.h include from syshead

Yet another step in reducing the syshead.h content.

Conditional compilation of sources needs to be based on
a minimum program prefix (config.h only).

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>