]> git.ipfire.org Git - thirdparty/openvpn.git/log
thirdparty/openvpn.git
14 years agoSeveral modifications to win/make_dist.py to allow building the NSI installer
Samuli Seppänen [Fri, 11 Feb 2011 14:25:40 +0000 (16:25 +0200)] 
Several modifications to win/make_dist.py to allow building the NSI installer

Added copying of all remaining openvpn dependencies to dist directory so that
the NSI installer script (win/openvpn.nsi) can find and use them more easily.
This includes openvpn.exe, openvpnserv.exe, libpkcs11-helper-1.dll, openssl.exe,
and example files. The associated, external DDL/manifest files are copied also,
so that embedding them with mt.exe is easier. This is a temporary solution until
nmake makefiles are modified to automate this process, except for a few of the
library dependencies (lzo2.dll and libpkcs11-helper-1.dll).

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoAdded comments to win/build_ddk.py
Samuli Seppänen [Fri, 11 Feb 2011 14:22:51 +0000 (16:22 +0200)] 
Added comments to win/build_ddk.py

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoAdded openvpnserv.exe building to win/build.py
Samuli Seppänen [Fri, 11 Feb 2011 14:20:43 +0000 (16:20 +0200)] 
Added openvpnserv.exe building to win/build.py

Made win/build.py call nmake in service-win32 directory to build openvpnserv.exe
after main build (openvpn.exe) has finished.

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoAdded configure.h and version.m4 variable parsing to win/config.py
Samuli Seppänen [Fri, 11 Feb 2011 14:16:14 +0000 (16:16 +0200)] 
Added configure.h and version.m4 variable parsing to win/config.py

Python-based buildsystem uses win/config.py to obtain global build parameters
from various sources. Added parsing of the (fake) configure.h and version.m4 to
it so that other Python build files can use them.

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoAdded command-line switch to win/build_all.py to skip TAP driver building
Samuli Seppänen [Fri, 11 Feb 2011 14:14:28 +0000 (16:14 +0200)] 
Added command-line switch to win/build_all.py to skip TAP driver building

Modified win/build_all.py so that by giving -n or --notap switch the TAP driver
is not built. This is useful if using prebuilt TAP drivers, or when WinDDK is
not installed.

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoAdded comments and made small modifications to win/msvc.mak.in
Samuli Seppänen [Fri, 11 Feb 2011 14:06:05 +0000 (16:06 +0200)] 
Added comments and made small modifications to win/msvc.mak.in

The win/msvc.mak.in file is used as basis for msvc.mak file which drives
openvpn.exe building. This change separates output file from LINK32_FLAGS and
adds helpful comments to the win/msvc.mak.in file.

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoAdded support for viewing config-win32.h paramters to win/show.py
Samuli Seppänen [Fri, 11 Feb 2011 14:03:31 +0000 (16:03 +0200)] 
Added support for viewing config-win32.h paramters to win/show.py

The win/show.py tools is used to view build parameters interactively. This
changes it so that it displays parameters parsed from config-win32.h in addition
to those from win/settings.in.

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoAdded helper functionality to win/wb.py
Samuli Seppänen [Fri, 11 Feb 2011 13:53:19 +0000 (15:53 +0200)] 
Added helper functionality to win/wb.py

This change adds several helper functions to win/wb.py:

- config-win32.h parser (to read build configuration options)
- helper function to cd to service-win32 for openvpnserv.exe building
- code to dynamically generate TAP-driver -related variables from version.m4,
  required by tap-win32/tapdrv.c
- configure.h generator to allow viewing build options using openvpn --version
- creation of temporary version.m4-based file to allow importing it's variables
  to the NSI installer script (win/openvpn.nsi)
- helper function to rename files (used in win/make_dist.py)

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoMoved TAP-driver version info to version.m4. Cleaned up win/settings.in.
Samuli Seppänen [Fri, 11 Feb 2011 13:28:13 +0000 (15:28 +0200)] 
Moved TAP-driver version info to version.m4. Cleaned up win/settings.in.

Previously parts of TAP-driver version information were stored in
win/settings.in. This patch moves all of it to version.m4. This patch also
cleans up and adds comments to win/settings.in

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoAdded a nmake makefile for openvpnserv.exe building
Samuli Seppänen [Fri, 11 Feb 2011 13:15:51 +0000 (15:15 +0200)] 
Added a nmake makefile for openvpnserv.exe building

This change adds a nmake makefile (service-win32/msvc.mak) which allows building
openvpnserv.exe using the new Python-based buildsystem.

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoAdded ENABLE_PASSWORD_SAVE to config-win32.h
Samuli Seppänen [Fri, 11 Feb 2011 13:11:51 +0000 (15:11 +0200)] 
Added ENABLE_PASSWORD_SAVE to config-win32.h

This change adds ENABLE_PASSWORD_SAVE to config-win32.h. This option is also
defined in win/settings.in, but it does not have any effect there.

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFix compiler warning when compiling against OpenSSL 1.0.0
David Sommerseth [Thu, 6 Jan 2011 18:31:34 +0000 (19:31 +0100)] 
Fix compiler warning when compiling against OpenSSL 1.0.0

The declaration of  SSL_get_current_cipher() has changed to be
return a const value.  And this makes compilers a little bit grumpy.

gcc:
  ssl.c: In function ‘print_details’:
  ssl.c:1918: warning: assignment discards qualifiers from pointer target type

Visual C:
  ssl.c (1918): warning C4019: '=' : different 'const' qualifiers

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 7bd3cea4c2f2aa8ed1bf548a3233ae2c3619d47d)

14 years agoMinor addition of logging info before and after
James Yonan [Fri, 10 Dec 2010 21:17:36 +0000 (21:17 +0000)] 
Minor addition of logging info before and after
execution of Windows net commands.

Version 2.1.3d

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6712 e7ae566f-a301-0410-adde-c780ea21d3b5

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
(cherry picked from commit 7621741b480f93411928c66735d2ee9c7f69de3b)

14 years agoMake the --x509-username-field feature an opt-in feature
David Sommerseth [Wed, 15 Dec 2010 09:53:04 +0000 (10:53 +0100)] 
Make the --x509-username-field feature an opt-in feature

After some discussion [1] regarding an extension of this feature,
James Yonan wanted this extension to be an opt-in feature.  However,
as it does not make sense to opt-in on a extension of a feature which
was discussed, this patch makes the base feature an opt-in instead.

The base feature comes from commit 2e8337de248ef0b5b48cbb2964 (beta2.2)
and commit 935c62be9c0c8a256112 (feat_misc).

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

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: James Yonan <james@openvpn.net>
(cherry picked from commit 024972e2ced84c6e5cabc43620ab510e5693d1d4)

14 years agoChange variadic macros to C99 style.
Matthias Andree [Sat, 4 Dec 2010 02:51:11 +0000 (03:51 +0100)] 
Change variadic macros to C99 style.

The macros used GCC's pre-C99 syntax, which could not be compiled with
Microsoft Visual Studio 2008.

Note this breaks compatibility with GCC versions before 3.0, which is
deemed safe in a discussion on IRC with David Sommerseth and Samuli
Seppänen on #openvpn-devel (RHEL 3 uses GCC 3.2 already).

Compiled tested on VS2008 by Samuli, on Cygwin GCC 3.4 and GCC 4.3 by myself.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
(cherry picked from commit 9469168e3abb09bd78297208a917ee4d9c025041)

14 years agoPrepared v2.2-beta5 for release v2.2-beta5
David Sommerseth [Thu, 25 Nov 2010 20:45:26 +0000 (21:45 +0100)] 
Prepared v2.2-beta5 for release

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoMerge branch 'feat_misc' into beta2.2
David Sommerseth [Thu, 25 Nov 2010 20:28:10 +0000 (21:28 +0100)] 
Merge branch 'feat_misc' into beta2.2

14 years agoFixed an issue causing a build failure with MS Visual Studio 2008.
Samuli Seppänen [Thu, 25 Nov 2010 19:48:34 +0000 (21:48 +0200)] 
Fixed an issue causing a build failure with MS Visual Studio 2008.

The new SOCKS auth code in socks.c contained a call to sprintf instead of
openvpn_sprintf. This caused build to fail if MS Visual Studio 2008 C compiler
was used. This change fixes that issue.

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoPrepared for v2.2-beta4 for release v2.2-beta4
David Sommerseth [Sun, 21 Nov 2010 15:04:54 +0000 (16:04 +0100)] 
Prepared for v2.2-beta4 for release

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoUpdated ChangeLog with info about last merges
David Sommerseth [Thu, 18 Nov 2010 21:33:47 +0000 (22:33 +0100)] 
Updated ChangeLog with info about last merges

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoMerge branch 'feat_misc' into beta2.2
David Sommerseth [Thu, 18 Nov 2010 21:17:58 +0000 (22:17 +0100)] 
Merge branch 'feat_misc' into beta2.2

Conflicts:
acinclude.m4
config-win32.h
configure.ac
misc.c
thread.c
thread.h
        - These conflicts was mainly due to feat_misc getting old
          and mostly caused by the pthread clean-up patches in
          feat_misc

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoMerge branch 'bugfix2.1' into beta2.2
David Sommerseth [Thu, 18 Nov 2010 18:10:08 +0000 (19:10 +0100)] 
Merge branch 'bugfix2.1' into beta2.2

14 years agoAdded command-line option parser and an unsigned build option to build_all.py
Samuli Seppänen [Thu, 18 Nov 2010 16:00:54 +0000 (18:00 +0200)] 
Added command-line option parser and an unsigned build option to build_all.py

Modified win/build_all.py so that it parses command-line options using getopt.
Added option "-u / --unsigned" which allows forcing unsigned builds and a "-h /
--help" option. By default a signed build is generated, provided that the Python
SignTool module is installed. If not, the build is interrupted.

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: Peter Stuge <peter@stuge.se>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoMerged add_bypass_address() and add_host_route_if_nonlocal()
David Sommerseth [Mon, 15 Nov 2010 08:00:12 +0000 (09:00 +0100)] 
Merged add_bypass_address() and add_host_route_if_nonlocal()

The add_host_route_if_nonlocal() function is too simple to really
benefit from calling add_bypass_address() when this function is the
only caller to this function.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Peter Stuge <peter@stuge.se>
14 years agoRemoved functions not being used anywhere
David Sommerseth [Mon, 15 Nov 2010 07:58:36 +0000 (08:58 +0100)] 
Removed functions not being used anywhere

The GNU C compiler gave warnings about these functions in the patch
not being used anywhere.  Doing a git grep on the code turned out
there were no callers to these functions.  Taking these functions out,
as there is not good reason why to carry dead code.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Peter Stuge <peter@stuge.se>
14 years agoOnly add some functions when really needed
David Sommerseth [Mon, 15 Nov 2010 07:56:18 +0000 (08:56 +0100)] 
Only add some functions when really needed

The GNU C compiler gave warnings about some functions not being used.
These functions where only used if certian #ifdef sections was enabled.

This patch encapsulates these function declarations with matching #ifdef's
to make it more clear when these functions are needed.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Peter Stuge <peter@stuge.se>
14 years agoFixed potential misinterpretation of boolean logic
David Sommerseth [Mon, 15 Nov 2010 07:53:40 +0000 (08:53 +0100)] 
Fixed potential misinterpretation of boolean logic

The GNU C compiler warned about a potential issue with an if()
expression missing an extra set of parentheses.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Peter Stuge <peter@stuge.se>
14 years agoFix compiler warnings about not used dummy() functions
David Sommerseth [Mon, 15 Nov 2010 07:48:57 +0000 (08:48 +0100)] 
Fix compiler warnings about not used dummy() functions

It has been reported that the Microsoft Visual C compiler complains if
a .c file do not contain any compilable code, which can happen if the
code has been #ifdef'ed out.  To avoid this, these #ifdef sections have
a #else section which adds a static dummy() function which does nothing.

On the other hand, the GNU C compiler complains about unused functions when
it discovers this situation.

This patch tries to only add these dummy() functions if the Microsoft Visual C
compiler is detected, via the _MSC_VER macro.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Peter Stuge <peter@stuge.se>
14 years agoUse stricter snprintf() formatting in socks_username_password_auth() (v3)
David Sommerseth [Mon, 15 Nov 2010 20:44:59 +0000 (21:44 +0100)] 
Use stricter snprintf() formatting in socks_username_password_auth() (v3)

commit fc1fa9ffc7e3356458ec3 added a new function which needs to have a
stricter string formatting.  This was detected due to a compiler warning.

This patch makes sure that the length of username and password is not longer
than 255 bytes.  It also adds extra checks to avoid NULL pointer issues with
strlen() on these two parameters.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
14 years agoMerge branch 'svn-BETA21' into bugfix2.1
David Sommerseth [Thu, 18 Nov 2010 17:47:06 +0000 (18:47 +0100)] 
Merge branch 'svn-BETA21' into bugfix2.1

14 years agoFixes to prevent compile breakage when --disable-crypto is used.
James Yonan [Tue, 16 Nov 2010 09:10:39 +0000 (09:10 +0000)] 
Fixes to prevent compile breakage when --disable-crypto is used.

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6656 e7ae566f-a301-0410-adde-c780ea21d3b5

14 years agoIn verify_callback, the subject var should be freed by OPENSSL_free,
James Yonan [Tue, 16 Nov 2010 08:36:18 +0000 (08:36 +0000)] 
In verify_callback, the subject var should be freed by OPENSSL_free,
not free, since it is allocated by OpenSSL.

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6655 e7ae566f-a301-0410-adde-c780ea21d3b5

14 years agoMerge branch 'bugfix2.1' into beta2.2
David Sommerseth [Sun, 14 Nov 2010 22:48:49 +0000 (23:48 +0100)] 
Merge branch 'bugfix2.1' into beta2.2

Conflicts:
options.c
- Disagreements about a new included file (forward.h)

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFixed compiling issues when using --disable-crypto
James Yonan [Sun, 14 Nov 2010 22:38:47 +0000 (23:38 +0100)] 
Fixed compiling issues when using --disable-crypto

Peter Korsgaard <jacmet@sunsite.dk> reported an issue [1] when compiling
with --disable-crypto activated.  He suggested a patch, which only
partly solved the issue.  SVN r6568 / commit 3cf9dd88fd84108 added a
new feature which further made it impossible to compile without crypto.

This patch fixes both issues, based on Peter Korsgaard's patch.

[1] <http://sourceforge.net/mailarchive/forum.php?thread_name=87fwx08bod.fsf%40macbook.be.48ers.dk&forum_name=openvpn-devel>

Signed-off-by: James Yonan <james@openvpn.net>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoRemove hardcoded path to resolvconf
Jesse Young [Mon, 1 Nov 2010 16:33:26 +0000 (11:33 -0500)] 
Remove hardcoded path to resolvconf

Signed-off-by: Jesse Young <jesse.young@gmail.com>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoClean-up: Removing useless code - hash related functions
David Sommerseth [Sat, 28 Aug 2010 18:52:19 +0000 (20:52 +0200)] 
Clean-up: Removing useless code - hash related functions

Removed even more function which where practically empty and took away
some function arguments which were not used.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: James Yonan <james@openvpn.net>
14 years agoClean-up: Remove more dead and inactive code paths
David Sommerseth [Sat, 28 Aug 2010 18:44:07 +0000 (20:44 +0200)] 
Clean-up: Remove more dead and inactive code paths

These code paths was practically not needed with no locking mechanisms
enabled and was just bloating the source code.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: James Yonan <james@openvpn.net>
14 years agoClean-up: Remove pthread and mutex locking code
David Sommerseth [Sat, 28 Aug 2010 18:14:36 +0000 (20:14 +0200)] 
Clean-up: Remove pthread and mutex locking code

This code was not activated at all, and hard coded as disabled in syshead.h
with this code snippet:

   /*
    * Pthread support is currently experimental (and quite unfinished).
    */
   #if 1 /* JYFIXME -- if defined, disable pthread */
   #undef USE_PTHREAD
   #endif

So no matter if --enable-pthread when running ./configure or not, this feature
was never enabled in reality.  Further, by removing the blocker code above made
OpenVPN uncompilable in the current state.

As the threading part needs to be completely rewritten and pthreading will not be
supported in OpenVPN 2.x, removing this code seems most reasonable.

In addition, a lot of mutex locking code was also removed, as they were practically
NOP functions, due to pthreading being forcefully disabled

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: James Yonan <james@openvpn.net>
14 years agoMerge branch 'feat_misc' into beta2.2
David Sommerseth [Sun, 14 Nov 2010 11:42:38 +0000 (12:42 +0100)] 
Merge branch 'feat_misc' into beta2.2

14 years agoAdded check for variable CONFIGURE_DEFINES into options.c
Samuli Seppänen [Fri, 12 Nov 2010 15:30:07 +0000 (17:30 +0200)] 
Added check for variable CONFIGURE_DEFINES into options.c

The file containing CONFIGURE_DEFINES variable, configure.h, is not present if
openvpn is built using the Python + Visual C -based buildsystem. This causes the
build to fail. This patch adds a check to see if variable exists before trying
to use it.

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: Peter Stuge <peter@stuge.se>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoMerge branch 'feat_misc' into beta2.2
David Sommerseth [Fri, 12 Nov 2010 23:55:02 +0000 (00:55 +0100)] 
Merge branch 'feat_misc' into beta2.2

Conflicts:
Makefile.am
openvpn.8
options.c
socket.c
ssl.c
- feat_misc is missing a lot of bugfix2.1 changes

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoMerge branch 'bugfix2.1' into beta2.2
David Sommerseth [Fri, 12 Nov 2010 23:49:05 +0000 (00:49 +0100)] 
Merge branch 'bugfix2.1' into beta2.2

14 years agoMerge branch 'svn-BETA21' into beta2.2
David Sommerseth [Fri, 12 Nov 2010 23:48:28 +0000 (00:48 +0100)] 
Merge branch 'svn-BETA21' into beta2.2

Conflicts:
version.m4
- Reset version.m4 to a more neutral version number

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoMerge branch 'svn-BETA21' into bugfix2.1
David Sommerseth [Fri, 12 Nov 2010 23:46:13 +0000 (00:46 +0100)] 
Merge branch 'svn-BETA21' into bugfix2.1

14 years agoClarified --explicit-exit-notify man page entry
David Sommerseth [Fri, 12 Nov 2010 22:10:32 +0000 (23:10 +0100)] 
Clarified --explicit-exit-notify man page entry

Reformulated parts of this entry to clarify that the OpenVPN
will not attempt notifying the server unless this option is used.

This misunderstanding was reported anonymously to the old SF.net
tracker.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Trac-ticket: 40

14 years agoImproved man page entry for script_type
Gert Doering [Thu, 21 Oct 2010 11:13:21 +0000 (13:13 +0200)] 
Improved man page entry for script_type

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: krzee <jeff@doeshosting.com>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoAdd HTTP/1.1 Host header
Lars Hupel [Thu, 30 Sep 2010 00:27:36 +0000 (01:27 +0100)] 
Add HTTP/1.1 Host header

OpenVPN should send a Host: header to comply with the HTTP/1.1
specification.

Full discussion of this patch can be found here:
<http://thread.gmane.org/gmane.network.openvpn.devel/4039>

Signed-off-by: Lars Hupel <hupel@in.tum.de>
Acked-by: Peter Stuge <peter@stuge.se>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Trac-ticket: 63

14 years agoMake "topology subnet" work on Solaris (ifconfig + route metric changes by Kazuyoshi...
Gert Doering [Sat, 30 Oct 2010 19:03:16 +0000 (21:03 +0200)] 
Make "topology subnet" work on Solaris (ifconfig + route metric changes by Kazuyoshi Aizawa, adding of local "connected subnet" route by me)

Tested on OpenSolaris/i386, no impact for other TARGETs.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Kazuyoshi Aizawa <admin2@whiteboard.ne.jp>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoIntegrate support for TAP mode on Solaris, written by Kazuyoshi Aizawa <admin2@whiteb...
Gert Doering [Fri, 29 Oct 2010 15:41:53 +0000 (17:41 +0200)] 
Integrate support for TAP mode on Solaris, written by Kazuyoshi Aizawa <admin2@whiteboard.ne.jp>.

See also http://www.whiteboard.ne.jp/~admin2/tuntap/

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Kazuyoshi Aizawa <admin2@whiteboard.ne.jp>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoAdding support for SOCKS plain text authentication
Pierre Bourdon [Sun, 10 Oct 2010 22:56:04 +0000 (00:56 +0200)] 
Adding support for SOCKS plain text authentication

This patch adds support for SOCKS plain text (username/password)
authentication as described in RFC 1929. It adds an optional third
parameter to the socks-proxy option, which is a file containing the
login credentials.

I've been using this patch for two weeks now and it does not seem to
cause any problem. The only modifications are in the SOCKS handshake
handling and the options parser.

Signed-Off-By: Pierre Bourdon <delroth@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoVersion 2.1.3b
James Yonan [Thu, 28 Oct 2010 05:01:24 +0000 (05:01 +0000)] 
Version 2.1.3b

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6585 e7ae566f-a301-0410-adde-c780ea21d3b5

14 years agoMake base64.h have the same conditional compilation expression as
James Yonan [Sun, 24 Oct 2010 09:17:24 +0000 (09:17 +0000)] 
Make base64.h have the same conditional compilation expression as
base64.c.

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6569 e7ae566f-a301-0410-adde-c780ea21d3b5

14 years agoImplement challenge/response authentication support in client mode,
James Yonan [Sun, 24 Oct 2010 09:12:47 +0000 (09:12 +0000)] 
Implement challenge/response authentication support in client mode,
where credentials are entered from stdin.  This capability is
compiled when ENABLE_CLIENT_CR is defined in syshead.h (enabled
by default).

Challenge/response support was previously implemented for creds
that are queried via the management interface.  In this case,
the challenge message will be returned as a custom
client-reason-text string (see management-notes.txt for more
info) on auth failure.

Also, see the comments in misc.c above get_auth_challenge()
for info on the OpenVPN challenge/response protocol.

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6568 e7ae566f-a301-0410-adde-c780ea21d3b5

14 years agoFixed initialization bug in route_list_add_default_gateway
James Yonan [Sat, 23 Oct 2010 22:32:00 +0000 (22:32 +0000)] 
Fixed initialization bug in route_list_add_default_gateway
(Gert Doering).

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6566 e7ae566f-a301-0410-adde-c780ea21d3b5

14 years agoPreparing for v2.2-beta3
David Sommerseth [Sat, 21 Aug 2010 21:46:30 +0000 (23:46 +0200)] 
Preparing for v2.2-beta3

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFixed compiler warning in ssl.c
David Sommerseth [Mon, 16 Aug 2010 18:23:49 +0000 (20:23 +0200)] 
Fixed compiler warning in ssl.c

James Yonan noticed a couple of compiler warnings when compiling with
--enable-strict configured.  This patch was sent directly to him
for review and got accepted.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: James Yonan <james@openvpn.net>
14 years agoSolved hidden merge conflict between feat_misc and bugfix2.1
David Sommerseth [Thu, 22 Apr 2010 21:29:34 +0000 (23:29 +0200)] 
Solved hidden merge conflict between feat_misc and bugfix2.1

The OCSP patch (commit a3982181e284f8c5c8f, feat_misc) introduced
a new function which was calling create_temp_filename().  When merging
in bugfix2.1 into allmerged, create_temp_filename() got renamed to
create_temp_file() in commit 5d30273a8741d2c141.

This patch only changes create_temp_filename() to create_temp_file()
in the new function introduced by commit a3982181e284f8c5c8f.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
(cherry picked from commit 926d1662e4d9e14b50eddec993b2f4e0209c0646)

14 years agoFixed static defined length check to use sizeof()
Emilien Mantel [Sat, 26 Jun 2010 11:56:48 +0000 (13:56 +0200)] 
Fixed static defined length check to use sizeof()

This comes in addition to commit 935c62be9c0c8a256112d after some
additional review comments.

Signed-off-by: Emilien Mantel <emilien.mantel@businessdecision.com>
Acked-by: Peter Stuge <peter@stuge.se>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoChoose a different field in X509 to be username
Emilien Mantel [Thu, 17 Jun 2010 19:38:59 +0000 (21:38 +0200)] 
Choose a different field in X509 to be username

For my company, we use a PKI (linked to a LDAP) with OpenVPN. We can't use "CN" to be
username (few people can have the same "CN"). In our case, we only use the UID.

With my patch, you can choose another field to be username with a new option called
--x509-username-field, the default value is "CN".

Signed-off-by: Emilien Mantel <emilien.mantel@businessdecision.com>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agossl.c: fix use of openvpn_run_script()'s return value
Fabian Knittel [Tue, 4 May 2010 14:21:47 +0000 (16:21 +0200)] 
ssl.c: fix use of openvpn_run_script()'s return value

This patch fixes two bugs introduced in

    commit 339f2a4d4b487afa53fa99d72c35b16f31e417d3
    Author: David Sommerseth <dazo@users.sourceforge.net>
    Date:   Thu Apr 29 23:35:45 2010 +0200

David's patch replaced openvpn_execve() with openvpn_run_script() in two places,
but didn't adjust the return value handling.  openvpn_run_script() returns true
or false, while openvpn_execve() returns the program's exit code.

Without the fix, the --tls-verify script and the --auth-user-pass-verify
script fail to run.  (I noticed the latter, but haven't actually tested the
former.)

The return value handling is fine for the other places where
openvpn_run_script() is used, because those places previously used
openvpn_execve_check() (notice the "_check" suffix).

Signed-off-by: Fabian Knittel <fabian.knittel@avona.com>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoRevamped the script-security warning logging (version 2)
David Sommerseth [Thu, 29 Apr 2010 21:35:45 +0000 (23:35 +0200)] 
Revamped the script-security warning logging (version 2)

The main task of this patch is to avoid reporting the SCRIPT_SECURITY_WARNING
over and over again, in addition to not show this warning when it should not
be a problem.  This general warning should now only appear once, and only when
--script-security is not set, 0 or 1.  In all other cases this warning should
not appear.

In addition, this warning will come close to the script-hook which most probably
will fail.  It will also give a little bit more concrete hint on which script-hook
which failed.  If --script-security is 2 or 3, only the execve failure itself will
be shown.  This message will on the other hand be shown repeatedly.

This is a new rewritten version which simplifies the implementaion of the new
openvpn_run_script() function.  It was considered to remove it completely, but
due to code clearity and easy of use it was decided to make this function a static
inline function instead.  Anyhow, this function will enforce openvpn_execve_check()
to be called with the S_SCRIPT flag.

Patch ACKed on the developers meeting 2009-04-29.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: James Yonan <james@openvpn.net>
14 years agoDon't add compile time information if --enable-small is used
David Sommerseth [Thu, 22 Apr 2010 21:05:00 +0000 (23:05 +0200)] 
Don't add compile time information if --enable-small is used

This is to satisfy those wanting to build openvpn for embedded devices
where every bytes matters.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
14 years agoMake use of automake CLEANFILES variable instead of clean-local rule
David Sommerseth [Tue, 13 Apr 2010 13:12:27 +0000 (15:12 +0200)] 
Make use of automake CLEANFILES variable instead of clean-local rule

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
14 years agoFix dependency checking for configure.h (v2)
David Sommerseth [Thu, 22 Apr 2010 21:01:31 +0000 (23:01 +0200)] 
Fix dependency checking for configure.h (v2)

Alon Bar-Lev indicated commit f27bf509315a48b0070294c3993a718df0c2626c
was missing proper dependency checking.  This patch corrects this and
fixes an issue when creating configure.h via make distcheck.

This is an enhanced version of the one sent to the openvpn-devel mailing
list April 13, 2010 [1], after having received some feedback from Gert
Doering, cleaning up configure_log.awk further.

[1] <http://thread.gmane.org/gmane.network.openvpn.devel/3410/focus=3491>

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
14 years agoAdd comile time information/settings from ./configure to --version
David Sommerseth [Thu, 8 Apr 2010 18:31:01 +0000 (20:31 +0200)] 
Add comile time information/settings from ./configure to --version

This patch will create ./configure.h which will contain two new #define
strings.  CONFIGURE_DEFINES will contain all USE, ENABLED, DISABLED and
DEPRECATED defines from ./config.h.  CONFIGURE_CALL will contain the
complete ./configure line which was used when configuring the package
for building.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: James Yonan <james@openvpn.net>
14 years agopkitool lacks expected option "--help"
Wil Cooley [Tue, 2 Mar 2010 20:54:15 +0000 (21:54 +0100)] 
pkitool lacks expected option "--help"

The pkitool script lacks the "--help" parameter to actually display the
usage statement; most people are conditioned to try that before running the
command without options. This patch adds that and "--version" to display
just the program name and version.

sf.net tracker:
<https://sourceforge.net/tracker/?func=detail&atid=454721&aid=1705407&group_id=48978>

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Jan Just Keijser <janjust@nikhef.nl>
14 years agoSeveral updates to openvpn.8 (man page updates)
Karl O. Pinc [Tue, 2 Mar 2010 20:41:06 +0000 (21:41 +0100)] 
Several updates to openvpn.8 (man page updates)

This is a collection of 4 patches sent to the -devel mailing list:
* [PATCH] Frob the openvpn(8) man page tls-verify section to clarify
* [PATCH] More improvments to openvpn(8) --tls-verify
* [PATCH] Yet another tweak of openvpn(8) --tls-verify
* [PATCH] Final frobbing of openvpn(8) --tls-verify

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoenhance tls-verify possibility
Mathieu GIANNECCHINI [Mon, 1 Mar 2010 23:26:57 +0000 (00:26 +0100)] 
enhance tls-verify possibility

It should be nice to enhance tls-verify check possibilities against peer
cert during a pending TLS connection like :
- OCSP verification
- check any X509 extensions of the peer certificate
- delta CRL verification
- ...

This patch add a new "tls-export-cert" option which allow to get peer
certificate in PEM format and to store it in an openvpn temporary file.
Peer certificate is stored before tls-script execution and deleted after.
The name of the related temporary file is available under tls-verify
script by an environment variable "peer_cert".

The patch was made from OpenVPN svn Beta21 branches.

Here is a very simple exemple of Tls-verify script which provide OCSP
support to OpenVPN (with tls-export-cert option) without any OpenVPN
"core" modification :

X509=$2

openssl ocsp \
      -issuer /etc/openvpn/ssl.crt/RootCA.pem \
      -CAfile /etc/openvpn/ssl.capath/OpenVPNServeur-cafile.pem \
      -cert $peer_cert \
      -url http://your-ocsp-url
      if [ $? -ne 0 ]
      then
          echo "error : OCSP check failed for ${X509}" | logger -t
"tls-verify"
          exit 1
       fi

This has been discussed here:
<http://thread.gmane.org/gmane.network.openvpn.devel/2492>
<http://thread.gmane.org/gmane.network.openvpn.devel/3150>
<http://thread.gmane.org/gmane.network.openvpn.devel/3217>

This patch has been modified by David Sommerseth, by fixing a few issues
which came up to during the code review process.  The man page has been
updated and tmp_file in ssl.c is checked for not being NULL before calling
delete_file().

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
14 years agoReworked the eurephia patch for inclusion to the openvpn-testing tree
David Sommerseth [Mon, 15 Feb 2010 22:15:44 +0000 (23:15 +0100)] 
Reworked the eurephia patch for inclusion to the openvpn-testing tree

Addedd configure option (--disable-eurephia) to disable the code which the
eurephia plug-in depends on.

It was chosen to use --disable-eurephia, as this patch is not much intrusive.  It
just enables a SHA1 fingerprint environment variable for each certificate being
used for the connection.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFix problem with special case route targets ('remote_host')
Gert Doering [Thu, 21 Oct 2010 08:35:29 +0000 (10:35 +0200)] 
Fix problem with special case route targets ('remote_host')

The init_route() function will leave &netlist untouched for
get_special_addr() routes ("remote_host" being one of them).
netlist is on stack,  contains random garbage, and netlist.len
will not be 0 - thus, random stack data is copied from
netlist.data[] until the route_list is full.

This issue has been reported several places lately:
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=600166
   http://thread.gmane.org/gmane.network.openvpn.devel/4083
   https://forums.openvpn.net/viewtopic.php?f=1&t=7201&p=8168

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFixed compiler warnings reported on Ubuntu 10.04
David Sommerseth [Fri, 17 Sep 2010 15:10:25 +0000 (17:10 +0200)] 
Fixed compiler warnings reported on Ubuntu 10.04

The warnings reported where:
--------------------------------------------------------
misc.c:158: warning: ignoring return value of ‘nice’, declared with attribute warn_unused_result
options.c:4033: warning: format not a string literal and no format arguments
options.c:4043: warning: format not a string literal and no format arguments
options.c:4053: warning: format not a string literal and no format arguments
push.c:182: warning: format not a string literal and no format arguments
push.c:199: warning: format not a string literal and no format arguments
push.c:235: warning: format not a string literal and no format arguments
status.c:171: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result
--------------------------------------------------------

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Peter Stuge <peter@stuge.se>
14 years agoMore t_client.sh updates - exit with SKIP when we want to skip
David Sommerseth [Wed, 18 Aug 2010 15:05:09 +0000 (17:05 +0200)] 
More t_client.sh updates - exit with SKIP when we want to skip

Several places we exited with 0 instead of 77 when we want to indicate
that we should skip this test.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
14 years agoTest framework improvment - Do not FAIL if t_client.rc is missing
David Sommerseth [Wed, 18 Aug 2010 13:00:13 +0000 (15:00 +0200)] 
Test framework improvment - Do not FAIL if t_client.rc is missing

This is to avoid 'make check' fail if this extra test case is not
configured.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
14 years agoBuild t_client.sh by configure at run-time.
Gert Doering [Tue, 10 Aug 2010 10:39:28 +0000 (12:39 +0200)] 
Build t_client.sh by configure at run-time.

This is now built using "configure", knows how to find "ip", "ifconfig" and "netstat" (configure
does the work :-) ), *and* has been tested on Solaris (works!).

extend configure.ac to find "netstat" binary and to chmod +x "t_client.sh"

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agofull "VPN client connect" test framework for OpenVPN
Gert Doering [Sun, 8 Aug 2010 19:24:30 +0000 (21:24 +0200)] 
full "VPN client connect" test framework for OpenVPN

Run from "make check" if "t_client.rc" is found in workdir or srcdir
 (copy t_client.rc-sample, fill in specifics for your test server)

How does it work?

 - you run "sudo make check" (needs root access to configure tun if!)

 - t_client.sh reads t_client.rc from current dir or ${srcdir}

 - t_client.rc defines a number of "test suffixes" to run (could be
   "1" "2" "3" or "p2m", "p2p", "special" or whatever you like), and
   for each suffix, there's config variables to specify

    - how to call OpenVPN
    - which hosts to ping for IPv4 and IPv6 when OpenVPN is up
      (and actually before starting OpenVPN - to make the test more
      meaningful, I have decided that the test hosts must not ping
      before the tests starts)
    - which addresses must show up in the output of "ifconfig" after
      OpenVPN has started
    - all variables except OPENVPN_CONF_<x> are optional

   (this should all be fairly obvious from looking at t_client.rc-sample)

 - the script wants to connect to a well-defined OpenVPN server that
   will assign well-known IPv4 (and IPv6) addresses, have well-defined
   pingable addresse, etc. - so you need to setup the test server before
   the script is useful for you.  (Whether you use certificates or
   username/password is up to you, you could even mix and match - run
   one test with certs, and one with user/pass against different target
   ports... :-) )

   [we *could* run a "reference server" somewhere and ship a sample
   t_client.rc + cert so that users could use this right away, but I
   do not currently have the resources to run such a public server]

 - whatever the script does is logged to a newly created directory
   below the current directory (openvpn output, ifconfig+route before
   starting OpenVPN, while running it, after ending it)

 - important: at least on NetBSD and OpenBSD, the script will print
   one failure, because the tun0 interface created is not destroyed
   after openvpn ends.  For OpenBSD, I have changed close_tun() to
   do so ("ifconfig tun0 destroy"), for NetBSD I have not yet changed
   anything - but I strongly believe that the output of "ifconfig+route"
   should be reverted to exactly how it looked like before OpenVPN
   was started, so I consider this a bug in the NetBSD-specific bits
   of OpenVPN (and will look into this).

 - the test framework has been tested on Linux, NetBSD and OpenBSD.
   It *should* work fine on FreeBSD and Solaris.
   It works on MacOS X (but the output looks funny, because /bin/sh
   does not implement "echo -e" - need to add configure trickery)

   It will *not* work on Windows yet - I haven't looked into what's
   needed to make it work (background processes and signals in mingw
   bash?), maybe it's as easy as adding the necessary "ipconfig" and
   "netsh" commands to print interface + routing config...

 - I have only tested "connect via IPv4 transport, use IPv4+IPv6 payload",
   but the framework is generic enough that "connect via IPv6 transport"
   should work just fine (just setup OPENVPN_CONF_x accordingly in the
   t_client.rc).

 - this is neither finished nor pretty, but it helps me a *lot* in
   quickly testing whether I broke anything when fiddling system-dependent
   code (tun.c, route.c) across multiple build hosts - so I hope this
   is going to be fairly useful to Samuli and the buildbot :-)

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFixes openssl-1.0.0 compilation warning
chantra [Fri, 16 Jul 2010 18:09:07 +0000 (20:09 +0200)] 
Fixes openssl-1.0.0 compilation warning

When compiling against OpenSSL v1.0.0, the following compiler warnings
appears.

ssl.c: In function ‘verify_callback’:
ssl.c:944: warning: passing argument 1 of ‘sk_num’ from incompatible
pointer type
/usr/include/openssl/stack.h:79: note: expected ‘const struct _STACK *’
but argument is of type ‘struct stack_st_X509_REVOKED *’
ssl.c:947: warning: passing argument 1 of ‘sk_value’ from incompatible
pointer type
/usr/include/openssl/stack.h:80: note: expected ‘const struct _STACK *’
but argument is of type ‘struct stack_st_X509_REVOKED *’
ssl.c: In function ‘init_ssl’:
ssl.c:1565: warning: passing argument 1 of ‘sk_num’ from incompatible
pointer type
/usr/include/openssl/stack.h:79: note: expected ‘const struct _STACK *’
but argument is of type ‘struct stack_st_X509 *’
ssl.c: In function ‘print_details’:
ssl.c:1766: warning: assignment discards qualifiers from pointer target type

Trac ticket #5
https://community.openvpn.net/openvpn/ticket/5

Signed-off-by: chantra <chantra@debuntu.org>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFix <net/if.h> compile time problems on OpenBSD for good
Gert Doering [Sat, 10 Jul 2010 09:24:41 +0000 (11:24 +0200)] 
Fix <net/if.h> compile time problems on OpenBSD for good

Previous fix (commit eb973e055bc249948) fixed NetBSD but not OpenBSD
(include <sys/socket.h> *after* <sys/types.h>)

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: krzee <jeff@doeshosting.com>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFix compile problems on NetBSD and OpenBSD
Gert Doering [Fri, 9 Jul 2010 08:24:46 +0000 (10:24 +0200)] 
Fix compile problems on NetBSD and OpenBSD

Configure will not find <net/if.h> due to missing <sys/types.h> in the test program,
and thus, tun.c will fail to compile with missing symbol IFF_MULTICAST.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: krzee <jeff@doeshosting.com>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFix multiple configured scripts conflicts issue (version 2)
David Sommerseth [Thu, 5 Aug 2010 18:51:22 +0000 (20:51 +0200)] 
Fix multiple configured scripts conflicts issue (version 2)

This is a fix for trac ticket #20,
<https://community.openvpn.net/openvpn/ticket/20>
which was started in the sf.net bug tracker:
<http://sourceforge.net/tracker/?func=detail&aid=2078470&group_id=48978&atid=454719>

The implemented solution is to give a warning for each of the different script hooks
available.  The last configured script will override any earlier configured scripts,
to ensure that the command line can override the configuration file.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: James Yonan <james@openvpn.net>
14 years agoExclude ping and control packets from activity
Davide Brini [Sun, 2 May 2010 09:07:38 +0000 (11:07 +0200)] 
Exclude ping and control packets from activity

Problem: using --ping and --inactive together partially defeats the
point of using --inactive as periodic ping packets are counted as
activity. Here is the original discussion:

http://article.gmane.org/gmane.network.openvpn.devel/3676

It turns out that "activity" is detected and recorded in two places
in the code, both in forward.c: in process_outgoing_tun() for received
packets, after they've been decrypted and sent to the TUN device; and
in process_outgoing_link(), after they've been encrypted and written
to the network socket.

In the first case we can be sure that packets that get so far are
really due to user activity, whereas in the second case there can be
non-user packets (like OpenVPN's internal ping packets, and TLS control
packets), and those should not be counted as activity as they are not
coming from the user.

So a need arises to detect those control packets and not count them as
activity for the purposes of --inactive. Unfortunately, at that stage
packets are already compressed and encrypted, so it's not possible to
look into them to see what they are. However, there seems to be a
convention in the code that packets whose buffer length in the context_2
structure is 0 should be ignored for certain purposes. TLS control
packets follow that convention already, so this patch makes a small
change in the code that generates the ping packets to set their buffer
length to 0 as well.
Finally, the call to register_activity() in process_outgoing_link() is
made conditional to the buffer length being > 0.

According to my tests, now --inactive behaves correctly according to
the configured parameters (time or time+bytes) even when --ping is
being used.

forward.c:
    Call register_activity() in process_outgoing_link() only if the
    packet is not a ping or TLS control packet.

openvpn.8:
    Updated the description of --inactive to describe the new semantics.

ping.c:
    Set c->c2.buf.len = 0 after the ping packet has been generated and
    encrypted.

Test routine is described here:
<https://community.openvpn.net/openvpn/wiki/PingInactivePatch?version=6>

Signed-off-by: Davide Brini <dave_br@gmx.com>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFix errors in openvpn-plugin.h documentation
chantra [Fri, 30 Jul 2010 18:48:50 +0000 (20:48 +0200)] 
Fix errors in openvpn-plugin.h documentation

Just minor updates to comments in openvpn-plugin.h

Signed-off-by: chantra <chantra@debuntu.org>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFixed client hang when server don't PUSH (aka the NO_SOUP_FOR_YOU patch)
David Sommerseth [Sat, 12 Jun 2010 22:35:55 +0000 (00:35 +0200)] 
Fixed client hang when server don't PUSH (aka the NO_SOUP_FOR_YOU patch)

Solves bug ticket 13
<https://community.openvpn.net/openvpn/ticket/13>

When the client sends PUSH_REQUESTS, it waits until the server sends PUSH_REPLY.
If the server do not have anything to push to the client nothing happens.  The
client will then regularly send new PUSH_REQUESTS until it gets an answer, which
results in not completing the connection negotiation.

This patch makes the server send an empty PUSH_REPLY when it has nothing to more
to push to the client.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: James Yonan <james@openvpn.net>
14 years agoHandle non standard subnets in PF grammar
chantra [Fri, 11 Jun 2010 14:23:03 +0000 (16:23 +0200)] 
Handle non standard subnets in PF grammar

Allow subnets for like 192.168.100.8/28 to be understood.  A warning
will be logged when subnet is incorrect and is being corrected to what
is assumed to be correct.

Signed-off-by: chantra <chantra@debuntu.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoOCSP_check.sh: new check logic
David Sommerseth [Sun, 16 May 2010 17:42:40 +0000 (19:42 +0200)] 
OCSP_check.sh: new check logic

contrib/OCSP_check/OCSP_check.sh:
  I discovered that, quite surprisingly, the exit status of "openssl ocsp"
  is 0 even if the certificate status is "revoked". This means that the
  logic of the script needs to be rewritten so that it parses the output
  returned by the query and explicitly looks for a

  "0x<serial number>: good"

  line, and exit if either the command has a non-zero exit status, or the
  above line is not found.

  Doing that portably without bashisms requires some juggling around, so
  perhaps the code is slightly less clean now, but it does have many
  comments.

Signed-off-by: Davide Brini <dave_br@gmx.com>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoAvoid repetition of "this config may cache passwords in memory" (v2)
David Sommerseth [Mon, 26 Apr 2010 07:50:30 +0000 (09:50 +0200)] 
Avoid repetition of "this config may cache passwords in memory" (v2)

For OpenVPN clients with long living connections, this message is repeated
everytime the connection is renegotiated.  This patch removes this behaviour
and will only show this warning once.

Patch ACKed on the developers meeting 2009-04-29.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: James Yonan <james@openvpn.net>
14 years agoFix certificate serial number export
Davide Brini [Tue, 27 Apr 2010 11:20:05 +0000 (12:20 +0100)] 
Fix certificate serial number export

    contrib/OCSP_check/OCSP_check.sh:
             New barebone script to demonstrate how to use $tls_serial_{n}
             to perform simple OCSP queries using OpenSSL command line
             "openssl ocsp". Minimal sanity checks to fail if user tries to
             use it without customizing.

    openvpn.8:
             Added some notes about $tls_serial_{n} format and usage to the
             existing description.

    ssl.c:
             correctly manage and export serial numbers of any size (as
             parsed by OpenSSL) into the environment. Set to empty string
             in case of errors, as 0 and negative numbers are all possible
             (although illegal) certificate serial numbers. Use an OpenSSL
             BIO object to do the job. Conforms to coding style guidelines.

    See the discussion at

    http://article.gmane.org/gmane.network.openvpn.devel/3588

    for more details.

Signed-off-by: Davide Brini <dave_br@gmx.com>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFix missing /bin/bash -> /bin/sh
Davide Brini [Thu, 22 Apr 2010 07:50:31 +0000 (09:50 +0200)] 
Fix missing /bin/bash -> /bin/sh

In commit a9c9a89e96dc1e4e843e05ecadc4349b81606b06 the
client.{up,down} scripts where overhauled and bashism was removed.
During that process, a #! change was missing.

Signed-off-by: Davide Brini <dave_br@gmx.com>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoEnhance contrib/pull-resolv-conf/client.{up,down} scripts
Davide Brini [Mon, 19 Apr 2010 20:41:42 +0000 (22:41 +0200)] 
Enhance contrib/pull-resolv-conf/client.{up,down} scripts

Patch arrived from Davide Brini:

- No more bashisms (AFAICT). Should work with any POSIX-compatible shell
(which means "almost all reasonably recent shells"), though I've only tested
with bash and dash.

- Unnecessary calls to external tools (sed) removed

- Manages multiple DNS and DOMAIN options. Each DNS option becomes a
"nameserver" line in the new resolv.conf (up to a maximum of 3). If there's a
single DOMAIN option, it becomes a "domain" line in resolv.conf; otherwise,
all the domains are listed in a "search" line in resolv.conf (eg "search
foo.com example.net").

- Client.up renames the existing resolv.conf and creates a brand new one;
client.down restores it from the saved copy when the VPN terminates (the usual
rules about running as root apply). This is how Gentoo does that; the old
scripts instead added/removed some lines at the beginning of the file, which
looks a less clean approach to me. The rename approach also dramatically
simplifies and shortens client.down, as you'll see.

- Uses resolvconf if it's available (detected by the presence of
/sbin/resolvconf) rather than writing to resolv.conf directly. Not sure
whether this is a Linux-only thing or other systems use it though.

Script has been smoke tested on Fedora 12 with OpenVPN 2.1.1 without
the resolvconf package , and in addition Debian Lenny with
OpenVPN 2.1_rc11 according to the patch.

Signed-off-by: Davide Brini <dave_br@gmx.com>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoThe man page does not mention that the default value of "mssfix" is 1450.
Davide Brini [Sun, 18 Apr 2010 22:23:52 +0000 (00:23 +0200)] 
The man page does not mention that the default value of "mssfix" is 1450.

Signed-off-by: Davide Brini <dave_br@gmx.com>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFixed potential NULL pointer issue
David Sommerseth [Sat, 17 Apr 2010 19:03:06 +0000 (21:03 +0200)] 
Fixed potential NULL pointer issue

If create_temp_file() returns NULL, this strlen() check would cause
a SEGV.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
14 years agoRemoved no longer needed delete_file() call
David Sommerseth [Sat, 17 Apr 2010 19:01:20 +0000 (21:01 +0200)] 
Removed no longer needed delete_file() call

Fabian Knittel noticed that this delete_file() calls should have been
removed in commit 5d30273a8741d2c1410bfdbc08b341398bf39b40

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
14 years agoUpdated the man page to reflect the behavioural change of create_temp_file()
David Sommerseth [Fri, 16 Apr 2010 20:11:59 +0000 (22:11 +0200)] 
Updated the man page to reflect the behavioural change of create_temp_file()

As this function now creates the temp file, it is no longer
'not-yet-created', but 'freshly created'.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
14 years agoRenamed all calls to create_temp_filename()
David Sommerseth [Fri, 16 Apr 2010 20:09:48 +0000 (22:09 +0200)] 
Renamed all calls to create_temp_filename()

All places where create_temp_filename() was called are now calling
create_temp_file().  Extra checks on the result of create_temp_file()
is added in addition.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
14 years agoHarden create_temp_filename() (version 2)
David Sommerseth [Fri, 16 Apr 2010 20:02:36 +0000 (22:02 +0200)] 
Harden create_temp_filename() (version 2)

By hardening the create_temp_filename() function to check if the generated
filename exists and to create the temp file with only S_IRUSR|S_IWUSR bit
files set before calling the script, it should become even more difficult to
exploit such a scenario.

After a discussion on the mailing list, Fabian Knittel provided an enhanced
version of the inital patch which is added to this patch.

This patch also renames create_temp_filename() to create_temp_file(), as this
patch also creates the temporary file.  The function returns the filename of the
created file, or NULL on error.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: Fabian Knittel <fabian.knittel@avona.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
14 years agoMake use of counter_type instead of int when counting bytes and network packets
David Sommerseth [Thu, 8 Apr 2010 19:18:42 +0000 (21:18 +0200)] 
Make use of counter_type instead of int when counting bytes and network packets

This is in response to a reported Debian bug, where the connection counter overflows.
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576827>

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
14 years agoThe man page needs dash escaping in UTF-8 environments
Jan Brinkmann [Sun, 28 Feb 2010 22:29:29 +0000 (23:29 +0100)] 
The man page needs dash escaping in UTF-8 environments

There was a debian bugreport which was filed in 2005 . It was patched but
it seems that nobody forwarded the patch to the openvpn project itself.

The problem is quite simple:
The dashes for options (the double dashes) are not escaped. This causes
trouble in relationship with utf-8 .

Since the bugreport was closed it was patched within the debian/ubuntu
packages itself. I've attached the patch to get it atleast reviewed by the
openvpn project itself.

See <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=296133> for details.

sf.net tracker:
<https://sourceforge.net/tracker/?func=detail&aid=2935611&group_id=48978&atid=454721>

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Tested-by: Jan Just Keijser <janjust@nikhef.nl>
Tested-by: Pavel Shramov <shramov@mexmat.net>
Tested-by: Samuli Seppänen <samuli@openvpn.net>
14 years agoWhen I began testing OpenVPN v2.1_rc9 I was having trouble authenticating to the...
Daniel Johnson [Tue, 30 Mar 2010 13:54:44 +0000 (15:54 +0200)] 
When I began testing OpenVPN v2.1_rc9 I was having trouble authenticating to the MS Active Directory through auth-pam and Samba. I used the following line in my configs (without the linebreak of course):

plugin /opt/openvpn/openvpn-auth-pam.so
                   "openvpn login OURDOMAIN+USERNAME password PASSWORD"

Finally I turned on more verbose logging and found that the plugin did
not recognize "USERNAME" as something to replace, because it expected
the string to be surrounded by whitespace.  I wrote the following patch
to correct this.  I hope you find it useful,

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoDebian patch: Fix spelling in log message
Alberto Gonzalez Iniesta [Tue, 16 Mar 2010 22:03:10 +0000 (23:03 +0100)] 
Debian patch: Fix spelling in log message

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
14 years agoFix autotools cross-compiling support
David Sommerseth [Thu, 11 Mar 2010 16:28:41 +0000 (17:28 +0100)] 
Fix autotools cross-compiling support

This is a modified version of a patch sent to the sf.net
patch tracker:

<http://sourceforge.net/tracker/?func=detail&aid=2491190&group_id=48978&atid=454721>

After having disucssed this patch on IRC (#openvpn-discussions)
March 4, 2010, it was decided to accept this patch when not modifying
TARGET_* defines through out the code.  Further, in a mail comment
Alon Bar-Lev had some other comments of what would be needed to be done.

Mail reference:
<http://thread.gmane.org/gmane.network.openvpn.devel/3176>

This patch has been tested by bootstrapping the code on a RHEL4.6 box.
with the following autotools packages installed:
autoconf-2.59-5
automake-1.9.2-3
libtool-1.5.6-4.EL4.2

It builds cleanly and 'make check' passes.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: James Yonan <james@openvpn.net>
Acked-by: Alon Bar-Lev <alon.barlev@gmail.com>
14 years agoOn TARGET_LINUX define _GNU_SOURCE if not defined
David Sommerseth [Wed, 10 Mar 2010 10:45:04 +0000 (11:45 +0100)] 
On TARGET_LINUX define _GNU_SOURCE if not defined

This is to include peercred support on hosts where _GNU_SOURCE is not
defined by default.  This issue has been found on Gentoo with glibc-2.8.

The solution was discussed on the IRC meeting March 4, 2010
in #openvpn-discussions.
<http://thread.gmane.org/gmane.network.openvpn.devel/3242>

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: James Yonan <james@openvpn.net>