summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* build: autotools: first pass of trivial autotools changesAlon Bar-Lev2012-03-2215-757/+738
| | | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Adriaan de Jong <dejong@fox-it.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* build: m4/ax_socklen_t.m4: cleanupAlon Bar-Lev2012-03-222-42/+57
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* build: m4/ax_emptyarray.m4: cleanupAlon Bar-Lev2012-03-221-18/+31
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* build: m4/ax_varargs.m4: cleanupAlon Bar-Lev2012-03-221-23/+55
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* build: split acinclude.m4 into m4/*Alon Bar-Lev2012-03-228-131/+126
| | | | | | | | ax_emptyarray.m4 ax_openvpn_lib.m4 ax_socklen_t.m4 ax_varargs.m4 Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Adriaan de Jong <dejong@fox-it.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* build: remove windows specific build systemAlon Bar-Lev2012-03-2228-2877/+2
| | | | | | | | It will be completely re-written in future Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* cleanup: rename tap-windows function from win32 to winAlon Bar-Lev2012-03-2213-121/+121
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* Remove tap-win32Alon Bar-Lev2012-03-2226-6301/+13
| | | | | | | | | | | Introduce tap-windows.h which is modified tap-win32/common.h. Except of function rename, it is the same without the tap_id. This file should be provided as part of tap-win32 MSI. For now we hold a copy. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* Remove easy-rsaAlon Bar-Lev2012-03-2257-2668/+1
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* Remove install-win32Alon Bar-Lev2012-03-2235-2163/+1
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* build: we need the sample.ovpn in futureAlon Bar-Lev2012-03-221-0/+0
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* build: plugins: properly use CC, CFLAGS and LDFLAGSAlon Bar-Lev2012-03-224-19/+24
| | | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Adriaan de Jong <dejong@fox-it.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* build: rename plugin directory to pluginsAlon Bar-Lev2012-03-2224-10/+9
| | | | | | | | This to avoid conflit with plugin.c rules Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* build: handle printf style format in mingwAlon Bar-Lev2012-03-224-6/+30
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* Update .gitignoreAlon Bar-Lev2012-03-221-0/+1
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* build: correct place to alter WINVER is at build systemAlon Bar-Lev2012-03-223-6/+2
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* fixup: init.c: add missing conditional for ENABLE_CLIENT_CRAlon Bar-Lev2012-03-221-0/+2
| | | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Adriaan de Jong <dejong@fox-it.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* cleanup: memcmp.c: remove unused sourceAlon Bar-Lev2012-03-222-46/+0
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* cleanup: tun.c: fix incorrect option in message (ip-win32)Alon Bar-Lev2012-03-221-1/+1
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* cleanup: crypto_openssl.c: remove support for pre-openssl-0.9.6Alon Bar-Lev2012-03-221-49/+0
| | | | | | | | | | | | | autoconf rejecting this anyway: ---- AC_MSG_CHECKING([that OpenSSL Library is at least version 0.9.6]) <snip> AC_MSG_ERROR([OpenSSL crypto Library is too old.]) ---- Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* cleanup: remove redundant ';'Alon Bar-Lev2012-03-221-1/+1
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* cleanup: win32.c: wrong printf formatAlon Bar-Lev2012-03-221-2/+2
| | | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Adriaan de Jong <dejong@fox-it.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* cleanup: remove C++ warningsAlon Bar-Lev2012-03-226-12/+14
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* cleanup: options.c: remove redundant includeAlon Bar-Lev2012-03-221-1/+0
| | | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Adriaan de Jong <dejong@fox-it.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* package: rpm: strip should be handled by package managementAlon Bar-Lev2012-03-221-1/+0
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Samuli Seppänen <samuli@openvpn.net> Signed-off-by: David Sommerseth <davids@redhat.com>
* build: version should not contain '-'Alon Bar-Lev2012-03-221-1/+1
| | | | | | Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* fix warnings in event.c when building for win32-64Heiko Hund2012-02-211-4/+4
| | | | | | | | | | | | | | | When compiling for 64-bit Windows gcc warns about "cast from pointer to integer of different size" on two occasions in file event.c, due to invalid casting. This patch removes the type casts and uses the correct format specifier instead. Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Acked-by: James Yonan <james@openvpn.net> URL: http://article.gmane.org/gmane.network.openvpn.devel/4979 Signed-off-by: David Sommerseth <davids@redhat.com>
* remove wrapper code for Windows CryptoAPI functionHeiko Hund2012-02-211-30/+13
| | | | | | | | | | | | | | | | | The CryptoAPI function CryptAcquireCertificatePrivateKey() was previously unsupported in MinGW. With recent w32api headers it's now defined, mostly. Since the code used to load the CryptoAPI DLL is prone to a DLL hijacking attack [1], it's now a good time to get rid of wrapper completely. Just a few macros left that may still be undefined on some systems using the original MinGW headers. [1] http://isc.sans.edu/diary.html?storyid=9445 Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Acked-by: James Yonan <james@openvpn.net> URL: http://article.gmane.org/gmane.network.openvpn.devel/4979 Signed-off-by: David Sommerseth <davids@redhat.com>
* Preparing OpenVPN 2.3-alpha1 releasev2.3-alpha1David Sommerseth2012-02-212-1/+432
| | | | Signed-off-by: David Sommerseth <davids@redhat.com>
* Revamp check_file_access() checks in stdin scenariosDavid Sommerseth2012-02-201-4/+12
| | | | | | | | | | | | | It was discovered that --management also can take stdin as argument instead of a file. Enabled this by revamping the check_file_access() flags by adding CHKACC_ACPTSTDIN. Setting this flag will then consider filenames as 'stdin' as always present. The other place where 'stdin' was accepted is also modified to use this flag instead. Signed-off-by: David Sommerseth <davids@redhat.com> Acked-by: Gert Doering <gert@greenie.muc.de>
* define access mode flag X_OK as 0 on WindowsHeiko Hund2012-02-201-1/+1
| | | | | | | | | | The _access and _waccess functions in Windows don't know about X_OK (1). If you pass an uneven mode flag the C runtime's default invalid parameter handler ends execution of openvpn. Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* Makefile.am was missing ssl_common.hDavid Sommerseth2012-02-171-0/+1
| | | | | | | | In commit 9a160b796e1a40f9635231e5533ce40d46dba25f ssl_common.h was introduced, but never listed as a source file in Makefile.am Signed-off-by: David Sommerseth <davids@redhat.com> Acked-by: Gert Doering <gert@greenie.muc.de>
* Makefile.am referenced a now non-existing config-win32.hDavid Sommerseth2012-02-171-1/+0
| | | | | | | | | | | | This file was moved to win/config.h.in and is the template used by the Python build tools in win/. This happened in commit 4b312378e9e7084a0699ca6d4b895bdadb7540db For all other autotools based environments, ./configure will take care of creating the proper config.h Signed-off-by: David Sommerseth <davids@redhat.com> Acked-by: Gert Doering <gert@greenie.muc.de>
* move variable declaration to top of functionHeiko Hund2012-02-171-1/+1
| | | | | | | | MSVC chokes on this as it's not according to C89. Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* make MSVC link against shell32 as wellHeiko Hund2012-02-171-1/+1
| | | | | | | | | Windows API CommandLineToArgvW(), introduced in Windows unicode path commit 71bbbd76c62630c88441237d72fe5b61f0b45b2a, is defined therein. Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Acked-by: Gert Doering <gert@greenie.muc.de> Signed-off-by: David Sommerseth <davids@redhat.com>
* use the underscore version of stat on WindowsHeiko Hund2012-02-173-5/+7
| | | | | | | | | | | | MSVC does not know wstat(). Instead _wstat() must be used here. Unfortunately _wstat() takes a 'struct _stat'. A type 'stat_t' is introduced to handle this situation in a portable way. [v2: Use openvpn_stat_t instead of stat_t (David Sommerseth)] 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>
* do not use mode_t on WindowsHeiko Hund2012-02-162-2/+2
| | | | | | | | | | The MSVC headers do not define mode_t. open() uses an int for the permissions instead. Fixes building with the MSVC based buildsystem. Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Acked-by: Gert Doering <gert@greenie.muc.de> Signed-off-by: David Sommerseth <davids@redhat.com>
* replace check for TARGET_WIN32 with WIN32Heiko Hund2012-02-163-7/+7
| | | | | | | | | Use of TARGET_WIN32 breaks MSVC builds as it is only defined for mingw builds done with the autotools buildsystem. Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Acked-by: Gert Doering <gert@greenie.muc.de> Signed-off-by: David Sommerseth <davids@redhat.com>
* Fixed wrong return type of cipher_kt_modeFrank de Brabander2012-02-163-3/+3
| | | | | | | | | | The cipher_kt_mode uses bool as return type, this should be int. On some platforms like OS X, any returned value larger than one will be converted to 1. Signed-off-by: Frank de Brabander <brabander@fox-it.com> Acked-by: Adriaan de Jong <dejong@fox-it.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* Connection entry {tun,link}_mtu_defined not set correctlyDavid Sommerseth2012-02-141-15/+17
| | | | | | | | | | | | | | Commit 76809cae0eae07817160b423d3f9551df1a1d68e enabled setting MTU variables inside <connection> blocks. But in that process, the tun_mtu_defined and link_mtu_defined was not set as it should. By moving this out of the options_postprocess_mutate_invariant() function and into options_postprocess_mutate_ce(), these {tun,link}_mtu_defined variables are set correctly in each connection entry. Signed-off-by: David Sommerseth <davids@redhat.com> Acked-by: Gert Doering <gert@greenie.muc.de>
* Made some options connection-entry specificJan Just Keijser2012-02-136-101/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The following options may now be used in a connection block: fragment mssfix tun-mtu tun-mtu-extra link-mtu mtu_discover_type explicit-exit-notification In order to support stuff like <connection> remote host proto udp fragment explicit-exit-notification 3 </connection> <connection> remote host proto tcp </connection> Signed-off-by: Jan Just Keijser <janjust@nikhef.nl> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* Fix compile issues with status.cDavid Sommerseth2012-02-131-0/+1
| | | | | | | | | Commit 71bbbd76c62630c88441237d72fe5b61f0b45b2a moved over from calling open() directly to go via the openvpn_open(). It was not detected that status.c had to include misc.h too. Signed-off-by: David Sommerseth <davids@redhat.com> Acked-by: Heiko Hund <heiko.hund@sophos.com>
* Remove --show-gateway if debug info is not enabled (--disable-debug)David Sommerseth2012-02-131-0/+4
| | | | | | | | | | The --show-gateway feature depends on functions only being enabled when --disable-debug is _not_ used. As this I consider --show-gateway more a handy function for debugging, removing this feature when --disable-debug is used seems like the proper approach. Signed-off-by: David Sommerseth <davids@redhat.com> Acked-by: Gert Doering <gert@greenie.muc.de>
* Fix compile issues when plug-ins are disabled.David Sommerseth2012-02-131-16/+15
| | | | | | | | | | | | | | Commit 1876ccd012e9e2ca6f8e1cd9e7e9bb4bf24ccecb modified plugin_call() and introduced plugin_call_ssl(). But the similar approach was missing for situations without plug-ins. Solution: Rename plugin_call() in the #else !ENABLE_PLUGIN section to plugin_call_ssl(). Then move the plugin_ssl() function inside the #ifdef ENABLE_PLUGIN section outside the #ifdef, making it available for builds with and without plug-ins enabled. Signed-off-by: David Sommerseth <davids@redhat.com> Acked-by: Gert Doering <gert@greenie.muc.de>
* handle Windows unicode pathsHeiko Hund2012-02-1318-362/+367
| | | | | | | | | | | | | | | | | | | | | | Openvpn for Windows is not compiled as a Unicode binary and thus cannot handle paths which contain non-ASCII characters using the argv vector. Characters that are not present in the system codepage are simply replaced with a question mark, e.g. if started as 'openvpn --config домой.ovpn' the file '?????.ovpn' is tried to be opened as configuration. The same applies to paths in config files which need to be UTF-8 encoded if they contain non ASCII characters. The option line 'key лев.pem' will lead to openvpn trying to open 'лев.pem' on a system with codepage 1252. This patch makes openvpn read the command line in UCS-2 and convert it to UTF-8 internally. Windows stores names in the filesystem in UCS-2. When using a paths openvpn converts it from UTF-8 to UCS-2 and uses the wide character Windows API function. Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* The code blocks enabled by ENABLE_CLIENT_CR depends on managementIgor Novgorodov2012-02-131-0/+2
| | | | | | | | | | If the management interface is not enabled, it makes no sense in including the ENABLE_CLIENT_CR #ifdef blocks. This will also in some configurations cause build issues if these blocks are enabled. Signed-off-by: Igor Novgorodov <igor@novg.net> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* autoconf fixes for building on OSXByron Ellacott2012-02-091-10/+10
| | | | | | | | [DS: a few whitespace fixes was added as well during the merge] Signed-off-by: Byron Ellacott <bje@apnic.net> Acked-by: Gilles Espinasse <g.esp@free.fr> Signed-off-by: David Sommerseth <davids@redhat.com>
* Fix assert() situations where gc_malloc() is called without a gc_arena objectDavid Sommerseth2012-02-086-8/+39
| | | | | | | | | | | | | | | | | | | | | In commit bee92b479414d12035b0422f81ac5fcfe14fa645 the gc_malloc() was hardened to always require a gc_arena object for garbage collection. Some places in the code expected the old behaviour of a normal malloc() in these cases, that is a memory allocation without garbage collection. This old behaviour is partly restored by allowing string_alloc() to do a non-gc based allocation if no gc_arena object is available. In addition some other places string_alloc() will now be called with a gc_arena pointer where such an object is available. The alloc_buf() function has also been refactored to not use gc_malloc() at all. v2: - removes a memleak when --ifconfig-ipv6 is used several times - makes string_alloc() behave properly if DMALLOC is enabled Signed-off-by: David Sommerseth <davids@redhat.com> Acked-by: Gert Doering <gert@greenie.muc.de>
* Platform cleanup for OpenBSDGert Doering2012-02-082-27/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | Turn around initialization order (IFCONFIG_AFTER_TUN_OPEN) to make it "the same as all other platforms besides Windows" (tun.h). Remove "ifconfig destroy / ifconfig create" from open_tun() and change to generic "create tun device by opening /dev/tunN" approach, thus cleaning up the IFCONFIG_BEFORE_TUN_OPEN bit. Add "-link0" for ifconfig calls in tun mode, to make sure that even if we happen to re-use a not-cleaned-up tun interface in tap mode, it will then be setup correctly (-link0 -> tun, link0 -> tap). Add correct ifconfig calls for "topology subnet". On tunnel close, only call "ifconfig destroy" if it was a tap interface (tun + link0), because those do not auto-disappear (OpenBSD bug?) Get rid of READV/WRITEV #ifdef's - as per the man page, these calls have been added to 4.2BSD, and there never was an OpenBSD version without. Tested on OpenBSD 4.9 with tun+tap, ipv4+ipv6, topology net30+subnet Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
* Documented --push-peer-info optionRobert Fischer2012-02-051-0/+14
| | | | | | Signed-off-by: Robert Fischer <ml-openvpn@trispace.org> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>