]> git.ipfire.org Git - thirdparty/openvpn.git/log
thirdparty/openvpn.git
11 years agoPreparing for v2.3.0 beta/2.3 143/head v2.3.0
David Sommerseth [Wed, 2 Jan 2013 19:13:37 +0000 (20:13 +0100)] 
Preparing for v2.3.0

Signed-off-by: David Sommerseth <davids@redhat.com>
11 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>
(cherry picked from commit 1978db4b9657f0db134f1deaeb1e8400bf6a033e)

11 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>
(cherry picked from commit d39f31d96378aa5eeade74670ffd9e08bf4c7234)

11 years agoPreparing for v2.3_rc2 v2.3_rc2
David Sommerseth [Mon, 17 Dec 2012 09:41:32 +0000 (10:41 +0100)] 
Preparing for v2.3_rc2

Signed-off-by: David Sommerseth <davids@redhat.com>
11 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>
(cherry picked from commit 3b860cf27b9374f6ebe67ff21011661f8ec391c6)

11 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>
(cherry picked from commit f0e8997a874a89b3fe1f82109c443232e8967b01)

11 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>
(cherry picked from commit 38727e09df35245ba0cfe335e23e6b43c817ce58)

11 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>
(cherry picked from commit 740137f6bb7b3565054c3a8e894ceca93f2ff0e4)

11 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
(cherry picked from commit b2b66179f6dcc37de9582d5c3044f0357dda3df3)

11 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
(cherry picked from commit b3f19cc4bec6978a128f5af3ab22d8cfa954b064)

11 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>
(cherry picked from commit feca0900dd00577779ab02f2e52b41eb3dab935f)

11 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>
(cherry picked from commit 038f0aca3077807f3fc60077e2aacffef5ba2f45)

11 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>
(cherry picked from commit 5dfdb7c010c5a32a0ec51d9266748c641cd24dba)

11 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>
(cherry picked from commit f83ccec6525179968b68696acb6ccf22182fc6de)

11 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>
(cherry picked from commit 5fd3e56430678bee3e6e3a3cf8dfd6db7e105676)

11 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
(cherry picked from commit 1f300fe94f1bd521966bb05dea40edc1fae82b84)

11 years agoPreparing for v2.3_rc1 v2.3_rc1
David Sommerseth [Wed, 31 Oct 2012 13:01:23 +0000 (14:01 +0100)] 
Preparing for v2.3_rc1

Signed-off-by: David Sommerseth <davids@redhat.com>
11 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
(cherry picked from commit 0563473601abfbf2142bfa0ca5b863c5aa7953a2)

11 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>
(cherry picked from commit 9885f57e3ac8d2e32ba20ca84f6bdd0a1a995eac)

11 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>
(cherry picked from commit ae303d444c11984b87e0046c4138982d7a41fd8b)

11 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>
(cherry picked from commit 70a07339f8d323d69cdcf8d59da1f331d39e4d0a)

11 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>
11 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>
(cherry picked from commit 2ebbe4c0b4f0f0b15b4c32180e906a545446c376)

11 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>
(cherry picked from commit e92255f58bcfaec157c3ef59e01c40cbd04b1d43)

11 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>
(cherry picked from commit 75b6f4bd84302d225a301f4ed87e2bb27908b972)

11 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>
11 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

11 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

11 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>
11 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>
11 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>
11 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>
11 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]

11 years agoKeep pre-existing tun/tap devices around on *BSD
Gert Doering [Thu, 16 Aug 2012 18:09:09 +0000 (20:09 +0200)] 
Keep pre-existing tun/tap devices around on *BSD

This amends commit 62c613d46dc49 to check whether a named tun/tap
device ("--dev tunX" instead of "--dev tun") exists before OpenVPN
started - if yes, keep around at program end.  If no, destroy.

Also has a spelling fix, and changes clear_tuntap() to be "static"
(only ever called from within tun.c).

Tested on FreeBSD 7.4, FreeBSD 9.0, NetBSD 5.1, OpenBSD 4.9

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Eric Crist <ecrist@secure-computing.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
11 years agoremove unused flag SSLF_NO_NAME_REMAPPING
Heiko Hund [Fri, 17 Aug 2012 09:51:53 +0000 (11:51 +0200)] 
remove unused flag SSLF_NO_NAME_REMAPPING

The flag was used with the --no-name-remapping option that was removed
in commit 5e86fd93779482b90a191f929edebe414cd78a4f.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1345197113-24636-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6986
Signed-off-by: David Sommerseth <davids@redhat.com>
11 years agoPut actual OpenVPN command line on top of corresponding log file.
Gert Doering [Thu, 16 Aug 2012 18:31:22 +0000 (20:31 +0200)] 
Put actual OpenVPN command line on top of corresponding log file.

This is useful if a test fails, and the tester wants to run the very
same OpenVPN call with the very same arguments interactively to
pinpoint and fix the problem.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1345141883-9889-2-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/6984
Signed-off-by: David Sommerseth <davids@redhat.com>
11 years agoReduce --version string detail about IPv6 to just "[IPv6]".
Gert Doering [Thu, 16 Aug 2012 18:31:23 +0000 (20:31 +0200)] 
Reduce --version string detail about IPv6 to just "[IPv6]".

For 2.3 release, we do not need to have more details, as there is no
separate patch set anymore, and both IPv6 transport and IPv6 payload
(PF_INET6) have been fully integrated.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1345141883-9889-3-git-send-email-gert@greenie.muc.de
URL: http://article.gmane.org/gmane.network.openvpn.devel/6985
Signed-off-by: David Sommerseth <davids@redhat.com>
11 years agoremove stale _openssl_get_subject() prototype
Heiko Hund [Fri, 17 Aug 2012 09:52:16 +0000 (11:52 +0200)] 
remove stale _openssl_get_subject() prototype

The _openssl_get_subject() function was removed in commit
00b973f8af85c3ea8fa3cef80eec55e8dc139b27. The functionality
moved to x509_get_subject().

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1345197136-24708-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6987
Signed-off-by: David Sommerseth <davids@redhat.com>
11 years agoDocument the inlining of files in openvpn and document key-direction
Arne Schwabe [Thu, 23 Aug 2012 21:21:00 +0000 (23:21 +0200)] 
Document the inlining of files in openvpn and document key-direction

This patch documents the usage of inline files in OpenVPN. Hackish ways of
inline files are deliberately left out. For tls-auth and
secret the key-direction option is right way of specifying the direction
and not by using two tls-auth/secret lines where the first sets the
direction and has a dummy file name and the second sets the inline file
data but does not reset the direction parameter.

Also pkcs12 [[INLINE]] base64encoded_data works but is a quirk of how the
config parser works

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1345756860-2044-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/7006
Signed-off-by: David Sommerseth <davids@redhat.com>
11 years agoMerge almost identical create_socket_tcp and create_socket_tcp6
Arne Schwabe [Thu, 2 Aug 2012 13:36:59 +0000 (15:36 +0200)] 
Merge almost identical create_socket_tcp and create_socket_tcp6

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1343914619-10576-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/6942
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
11 years agoFixes error: --key fails with EXTERNAL_PRIVATE_KEY: No such file or directory if...
Arne Schwabe [Thu, 2 Aug 2012 13:37:48 +0000 (15:37 +0200)] 
Fixes error: --key fails with EXTERNAL_PRIVATE_KEY: No such file or directory if --management-external-key is used

Warn if both options are used at the same time.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1343914668-10696-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/6943
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
11 years agoadd API for plug-ins to write to openvpn log
Heiko Hund [Thu, 2 Aug 2012 15:20:22 +0000 (17:20 +0200)] 
add API for plug-ins to write to openvpn log

Some plugins want to add messages to the openvpn log file. The
plugin_log() and plugin_vlog() APIs provide ways for them to do so.

OPENVPN_PLUGINv3_STRUCTVER is not incremented as the v3 plugin API
is new in 2.3 and this is merged during alpha phase.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1343920822-29161-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6946
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
11 years agoadd x_msg_va() log function
Heiko Hund [Wed, 1 Aug 2012 11:37:37 +0000 (13:37 +0200)] 
add x_msg_va() log function

This change allows other functions to access the functionality in x_msg().
Needed for the plug-in logging API.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1343821058-11456-2-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6923
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
11 years agofix regression with --http-proxy[-*] options
Heiko Hund [Mon, 30 Jul 2012 09:05:22 +0000 (11:05 +0200)] 
fix regression with --http-proxy[-*] options

Commit af1bf85a introducing the --management-query-proxy option
broke the initialization of HTTP proxy options by not assigning
the allocated object to the options element in the function
init_http_proxy_options_once().

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: 1343639122-8658-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/6913
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
11 years agoPreparing for OpenVPN 2.3_alpha3 v2.3_alpha3
David Sommerseth [Fri, 20 Jul 2012 12:21:03 +0000 (14:21 +0200)] 
Preparing for OpenVPN 2.3_alpha3

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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

11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
12 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>
12 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>
12 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

12 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>
12 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>
12 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>
12 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>
12 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>