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

244 Commits

Author SHA1 Message Date
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
a5c05a8e65 Comment update. 2013-02-28 17:35:06 +00:00
James Yonan
ce8171fff1 Minor fixes related to open-sourcing process. 2013-01-30 20:17:30 +00:00
James Yonan
f8f5d86b2b Android 1.1.9 build 34
* key-direction default can now be set through the ovpncli API,
  but generally defaults to -1 (bidirectional).
2013-01-28 01:11:28 +00:00
James Yonan
dd377281a5 Added cachePassword boolean to ProvideCreds struct in core API.
Separated the functionality of replacePasswordWithSessionID
and cachePassword, and allow them to be used together,
in which case the session ID will be used as the password
until it expires or is invalidated, then the cached
password will be used to reauth.
2013-01-25 02:34:20 +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
b5611c7ac0 Core: add optional state debugging for proto.hpp.
In ovpncli.cpp:

#define OPENVPN_DEBUG_PROTO   2 // enable state debugging if >= 2
2013-01-20 04:18:34 +00:00
James Yonan
be454f3971 Core change: allow "proto tcp-client" usage for compatibility
with 2.x branch.
2013-01-19 03:40:40 +00:00
James Yonan
d5874f4684 Misc client and pre-server cleanup. 2012-11-26 01:51:24 +00:00
James Yonan
c3df841fa6 Core changes for password save support. 2012-11-18 18:53:10 +00:00
James Yonan
94680833e0 Implement options for allowPasswordSave:
setenv ALLOW_PASSWORD_SAVE 0|1
  allow-password-save 0|1

By default, allowPasswordSave is true.
2012-11-18 08:55:27 +00:00
James Yonan
34a2fd7047 Add error code for PEM_PASSWORD_FAIL for conveying error up
through client API.
2012-11-16 04:13:48 +00:00
James Yonan
06acd86d29 Added core support for PEM private key passwords. 2012-11-15 22:48:13 +00:00
James Yonan
32a117242e More profile validation. 2012-11-14 02:35:50 +00:00
James Yonan
5a5a18942a Added parser size validation constants in
openvpn/client/cliconstants.hpp
2012-11-12 01:52:03 +00:00
James Yonan
4e6117a111 OpenVPN 1.0 Beta 25 (iOS)
* Added support for import of non-unified profiles via iTunes.

* Added Google DNS Fallback preference.
2012-11-07 22:03:10 +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
1c7f9e2577 Completed HTTP proxy backend implementation
in new client core:

* Added NTLMv2 authentication
2012-10-28 10:07:32 +00:00
James Yonan
5564037b7e Added new preference for Android:
DNS Fallback (enabled by default) -- Use Google DNS servers as a
fallback for connections that route all internet traffic through
the VPN tunnel but don't define any VPN DNS servers.
2012-10-24 12:37:24 +00:00
James Yonan
3ca3a857bd Initial HTTP proxy implementation in core, with support for
non-authenticated proxies and Basic Auth.

Includes new PROXY_ERROR and PROXY_NEED_CREDS events.

Still to do: Digest and NTLM auth.
2012-10-24 06:38:20 +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
3903810824 Implemented persistent tunnel, currently only working for
Android:

* Added a preference item tun_persist -- in the UI it is
  described as "Seamless Tunnel -- Block internet while VPN
  is paused or reconnecting"

* If tun_persist is enabled, hold onto tun socket during
  reconnects or pauses, and don't rebuild the tunnel
  on reconnect unless its controlling parameters have changed.
2012-10-21 09:43:03 +00:00
James Yonan
9bcdcd8da2 Deal with a corner case in time handling on 32 bit systems, where time
can wrap after ~48 days.
2012-10-20 06:05:51 +00:00
James Yonan
c23e2a8c64 Added pathway for External PKI sources to deliver the entire
cert chain to the core, rather than only the leaf cert.

This allows profiles to be used that lack "ca", "cert",
or "key" directives -- instead, these values are read from the
KeyChain.

If "ca" IS NOT defined in the profile, it will be set to
the chain of supporting certs assocated with the Keychain
leaf cert.

If "ca" IS defined by the profile, then the chain of supporting
certs will go into the "extra-certs" list, meaning that it
will support the client cert but not serve as an authority
to verify the server cert.
2012-10-19 10:29:12 +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
4aa8345036 Implement "don't restart" flag so that EPKI errors will not
retry continuously until timeout.
2012-10-07 08:59:58 +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
e64f429095 When reporting client compression capabilities to server, include
IV_COMP_STUB whenever IV_LZO_STUB is reported.
2012-09-17 21:41:41 +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
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
f31040f059 "last packet received n seconds ago" stat is now provided by core. 2012-09-05 22:03:26 +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
a6b6d487ef Global edit to add copyright notice at head of each source file. 2012-08-24 21:13:42 +00:00
James Yonan
582c8f3977 OpenVPN 1.0 Beta 13 (iOS)
* Fixed issue with non-pushed "comp-lzo" statically declared in
  config file.

* Show Peer info in log.

* Increment core version number to 1.0.
2012-08-23 14:25:50 +00:00
James Yonan
6d05850322 OpenVPN core addition -- allow session token to be recovered
from connected session.
2012-08-21 21:32:51 +00:00
James Yonan
7331ee349b Full iOS beta for OpenVPN Connect. 2012-08-01 12:28:13 +00:00
James Yonan
42f98baec7 Added transport_stats method to OpenVPN Core API. 2012-07-24 09:16:43 +00:00
James Yonan
ce9de34975 For iOS, allow client apps to subscribe to event and log notifications.
Add capability for iOS client apps (in Objective-C) to call directly
into core for static methods such as eval_profile.
2012-07-02 20:52:58 +00:00
James Yonan
f91339e739 First working iOS build. 2012-07-01 15:37:46 +00:00
James Yonan
1f7d3ac4ef Added Objective-C wrapper for client core. 2012-05-25 17:54:53 +00:00
James Yonan
ce1431f3c2 Added clilib:
* scripts to build ovpncli shared library for C++ clients
* test client test/clilib/test.cpp
2012-05-23 13:50:41 +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