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

131 Commits

Author SHA1 Message Date
James Yonan
7539c4e0d1 Added gateway parameter to tun_builder_add_address for Windows and other
platforms that lack a VPN API.
2014-02-15 23:34:33 -07:00
James Yonan
2e1871a062 Added net30 boolean to TunBuilderBase::tun_builder_add_address for the
benefit of Windows.
2014-02-09 18:51:25 -07:00
James Yonan
95fceb5e43 Android: log tunnel bytes per CPU second. 2014-01-14 22:52:28 -07:00
James Yonan
a6ab17fde0 Android: build two versions of OpenVPN core library (libovpncli.so)
for different ARM platforms:

1. armeabi
2. armeabi-v7a

Android build script will package both versions of libovpncli.so
in the .apk, where the correct version should be automatically
chosen by Android on install.
2014-01-14 16:40:25 -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
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
de0da474ef Revamp remote-list handling so that DNS names that resolve to
multiple addresses will be treated as if each address was an
individual remote directive.

Fixed issue where UDP transport driver was calling socket
connect method synchronously.  This can cause exceptions
to be thrown in corner cases, such as "No route to host"
on OSX/iOS for connections to IPv6 addresses when no default
IPv6 route exists on system.  Refactoring UDP connect
operation to be asychronous fixes the issue.

Implemented remote-random.
2013-03-12 19:20:37 +00:00
James Yonan
842c93bfe9 Added capability to build Android development packages for customers. 2013-03-08 01:53:33 +00:00
James Yonan
0ba6e76170 Added copyright to some straggler files. 2013-01-31 15:00:45 +00:00
James Yonan
ce8171fff1 Minor fixes related to open-sourcing process. 2013-01-30 20:17:30 +00:00
James Yonan
ce7c03b472 Java command-line client update. 2013-01-30 19:19:49 +00:00
James Yonan
d24d0b4aef On iOS with a split-tunnel, and at least one pushed DNS server:
1. route all DNS requests through pushed DNS server if no added
   search domains.

2. route selected DNS requests through pushed DNS server if at
   least one added search domain.

On Android, apparently there is no selective DNS routing, so all
DNS requests will be routed through pushed DNS server, if at least
one exists.

With redirect-gateway on both platforms, all DNS requests are always
routed through the VPN.
2013-01-26 06:53:31 +00:00
James Yonan
6c0be1e1c0 iOS: 1.0.1 build 55
Android: 1.1.9 build 31

* Reverted key-direction back to a default of 1.

* Raise fatal error if "fragment" option is used.

* Made TunBuilderCapture more useful as a base class for
  tun construction on various platforms.

* Added disableClientCert flag at ovpncli.hpp API.

* Updated help FAQ with more details on how to
  properly set key-direction, and notes about
  possible network disconnect during voice calls.
2013-01-24 13:34:17 +00:00
James Yonan
9f18b28f86 Misc build system changes to support OpenSSL. 2012-11-27 03:05:46 +00:00
James Yonan
065b83263c Initial Apple VPN-On-Demand implementation:
* VoD profiles can be defined using the iPhone Configuration utility:

  1. Connection Type should be set to Custom SSL
  2. Identifier should be set to net.openvpn.OpenVPN-Connect.vpnplugin
  3. Server can be set to a hostname, or "DEFAULT" to use the
     hostname(s) from the OpenVPN configuration.
  4. User Authentication should be set to Certificate, and the client
     certificate+key should be attached as a PKCS#12 file.
  5. VPN On Demand should be enabled and match entries should be
     defined.

  In addition, the OpenVPN client configuration file may be defined
  via key/value pairs:

  1. VoD requires an autologin profile.
  2. Define each OpenVPN directive as a key, with arguments
     specified as the value.
  3. For Access server meta-directives such as
     OVPN_ACCESS_SERVER_USERNAME, remove the "OVPN_ACCESS_SERVER_"
     prefix, giving USERNAME as the directive.
  4. If no arguments are present, use "NOARGS" as the value.
  5. If multiple instances of the same directive are present,
     number the directives in the order they should be processed by
     appending .<n> to the directive, where n is an integer,
     such as remote.1 or remote.2
  6. For multi-line directives such as <ca> and <tls-auth>, you must
     convert the multi-line argument to a single line by specifying
     line breaks as \n -- also note that because of
     this escaping model, you must use \\ to pass backslash itself.

* VoD profiles are recognized and listed by the app.

* The app can disconnect but not connect a VoD profile.

* Most app-level functionality such as logging and preferences
  work correctly for VoD profiles.

Core changes:

* Added support for key-direction parameter in core.
2012-11-06 17:50:30 +00:00
James Yonan
b16f8acc34 Minor fix to Android core build script for Android. 2012-11-02 09:28:31 +00:00
James Yonan
a79f88aebd Android:
* Implement a simple DNS cache to work around issue with
  Seamless Tunnel --  When Seamless Tunnel is enabled,
  reconnections are unable to send DNS requests because
  the internet is blocked.  This fix caches the IP address
  used for the initial connection, then reuses it
  over the lifetime of the Seamless Tunnel.

* Try to ensure that connections properly pause on device
  sleep (when sleep on screen blanking is NOT enabled) so
  that they will survive until wakeup.

iOS:

* Don't choke on foreign profiles (such as VPN On Demand) that are
  imported onto the device but lack critical info such as a
  config file.
2012-10-23 13:10:39 +00:00
James Yonan
5f494621b1 Android and core fixes related to External PKI:
* Fixed core segfault that would occur if external_pki_cert_request
  returned an error status.

* More robust handling of External PKI alias invalidation.

* Minor fixes to allow jellybean_hack.cpp to build in
  debug mode.
2012-10-19 08:52:01 +00:00
James Yonan
cded2ca49e Android 1.1.1 build 9
* Fix attempt for java.lang.NullPointerException in
  net.openvpn.openvpn.OpenVPNService.onStartCommand(OpenVPNService.java:838)

* Allow non-unified profiles (i.e. profiles containing directives that
  reference other files) to be imported from SD card, as long
  as all referenced files are present in the same directory on the
  SD card as the profile.

* Relaxed parsing of "remote" directive to allow the port and/or
  protocol parameters to be omitted.  The port defaults to 1194
  and the protocol to UDP.  Either defaults can be changed with
  the "port" or "proto" directive.

* Fixed issue where profile parser was choking on files containing
  Windows-style line-endings.
2012-10-18 12:24:14 +00:00
James Yonan
42d4dda791 This is a general pre-release fine-tuning of both Android and iOS clients.
Versioning:
  iOS -- 1.0 Beta 23
  Android -- 1.1.0 (build 6)

Both clients:

* Bundled IPv6 test profile as provided by Gert Doering.
  Modified iOS beta testing notes with info on this profile.

* Fixed issue where profile import might fail if profile
  filename ended in .OVPN (i.e. all-caps extension).

Android client:

* General UI cleanup:
  1. Added status icon,
  2. eliminated long "Connected" line that wrapped badly on
     phone-sized devices,
  3. reorganized connection details,
  4. include all stats that are provided by the core,
     including "last packet received n seconds ago".

* Fixed issue where importing profiles via web browser would not
  ultimately land on the OpenVPN main page after import completion.

* Added profile rename (select via long-touch on profile name).

* Added "Auto Keyboard" preference similar to iOS.

* Turn on full compression by default (can be modified via
  a preference), just as it is for iOS.

* Disable spell-checker on all input fields.

* Wait a maximum of 5 seconds (formerly 3) after Disconnect button
  press before abandoning core thread.

* Added versionName and versionCode to AndroidManifest.xml for
  Google play submission.

* Revamped OpenVPNService event model for profile management events,
  to fix some corner-case issues.

Android API changes:

This release includes some minor changes to the OpenVPN Service API:

1. Added enable_trust_error_dialog boolean parameter to
   OpenVPNClientBase.importProfileRemote.  This should be set to false
   for Private Tunnel client.

2. Changed the way that profile import events signal back to the UI
   layer.  OpenVPNClientBase.get_priority_profile_name has been
   removed, and profile signaling events are now performed completely
   via the standard event stream.
2012-10-10 11:04:34 +00:00
James Yonan
ce0dd92546 Added Android 4.1 "Jelly Bean" hack to work around significant
breakage in KeyChain API.
2012-10-07 09:20:15 +00:00
James Yonan
4445ba1e76 OpenVPN 1.0 Beta 21 (iOS)
Implemented IPv6 in iOS client.

Added new flags to redirect-gateway to control whether redirection
occurs at IPv4 or IPv6 levels (or both):

* ipv4 (default)
* !ipv4
* ipv6
* !ipv6

Added new directive "redirect-dns yes|no".  If yes, all DNS requests
will be forwarded through pushed DNS servers.  If no, only DNS
requests that match domains enumerated in "dhcp-option DOMAIN"
directives will be forwarded.  If redirect-dns is omitted, it will
default to yes if redirect-gateway is specified at the IPv4 level
(this is the normal pre-existing behavior).

Allow the following aggregated options that are normally pushed by
the server to be defined in the config file as well.  These options
will be combined with server-pushed options:

* route
* route-ipv6
* redirect-gateway
* redirect-private
* dhcp-option

Allow the following singleton options (i.e. options that don't
aggregate), that are normally pushed, to be defined in the config
file (note that server-pushed singleton options will override the
config file setting):

* redirect-dns

The Connection Details section of the UI now displays VPN IP
addresses for IPv4 and IPv6.

Added new pushable option "client-ip IP_ADDR" that can be pushed
by the server with the client's IP address as seen by the server.
The client will then show the address in the Connection Details
section of the UI.
2012-10-03 09:03:02 +00:00
James Yonan
021d2dc362 Turned off LZO library linkage for iOS and Android (but enable
LZO-Asym decompression module).
2012-09-26 08:37:28 +00:00
James Yonan
aea9017965 Turn on LZO again. 2012-09-20 05:59:12 +00:00
James Yonan
dcd62a79e6 Allow test/ssl/proto.cpp to be run on Mac OS X with PolarSSL
used as both client and server implementation.

Added DH support to PolarSSL.

Added CLIENT_NO_RENEG and SERVER_NO_RENEG flags to test code
in proto.cpp to allow scenarios to be tested where either
the server, client, or both initiate renegotiation.

Updated test/ovpncli/cli.cpp with new command line options
and will now run on Mac OS X.

Updated Android and iOS build systems to no longer include
any LZO support, and to include Snappy support instead.
2012-09-15 06:56:18 +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
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
fd0f89bbfd PT Android core can now be built with
PT=1 ./build-android-polar

from ovpn3/javacli directory.

Turned off inclusion of standard LZO library, but
LZOAsym is now active for downlink decompression.
2012-09-09 03:41:47 +00:00
James Yonan
0caeeb533e Turned on snappy compression support in mobile clients. 2012-09-08 23:02:09 +00:00
James Yonan
4136c1d618 Compression selector in mobile clients is now 3-state:
yes -- support compression on both uplink and downlink
asym -- support compression on downlink only
no (default) -- no compression (stubs only)

Added our own internal LZO decompressor, which is enabled when
HAVE_LZO is undefined and the standard LZO library is not linked.
This allows clients to support LZO in downlink mode only
if the library isn't available.
2012-09-08 01:36:54 +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
2db1ead53f Updated Android client to build with latest core. 2012-08-25 05:05:35 +00:00
James Yonan
a6b6d487ef Global edit to add copyright notice at head of each source file. 2012-08-24 21:13:42 +00:00
James Yonan
e4d4b4d9f9 Updated Android build for Android Market:
* updated version number to 1.0
* removed expiration
2012-06-20 20:20:11 +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
ce9820fed5 Moved ovpncli.hpp and ovpncli.cpp to client/ so that they can be used
by library wrappings other than javacli.
2012-05-23 05:05:42 +00:00
James Yonan
f8f2cb5a81 Added special build for Private Tunnel. 2012-04-18 00:42:33 +00:00
James Yonan
d5a32c5a75 Copyright updates.
OpenSSL license now embedded in core.
Added OpenVPNClient::copyright() method.
Beta expire extended to 2012.6.1.
2012-04-17 22:12:27 +00:00
James Yonan
6fb53c3abb Fixed a race condition issue with "hot connect", i.e. sending a
connect intent to service when already connected.  

One of the ramifications of the "hot connect" fix above is that
OpenVPNClientBase.is_active() will now return a value that is
instantaneously up-to-date, whereas events might lag because
of the mechanics of inter-thread message posting.  Keep this in
mind when correlating received events to is_active() values.

For C++ core threads, increased allowed thread-stop delay to 2.5
seconds before thread is marked as unresponsive and abandoned.
Previous delay was 1 second.  This delay can't be made too long,
otherwise Android will tell the user that the app is unresponsive
and invite them to kill it.

When closing out an abandoned core thread, indicate this condition
with a new event type called CORE_THREAD_ABANDONED.  If the thread
is abandoned due to lack of response to a disconnect request, then
the CORE_THREAD_ABANDONED event will occur followed by
CORE_THREAD_INACTIVE.  For core threads that properly exit,
the DISCONNECTED event will be followed by CORE_THREAD_INACTIVE.

Added save_as_filename parameter to importProfileRemote method for
controlling the filename that the imported profile is saved as.
This parameter may be set to null to have the method choose an
appropriate name.  To have an imported profile replace an existing
profile, the filenames much match.

Added UI_OVERLOADED debugging constant to OpenVPNClient to allow
the UI to connect to a profile when already connected to another
profile in order to test "hot connect".

Added new events CLIENT_HALT and CLIENT_RESTART for compatibility
with an Access Server feature that allows the server to remotely
kill or restart the client.

When connecting a profile, the core will now automatically fill in
the username if it is not specified for userlocked profiles.

Version 0.902.
2012-03-31 16:08:20 +00:00
James Yonan
7fd2b81ca7 Use -fvisibility=hidden instead of -fwhole-program for Linux
builds as well.
2012-03-25 00:35:26 +00:00
James Yonan
8528564b51 For Android builds, moved away from gcc -fwhole-program in favor
of -fvisibility=hidden.
2012-03-25 00:26:50 +00:00
James Yonan
e7cc39a99f Change build script for java-wrapped core to use a two-step
build process, one for core and one for java wrapper.
This is so that different optimization flags can be applied
to each step.  In particular, the wrapper needs
-fno-strict-aliasing, but the core does not.
2012-03-24 20:22:24 +00:00
James Yonan
d4066b10a2 Minor tweaks to previous commit (PolarSSL use of OpenSSL ciphers/digests). 2012-03-23 20:43:09 +00:00
James Yonan
04c68e3e7a Android 4 -- Added Import from Access Server. 2012-03-19 16:13:06 +00:00
James Yonan
0146e7f262 First working version of Android 4 client with PolarSSL.
Added build-android-polar and supporting scripts.
2012-03-14 06:11:07 +00:00
James Yonan
1b0088ab2e PolarSSL support fully implemented (except for External PKI). 2012-03-14 00:51:40 +00:00
James Yonan
12a648bc1a Minor debug var edits. 2012-03-12 12:42:02 +00:00
James Yonan
74503a4efa Started PolarSSL port. Initially just add RNG support.
Because PolarSSL RNG requires state object, add state
objects for all other RNG providers (OpenSSL, Apple SSL)
to maintain a polymorphic model.
2012-03-11 12:09:25 +00:00
James Yonan
eca10fa23d Minor changes to Android 4 client and core:
* clear_auth() now clears username field.

* OpenSSL impl in core now logs TLS handshake details.

* Added build-openssl-small to build a trimmed-down version
  of OpenSSL.
2012-03-11 04:59:51 +00:00
James Yonan
e82d3986d9 Android 4:
* Added beta expiration capability.  Current expiration is May 1, 2012.

* Fixed issue where closing the OpenVPNClient activity would sometimes
  wrongly shut down the service.

* Moved additional methods from OpenVPNClient into OpenVPNClientBase.
2012-03-10 04:55:32 +00:00
James Yonan
31fd2f7437 Fix some breakage between Android and JDK clients. 2012-03-08 10:50:26 +00:00
James Yonan
b13a527308 Android 4:
* Implemented connection timeout.
* Implemented show raw stats page.
* Work around issue where sometimes core doesn't stop when
  stop() method is called, because of delays in canceling
  Asio DNS resolution thread.
2012-03-07 11:21:09 +00:00
James Yonan
deffceea7e Android 4 -- Implemented External PKI. 2012-03-06 06:06:54 +00:00
James Yonan
d77865d0a5 Android 4 -- Interim checkpoint for External PKI development. 2012-03-04 23:05:26 +00:00
James Yonan
a1626d3149 Android 4 client & core -- implemented server and protocol override. 2012-03-03 11:09:05 +00:00
James Yonan
3a04648684 Android 4 client -- Implemented dynamic challenge/response. 2012-03-03 02:56:58 +00:00
James Yonan
efd1139571 Implemented base64 so static challenge/response now works.
Refactored some of the base Activity stuff into
OpenVPNClientBase.java.

Clients sending intents to OpenVPNService should use
OpenVPNService.INTENT_PREFIX as a key prefix when
calling putExtra.
2012-03-01 22:50:57 +00:00
James Yonan
82d4a24489 Android 4 UI work:
* Multi-profile support.
* UI now only shows required fields for each profile.
* Added support for server field.
* Added support for static challenge/response.
* Persist profile/server settings to preferences store.
2012-03-01 08:11:00 +00:00
James Yonan
7c418424ca Android 4 client fixes:
Fixed session ID -> password replacement.

Allow username to be specified as profile/username.
2012-02-27 23:00:29 +00:00
James Yonan
b29109c6c2 explicit-exit-notify fixes. 2012-02-27 08:16:27 +00:00
James Yonan
f8d60013de In Android 4 client, implemented a Connectivity message receiver which
pauses client when the network is unavailable.
2012-02-27 05:11:22 +00:00
James Yonan
0ded1a4dd7 Comment reformatting for rendering header files to PDF.
Fixed minor issue on Linux build of Java client relating to TunBuilder.
2012-02-25 07:37:31 +00:00
James Yonan
c1970047d7 Android UI enhancements. 2012-02-24 19:50:14 +00:00
James Yonan
e1410fd891 Minor UI improvements:
* Added OpenVPN icon
* Show only important events in UI
2012-02-20 05:38:52 +00:00
James Yonan
41a454815a First fully-working Android build. 2012-02-20 03:27:20 +00:00
James Yonan
5aedea3066 Added #define USE_TUN_BUILDER for enabling TunBuilderBase functionality.
Fix regressions in Linux JDK test build (Main.java).

Other misc fixes.
2012-02-19 19:06:44 +00:00
James Yonan
3f30ffc74f Added additional files missing from previous commit. 2012-02-19 17:43:42 +00:00
James Yonan
6f96b363c2 Fix minor regression in test code. 2012-02-19 02:07:54 +00:00
James Yonan
da248a8fbd Search/replace of:
std::exception& e

to:

  const std::exception& e
2012-02-17 19:28:44 +00:00
James Yonan
540c58e5d8 Android client successfully tested with null tun/tap. 2012-02-16 20:46:38 +00:00
James Yonan
f2ab7971f9 checkpoint 2012-02-15 22:32:45 +00:00
James Yonan
db2a195dff In OpenVPNClientThread, make wait_thread() void, and get status
instead from connect_status().
2012-02-15 19:39:51 +00:00
James Yonan
17ba45b487 Allow OpenVPNClientThread.wait_thread() to be called repeatedly
without issue.
2012-02-15 19:07:33 +00:00
James Yonan
bc02566ed9 Split OpenVPNClientThread.connect() into two methods: (1) connect()
establishes the client connection thread, and (2) wait_thread()
waits for client connection thread completion.
2012-02-15 18:59:24 +00:00
James Yonan
7573a2dea6 Added AuthFailed as an event type. 2012-02-15 18:19:34 +00:00
James Yonan
736dc3a0b8 Additional minor refactoring. 2012-02-15 15:13:35 +00:00
James Yonan
8b3a5d9c3a Refactored java client using ClientEventReceiver interface. 2012-02-15 14:45:55 +00:00
James Yonan
aa43f81e04 Renamed Java-wrapped class OpenVPNClient to OpenVPNClientBase to avoid naming conflicts. 2012-02-14 17:47:01 +00:00
James Yonan
5394a28d2e Added script to build libovpncli.so (Java-wrapped client) for Android.
Required r12868 from swig svn:

http://swig.svn.sourceforge.net/viewvc/swig/trunk/Lib/java/director.swg?view=log
2012-02-14 15:20:15 +00:00
James Yonan
1f5e50d733 Implemented OpenVPNClient stats methods.
Simplified autologin sensing.
Java test client will now dump stats on exit.
2012-02-12 23:09:28 +00:00
James Yonan
f13ed3e7a8 Implemented Java client using Swig. 2012-02-11 14:02:51 +00:00