0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 20:13:05 +02:00
Commit Graph

81 Commits

Author SHA1 Message Date
James Yonan
8f20f76936 build: use LZ4_SYS=1 default when target is Linux
Signed-off-by: James Yonan <james@openvpn.net>
2018-08-30 13:00:27 +03:00
Arne Schwabe
dd47138adf Add script for building cityhash 2018-04-25 18:25:28 +02:00
James Yonan
2b4c85091d Debugging: added header and build flag for valgrind run-time
extensions.

Signed-off-by: James Yonan <james@openvpn.net>
2017-12-22 17:59:38 +08:00
Antonio Quartulli
7cbf539222 [OVPN3-5] build script: allow user to specify its own mbedTLS folder and LDFLAGS
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2017-09-27 16:16:18 +08:00
Lev Stipakov
8ae2a3f7cf Integrate Google Test framework
Implemented sample test for LogInfo class.

OVPN3-27
2017-09-27 16:16:18 +08:00
Lev Stipakov
7db95ccde6 Make build fail on compilation errors
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
81cb887f67 build script: added DPROF=1 flag
When DPROF=1 and PROF is specified, build with
the debugging variant of the vars file.

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
ce0977b2ea Support Cityhash.
When running build script, add CITY=1 to build with Cityhash library.

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
916856d9b7 build script: updated Objective-C support when OBJC=1.
Signed-off-by: James Yonan <james@openvpn.net>
2017-04-12 11:42:41 -06:00
James Yonan
691a641a43 Added i/o abstraction layer.
Created a lightweight abstraction layer so that another i/o
reactor can be dropped in place of asio.

The basic approach is to rename all references to asio::xxx
types to openvpn_io::xxx and then make openvpn_io a
preprocessor variable that points to the top-level namespace
of the i/o reactor implementation.

All of the source files that currently include <asio.hpp> now
include <openvpn/io/io.hpp> instead:

This gives us a lightweight abstraction layer that allows us
to define openvpn_io to be something other than asio.

Other changes:

* Inclusion of asio by scripts/build is now optional, and is
  enabled by passing ASIO=1 or ASIO_DIR=<dir>.

* Refactored openvpn/common/socktypes.hpp to no longer
  require asio.

* Refactored openvpn/log/logthread.hpp to no longer require
  asio.

* Added openvpn::get_hostname() method as alternative to
  calling asio directly.

* openvpn/openssl/util/init.hpp will now #error
  if USE_ASIO is undefined.

Signed-off-by: James Yonan <james@openvpn.net>
2017-03-30 15:48:14 -06:00
James Yonan
f8876e5ef3 build script: added new parameters
PROF=<platform> -- source vars/vars-<platform> before running
ASIO_DIR=<dir> -- specify ASIO tree
MTLS_SYS=1 -- use system mbedTLS
LZ4_SYS=1 -- build with system LZ4 compression library
2017-03-18 12:24:54 -06:00
James Yonan
052f565ed7 build-mbedtls : simplify mbedTLS build script to no longer
depend on cmake.
2017-03-18 12:24:54 -06:00
James Yonan
ba47bd6f05 build script : OSSL=1 option on Linux will link
with system OpenSSL.
2017-03-18 12:24:54 -06:00
James Yonan
050e8717f1 mbedTLS: Port from polarssl-1.3 to mbedtls-2.3 (symbol renames)
This patch renames internal OpenVPN 3 symbols
from polarssl -> mbedtls.

Signed-off-by: James Yonan <james@openvpn.net>
2017-03-18 12:24:54 -06:00
James Yonan
a6b7cf458f mbedTLS: Port from polarssl-1.3 to mbedtls-2.3 (functional)
This patch builds on work by David Sommerseth <davids@openvpn.net>
to move the PolarSSL API from polarssl-1.3 to mbedtls-2.3, which
has significant differences in some areas.

- Strings containing keys, certificates, CRLs, and DH parameters
  need to be NULL-terminated and the length argument provided to
  the corresponding mbedtls parse function must be able to read
  the NULL-terminator.  These places have been modified with a
  '+1' to the length argument (x509cert.hpp, x509crl.hpp, dh.hpp,
  pkctx.hpp).

- The SSL context object has been split up in mbedtls-2.3
  Now many of the SSL configurations are done in a separate
  SSL config object, which is added to the SSL context once
  configured.  In addition private/public keys are now stored
  in a separate pk_context, which is later on attached to the
  SSL context.  Due to this, many of the calls setting either
  SSL configuration parameters or working with pk_contexts have
  been refactored.  (sslctx.hpp)

- The older API loading the CA chain took a hostname argument.
  The new API requires mbedtls_ssl_set_hostname() explicitly to
  be called setting hostname.  Some refactoring was needed here
  too (sslctx.hpp).

- x509_oid_get_description() is now replaced by
  mbedtls_oid_get_extended_key_usage().

- when mbedTLS renamed OID_CMP to MBEDTLS_OID_CMP, the return
  value was changed so that a return value of 0 now means equal
  rather than not-equal.

- mbedtls/platform.h must be loaded before any other mbedtls
  include files (sslchoose.hpp).

- All functions and macros related to mbedTLS are now prefixed
  with mbedtls_/MBEDTLS_

- Refactored External PKI and added some options to cli.cpp
  to make it easier to test that the feature still works
  correctly.  This included removing the sig_type var and
  standardizing on a PKCS#1 digest prefix per RFC 3447.

- Updated test keys to 2048 bits.

- Updated dependency build scripts to build mbedTLS.

- Enable MD4 in mbedTLS build script (needed for NTLM auth).

- Use an allow-all X509 cert profile to preserve compatibility
  with older configs.  Going forward, we will implement new
  options to increase strictness on minimum RSA key size and
  required cert signing algs.

- Added human-readable reason strings that explain why
  a given cert in the chain wasn't accepted.

- This patch doesn't rename any files or rename internal
  OpenVPN 3 symbols such as PolarSSLContext.  This will
  be done in a separate commit.

Signed-off-by: James Yonan <james@openvpn.net>
2017-03-18 12:24:54 -06:00
James Yonan
ba15049f18 Mac client : implemented INFO,OPEN_URL handler for Mac OS X
command line client.
2016-08-11 14:05:33 -06:00
James Yonan
18bf3158a5 Updated ovpn3 dependencies:
* Updated all libraries to latest versions
* PolarSSL -> mbedTLS renaming
2015-12-28 17:47:18 -07:00
James Yonan
6eaf1e324b Changes to build script:
* Added EXTRA_CPP var for specifying additional .cpp files
  to be built as separate compilation units.

* Don't emit -fwhole-program flag if compile-only flag
  (CO) is enabled or EXTRA_CPP is defined.

* Clear out EXTRA_SRC_OBJ if compile-only flag (CO) is
  enabled to avoid warnings.
2015-11-25 12:14:02 -07:00
James Yonan
3825535db2 Added "JAVA=1" option to build script to build with JVM. 2015-08-14 05:19:04 -07:00
James Yonan
16bde170c0 Don't use deprecated asio features. 2015-06-30 00:05:37 -06:00
James Yonan
04637e486a Started process of switching over from asiodispatch
to C++11 lambdas.
2015-06-24 16:16:57 -06:00
James Yonan
c6a21c827b Boost dependency elimination -- final removal of Boost
dependency.  Asio is now included as a standalone,
header-only dependency.
2015-06-06 10:59:18 -06:00
James Yonan
4d660c0eca Added OUTBIN parm to build script. 2015-04-25 15:12:15 -06:00
James Yonan
a51c0bf0bf Mostly complete transition from boost::thread to std::thread. 2015-04-23 17:07:56 -06:00
James Yonan
5539a22684 Repo reorganization: standardize on $O3 representing the top-level
directory that contains core and possibly other components as well.
2014-08-29 18:42:02 -06:00
James Yonan
68afaf3324 Created build-extras system where other components (outside of core)
can modify build system behavior.
2014-08-28 16:06:26 -06:00
James Yonan
6ba90c9ef7 In build script, remove references to DBG_DIR_SUFFIX as it is made
obsolete by existence of vars-x-dbg files.
2014-08-28 16:04:27 -06:00
James Yonan
302046c3ea Updated build scripts for repo reorganization. 2014-08-28 13:33:14 -06:00
James Yonan
76b317e9f1 Added JsonCpp support. 2014-08-10 20:16:36 -06:00
James Yonan
d9dfc91031 In build script, don't add -fwhole-program
flag when DEBUG_BUILD == 1.
2014-08-10 20:02:25 -06:00
James Yonan
df860644e8 Built ovpn3 cli tool on Linux (gcc 4.8.2) with some
minor edits:

* Don't build OpenSSL.
* Edited ovpncli/README.txt with updated build command.
* Enabled C++11 in compiler flags, and turned off
  some spurious warnings.
* Added CXX_COMPILER_FLAGS build flag to allow
  C++-only flags to be defined.

Changes to build script as well:

* Honor OTHER_COMPILER_FLAGS and CXX_COMPILER_FLAGS
  settings.
* For debug builds, DEBUG_BUILD=1 setting should be placed
  in vars-x.  Existing build DEBUG=1 setting now only
  sets -g.
* For clang builds, don't emit -fvisibility=hidden because
  that should be placed in OTHER_COMPILER_FLAGS in vars-x.
2014-07-28 12:08:49 -06:00
James Yonan
11acfc6ca2 Implemented Mac connection lifecycle monitoring object
(MacLifeCycle).

Monitor connection lifecycle notifications, such as sleep, wakeup,
network-unavailable, and network-available.

Note that not all platforms define a lifecycle object.  Some
platforms such as Android and iOS manage lifecycle notifications at
the service level, and they call pause(), resume(), reconnect(),
etc. as needed using the main ovpncli API.

Also, added a reason string to Pause event.
2014-03-24 17:28:46 -06:00
James Yonan
074dbafa27 Ported minicrypto lib to OS X for PolarSSL optimization.
These scripts

  scripts/mac/build-minicrypto
  scripts/mac/build-polarssl

will now build PolarSSL (on OSX) with libminicrypto linkage.
Currently, only SHA1/256/512 implementations from OpenSSL are
built in libminicrypto.  We leave the current PolarSSL AES
implementation as-is since it now implements AES-NI.

Also added portable openssl/build-openssl script.
2014-03-04 17:42:00 -07:00
James Yonan
a76c67f63c On Mac OS X, build now defaults to utun-only and
BOOST_ASIO_DISABLE_KQUEUE is left undefined.  To enable
fallback to Mac TunTap driver, MAC_TUNTAP_FALLBACK
and BOOST_ASIO_DISABLE_KQUEUE must be defined.
2014-02-27 23:05:11 -07:00
James Yonan
382f8a2828 Mac OS X build script changes to allow building "fat" 32/64-bit
binaries with minimum deployment target of OS X 10.6.
2014-02-27 17:57:38 -07:00
James Yonan
7e0490f647 Updated Android SDK, NDK, and build scripts:
SDK: adt-bundle-mac-x86_64-20131030
NDK: android-ndk-r9c
2014-01-13 17:48:37 -07:00
James Yonan
2cbe310f35 OpenVPN 1.0.4 build 114 (iOS)
Dusted off LZ4 implementation and enabled in iOS
and cli.cpp builds.

Tested LZ4 as well with OpenVPN 3 acting as the client,
with a hacked AS and OpenVPN 2.3 (JY) acting as the server
(see lz4hack patches).
2013-12-27 22:21:22 -07:00
James Yonan
1481327d72 OpenVPN 1.0.2 build 98 (iOS)
Ported iOS client and OpenVPN 3 core to ARM-64.
Now building a "fat binary" with Xcode 5.0.1 that
targets arm7, arm7s, and arm64.

Outstanding issues:

* IPv6 doesn't route through tunnel on iOS7
* Client doesn't install on iOS 5.1.1.
2013-11-11 12:33:35 -07:00
James Yonan
0f17a169fc Added notes (doc/README.txt) describing OpenVPN 3 build process on
Mac OS X that is intended to be used with openvpn3.tar.gz
distribution.
2013-06-28 04:17:27 +00:00
James Yonan
7fe6fad18a Added crypto self test capability to core.
Added polarssl/bignum-arm.patch to resolve issue where
asm-optimized bignum code would crash on iOS.
2013-06-14 00:34:49 +00:00
James Yonan
32e9c62db7 Support usage such as this:
remote foo.bar 1194 tcp-client
2013-02-19 06:54:12 +00:00
James Yonan
5ea06010c5 Get PolarSSL-based client and test builds working on Linux again. 2012-11-26 18:53:12 +00:00
James Yonan
f72aab4b40 Added support to new core for remote-cert-tls, remote-cert-ku,
and remote-cert-eku directives.
2012-10-31 14:46:40 +00:00
James Yonan
0df25d9f75 Minor changes to Linux build system to incorporate "linux"
subtarget in dependency build dir.
2012-09-12 00:14:07 +00:00
James Yonan
54a534d347 Fixed build script to work again on OS X.
Implement our own wrapper around ::system().
2012-09-11 23:51:37 +00:00
James Yonan
58efad3b74 Updated linux scripts to work with latest core and library
organization.

Added scripts under scripts/linux for building dependent
libraries.

Added test/ovpncli/cli.cpp to provide a command line client that
exercises ovpncli.hpp API and can be built via build script.
2012-09-09 23:10:20 +00:00
James Yonan
8b7b797ef5 iOS version: 1.0 Beta 17
Android version: 1.1 beta 1

More alignment of iOS and Android clients:

* Normalized building of dependencies for Android and iOS:

  This build adds some new library dependencies:
  The library versions required are enumerated in
  ovpn3/lib-versions, currently:

    export BOOST_VERSION=boost_1_51_0
    export OPENSSL_VERSION=openssl-1.0.1c
    export POLARSSL_VERSION=polarssl-1.1.4
    export LZO_VERSION=lzo-2.06

  To build, first mkdir ~/src/android and ~/src/mac if they don't
  already exist.  Set the env var O3 to point to the ovpn3 dir,
  usually ~/src/ovpn3.

  Build on iOS:

    [set PATH to include NDK]
    cd ~/src/android
    $O3/scripts/android/build-boost
    $O3/scripts/android/build-minicrypto
    $O3/scripts/android/build-polarssl
    $O3/scripts/android/build-lzo

  Build on Android:

    [set PATH to include NDK]
    cd ~/src/android
    $O3/scripts/android/build-boost
    $O3/scripts/android/build-minicrypto
    $O3/scripts/android/build-polarssl
    $O3/scripts/android/build-lzo

* Integrated Minicrypto library (an assembly language library
  of low-level crypto functions adapted from OpenSSL).

* Added LZO compression with a preference/settings item
  to enable or disable.

* Added special compression handling to support older servers
  that ignore compression handshake -- this will handle receiving
  compressed packets even if we didn't ask for them.

* Normalized profile naming conventions.

iOS changes:

* Log tunnel performance stats immediately on disconnection
  of tunnel.

Android changes:

* Client now supports loading profiles as attachments
  opened from other apps.

* Added Import Private Tunnel menu item, however current
  Private Tunnel download page needs to be adapted to fit
  requirements of Android download manager.

* Enter key should advance to the next input field,
  or connect if entered from the last field.

* Import from Access Server now provides the option to
  download autologin vs. userlogin profiles.

* "About" page now shows copyright text for included
  libraries/content (except for LZO and PolarSSL
  which will presumably be commercially licensed).
2012-09-05 01:09:34 +00:00
James Yonan
5d3ef89157 Android core build updates.
* Updated OpenSSL to 1.0.1c
* Updated Boost to 1_49_0
* Updated core expiration to 2012.09.01
2012-05-31 12:23:48 +00:00
James Yonan
5489c01b29 Minor build script change. 2012-05-31 10:01:58 +00:00
James Yonan
eccd2cf64f Extended build script to build static libraries.
First version of static libovpncli tested on
iPad (without tun support yet).
2012-05-29 21:15:28 +00:00