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

56 Commits

Author SHA1 Message Date
James Yonan
07bcab9ab3 Extend is_close_tag() in options.hpp to search for
wildcard close tag if tag string is empty.
2015-10-01 16:29:38 -07:00
James Yonan
ba91532554 In merge.hpp, detect multiline breakout attempt. 2015-09-18 21:25:40 -07:00
James Yonan
48a9d237d7 In options.hpp, added detect_multiline_breakout() method as
a security check to ensure that untrusted content pasted into
multiline config file directives such as:

<cert>
. . .
</cert>

doesn't try to break out of the pseudo-XML block
by inserting its own </cert>.
2015-09-18 10:19:38 -07:00
James Yonan
03057dee0d In OptionList, touched_ private bool is now mutable AND
volatile.  The volatile qualifier is added because
OptionList const methods are often called from multiple
threads concurrently.
2015-09-06 16:42:39 -07:00
James Yonan
c4a9cea3e1 Updated Windows client for VS 2015. 2015-06-09 11:21:41 -06:00
James Yonan
88518335c4 Boost dependency elimination -- change boost::algorithm
usage (for string algorithms) to use methods of our own
implementation in openvpn/common/string.hpp.
2015-06-04 19:22:59 -06:00
James Yonan
597c2837f4 In class Option, change storage class of "bool touched_" to
mutable so we can set it without having to resort to const_cast.
2015-06-03 23:50:34 -06:00
James Yonan
b75c780cab Renamed boost::intrusive_ptr<T> usage to RCPtr<T>. 2015-05-17 21:26:53 -06:00
James Yonan
35ac9f6229 Renamed types.hpp to size.hpp since it now only defines
size_t and ssize_t.
2015-05-17 13:27:34 -06:00
James Yonan
fe6fcefa61 C++11 : rename NULL to nullptr 2015-05-17 02:53:37 -06:00
James Yonan
53e6af884a In OptionList, added get_optional_relaxed() and
get_default_relaxed() methods.
2015-05-13 21:55:32 -06:00
James Yonan
0fde33173a C++11 update: mass replace of boost::uint/int to std::uint/int. 2015-04-23 17:55:07 -06:00
James Yonan
9d9c51d6f4 C++11 update -- converted boost::unordered_map usage to
std::unordered_map.
2015-04-23 14:08:54 -06:00
James Yonan
069de90ffd minor C++11 updates:
* rename BOOST_NOEXCEPT to noexcept

* verify that certain classes are noexcept move constructable
  including Option, Buffer, BufferAllocated, RunContext::Thread
2015-04-23 12:49:25 -06:00
James Yonan
a206d08820 Added OptionList::get_optional_noexcept method. 2015-04-09 15:21:56 -06:00
James Yonan
90d98c8fac class OptionList now inherits from RCCopyable. 2015-02-03 17:34:13 -07:00
James Yonan
58de6a371d Added class OptionList convenience method get_num()
with range checking.
2015-01-12 18:35:53 -07:00
James Yonan
c2c7292a70 Updated copyright to 2015. 2015-01-06 12:56:21 -07:00
James Yonan
0acb038808 Added class OptionList convenience methods get_default()
and get_num().

Also, get_optional() should return a std::string, not a
const std::string.
2014-12-29 21:54:23 -07:00
James Yonan
464690aa6b Added class ServerPushList for keeping track of
push "..." directives on the server.
2014-12-29 21:51:08 -07:00
James Yonan
ea29858135 Added Option::get_default method. 2014-12-13 21:20:29 -07:00
James Yonan
f5ff65562e OptionList, Option:
* Make use of C++11 move semantics for optimization, especially
  where std::vector<Option> is pushed onto OptionList.

* Fixed bug in Option::render() where arguments would be
  printed without any delimiter if RENDER_BRACKET flag was
  absent.

* Added parse_from_peer_info() method, for parsing peer info
  string received from client.
2014-10-30 10:36:33 -06:00
James Yonan
2c6d972ad6 Added AGPL copyright/licensing language. 2014-07-20 21:22:06 -06:00
James Yonan
03cf311f75 Windows: fix some MSVC compiler warnings. 2014-02-08 00:13:23 -07:00
James Yonan
b6d17ba69e Added Option::escape() method.
Minor string/option refactoring.
2013-12-28 20:20:21 -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
cf39be0516 Log unused options, i.e. options specified in config file that were
unrecognized, ignored, or unused.

This behavior is somewhat different (by design) to 2.x branch, which
will raise a fatal exception if an unrecognized option is
encountered.
2013-06-10 00:42:19 +00:00
James Yonan
906584ba3b Support "setenv opt" prefix before directives, where
its presence indicates that the directive is optional,
i.e. if a client doesn't understand the directive, it
should simply ignore it.
2013-06-08 16:10:35 +00:00
James Yonan
e92899c490 Relax options parser a bit and follow OpenVPN 2.x behavior
where if more than one instance of an option exists, and
a single instance of the option is required, use the last
instance.  Previously we would raise an exception in this case.
2013-06-03 06:31:22 +00:00
James Yonan
bbaaf65b0a Fixed options parsing issue if non-aggregate option was
specified in profile as well as pushed by server
(the pushed version should win).
2013-05-25 01:13:11 +00:00
James Yonan
cebc610e8e Implemented route-nopull (second attempt). 2013-03-14 02:54:58 +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
5055dedbfc Core: fixed issue with parsing time period options (such as
"reneg-sec"), where if period is 0, we must treat it as essentially
infinite.  This fixes the issue where "reneg-sec 0" was causing an
infinite connect loop.

Refactored number.hpp to provide all reasonable number-parsing
functionality, so that typeinfo.hpp can be retired.
2013-01-20 06:34:49 +00:00
James Yonan
4d9a751af2 Added head comments to all source files.
Minor reorganization of unicode code.
2012-11-23 06:18:43 +00:00
James Yonan
daa97ededd Added support for <connection> blocks in profile. 2012-11-14 05:12:48 +00:00
James Yonan
31d87f09a4 Extend config file parser to recognize end-of-line comments
that start with # or ;

To pass these chars as part of an argument, make sure to quote
them.
2012-11-14 03:25:59 +00:00
James Yonan
32a117242e More profile validation. 2012-11-14 02:35:50 +00:00
James Yonan
05aed22147 Allow multi-cert directives like ca and extra-certs to be specified
multiple times in the config file.
2012-11-12 16:17:25 +00:00
James Yonan
df51e2bfc3 Minor SplitLines changes. 2012-11-12 02:33:20 +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
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
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
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
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
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
48ab9cbbe9 Added our own system() implementation to allow args to be passed as
array instead of concatenated string, and to resolve issue on OS X
where signals were being ignored after system() was called.

C++ iterators incremented in a for statement should usually use
a preincrement syntax.
2012-09-12 04:24:05 +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
deffceea7e Android 4 -- Implemented External PKI. 2012-03-06 06:06:54 +00:00
James Yonan
71c5d1a35f Added meta option parsing capability to options parser. 2012-02-29 01:59:01 +00:00
James Yonan
f094241aa8 Android 4 client port is almost working (need to get an Android
build that includes tun driver to test further).
2012-02-19 01:36:50 +00:00