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

659 Commits

Author SHA1 Message Date
James Yonan
c1cf872d75 Core: In PolarSSL module, fix potential NULL pointer
dereference in ssl_handshake_details().
2014-08-10 17:52:27 -06:00
James Yonan
4b5cbc4cc6 Added AsioDispatchComposedConnect for dispatch/callback
to an Asio ComposedConnectHandler.
2014-08-10 17:17:11 -06:00
James Yonan
41f05b6e25 Created a new source file openvpn/buffer/bufstr.hpp for
Buffer conversions to/from std::string.

Moved the existing Buffer::to_string method into bufstr.hpp
as buf_to_string.
2014-08-10 17:11:31 -06:00
James Yonan
564dcdc2cf Added C++11 move construction/assignment to CF::Wrap,
BufferAllocatedType, ScopedPtr, and ScopedFD.
2014-08-10 16:53:39 -06:00
James Yonan
2f593bd2eb Added OpenVPNClient::uninit_process() API method that calls
InitProcess::uninit().

In test/ovpncli/cli.cpp, move boost::thread* to higher scope.
2014-08-10 16:44:09 -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
280e1905f6 Updated lib-versions:
LZ4 to r120
  Snappy to 1.1.2
2014-07-27 23:47:06 -06:00
James Yonan
708c19d20c Core: in PolarSSL driver, remove ssl_session object on
Paul Bakker's advice that this is not needed in 1.3.
2014-07-23 19:30:28 -06:00
James Yonan
2c6d972ad6 Added AGPL copyright/licensing language. 2014-07-20 21:22:06 -06:00
James Yonan
4359401d3f Removed some obsolete patches from PolarSSL build. 2014-07-11 13:10:41 -06:00
James Yonan
5129b4402c Minor addition to CF helper code:
Added CF::Wrap<T>::from_generic() method.
2014-07-11 00:32:59 -06:00
James Yonan
d5e72f7806 Updated dependencies and build scripts for building with Xcode 5.1:
* Updated lib-versions:

  lzo-2.08
  lz4-r119
  polarssl-1.3.8
  openssl-1.0.1h

* Turned off Minicrypto as it is broken on polarssl-1.3.8.
2014-07-09 17:51:03 -06:00
James Yonan
08e6937cc5 Core: workaround for LZO integer overflow bug. Don't accept
decompressed payloads larger than 64KB.
2014-07-09 17:44:47 -06:00
James Yonan
820b0720ff Core: Fixed issue in base64.hpp with typo in expression that
terminates loop through char array.

This is functionally a no-op because the
(*p == equal || is_base64_char(*p)) term will effectively
terminate the loop when *p != '\0' because is_base64_char(0)
returns 0.
2014-07-07 14:46:44 -06:00
James Yonan
79626ea0e4 Updated PolarSSL to 1.3.7. 2014-05-05 12:51:01 -06:00
James Yonan
c77af1e85a Core: added CRL support (crl-verify directive) to PolarSSL module. 2014-04-22 01:55:05 -06:00
James Yonan
3a5683d820 Library update:
* polarssl-1.3.6
* openssl-1.0.1g
2014-04-22 01:43:40 -06:00
James Yonan
b64677509e Added vars-osx64 for Mac OS X 64-bit builds only. 2014-04-07 21:15:25 -06:00
James Yonan
46035eff57 Windows build system config changes:
* Update TAP driver source path to point to NDIS 6 version.

* By default, build community version that binds to "tap0901"
  instance of TAP driver.
2014-04-04 10:02:33 -06:00
James Yonan
f48a7fe7fc Windows: fixed bug in "topology net30" where second parameter passed
to TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT ioctl was incorrect.
2014-04-04 10:02:33 -06:00
James Yonan
ac932aa575 Minor changes to Mac OSX tuncli.hpp module:
For add_del_route() on IPv6 routes, don't output the gateway
as an IP address if R_IFACE is provided.  Instead use the
-iface option.

Use R_IFACE_HINT when IPv6 route gateway is on real IPv6
interface.  This causes %interface to be appended to the
gateway address.

Use R_IFACE when IPv6 route gateway is utun interface.
This will cause -iface utunX to be used as route gateway
option rather than an explicit IP address.

Note that these changes, by themselves, still don't fix issue
where blocking IPv6 during pause/reconnect, when the transport
is running over IPv6, prevents further connections, so this
code remains #ifdefed out.
2014-04-03 16:09:22 -06:00
James Yonan
fc121f1516 Added block-ipv6 support for Mac OS X.
An issue remains where blocking IPv6 during pause/reconnect, when
the transport is running over IPv6, prevents further connections,
so this code has been #ifdefed out.
2014-04-03 09:30:14 -06:00
James Yonan
206712fddc Fixed option parsing typo where "redirect-gateway block-local"
was misspelled as "block_local".
2014-04-01 17:43:50 -06:00
James Yonan
5f1f3855a5 On Mac OS X, use SystemConfiguration framework to get IPv4/IPv6
default gateway addresses (class MacGWInfo).  Since IPv6 gateway
is now available, it is possible to properly add IPv6 bypass
routes.
2014-04-01 02:08:16 -06:00
James Yonan
5c009430bb New implementation of tunPersist for Mac OS X based on FailsafeBlock
strategy, where the default route and DNS client are redirected to
localhost during pause/reconnect.
2014-03-30 23:21:28 -06:00
James Yonan
e92dd5b042 Fixed issue with OS X TunMac code, where pushed routes were being
added with a route command that improperly set the route gateway.
2014-03-28 18:53:16 -06:00
James Yonan
a319b33954 Core: fixed "topology net30" issue where code was not correctly
determining the route-gateway.
2014-03-28 18:53:16 -06:00
James Yonan
40a1842502 Implemented non-echoed console prompt for password in cli wrapper
(Unix platforms only).
2014-03-28 18:53:15 -06:00
James Yonan
32ba7fb29f Ripped out persist-tun logic in TunMac::Client because it doesn't
work:

1. utun dev wrapper doesn't seem to survive reconnects, and
2. route hole punching for server address is required for
   subsequent reconnects to succeed

Split TunPersistTemplate into two classes, TunPersistTemplate
and TunWrapTemplate.

TunPersistTemplate now inherits from TunWrapTemplate and is
functionally unchanged.

TunWrapTemplate can be used to minimalistically wrap the tun
instance in cases where persistence isn't required.

Renamed TunPersistAsioStream to TunWrapAsioStream.
2014-03-28 18:51:36 -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
e3388ff1ec On Mac, create a DNS watchdog thread to monitor for potential changes
to DNS settings by a foreign actor.  If changes are detected,
revert them.
2014-03-24 17:23:17 -06:00
James Yonan
91f82f1276 cli wrapper now handles SIGUSR1/SIGUSR2:
SIGUSR1: print stats
SIGUSR2: toggle pause/resume state
2014-03-24 16:53:19 -06:00
James Yonan
68a6b6d730 On Mac OS X, slightly tweak the DNS cache flush method
based on current OS X version.  The cache flush method
is called on connect and disconnect.

Previously, we always followed the 10.9 method.  So this
change is a no-op on 10.9.

OS X 10.9 or higher (Mavericks):

  /usr/bin/dscacheutil -flushcache
  /usr/bin/killall -HUP mDNSResponder

OS X 10.7 & 10.8 (Lion and Mountain Lion):

  /usr/bin/killall -HUP mDNSResponder

OS X 10.6 (Snow Leopard)

  /usr/bin/dscacheutil -flushcache

We don't support earlier OS X versions.
2014-03-21 17:07:17 -06:00
James Yonan
1cb534053b Core: further attempts to disable SSL renegotiation and/or session
resumption due to Triple Handshake vulnerability.

OpenSSL driver: Set SSL_OP_NO_TICKET flag.

PolarSSL build: #undef POLARSSL_SSL_SESSION_TICKETS
2014-03-15 15:18:35 -06:00
James Yonan
05aa744dce TunWin::Client now tries to delete any stale routes on
interface left over from previous session.
2014-03-06 19:08:57 -07:00
James Yonan
141182e21e Support pushed DNS search domains in TunWin::Client. 2014-03-06 00:27:41 -07:00
James Yonan
c1cf0d7375 In ActionList::execute(), catch exceptions and log them. 2014-03-06 00:27:41 -07:00
James Yonan
1d825fcc20 When setting DNS servers on Windows, use netsh option
"register=primary".  This appears to improve DNS
responsiveness.
2014-03-06 00:27:41 -07:00
James Yonan
b414dc6d12 * TunWin::Client now configures a default gateway for the IPv4
side of the TAP interface using the "gateway=" option in the
  netsh interface ip set address command.  This seems to mostly
  solve the issue of the TAP adapter appearing to be unconnected
  to the internet in the Control Panel.

* Adapted TunWin::Client to work with ActionList (instead of
  WinCommandList) as the mechanism for executing netsh commands.

* Included sample code (test/unused/win-tuncli-actionthread.diff)
  for embedding an ActionThread in TunWin::Client.
2014-03-06 00:27:41 -07:00
James Yonan
9e35e41fb4 Added ActionThread class to allow Action objects to be
executed asynchronously in a worker thread.

Needed to make some changes to logthread as well
to allow log context to be made available to
the worker thread.
2014-03-06 00:27:41 -07: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
ebd47cb635 Updated PolarSSL crypto self-test in the core for PolarSSL 1.3.x
using new shaX method names.  Also updated proto.cpp test suite
to run SelfTest::crypto_self_test on startup.
2014-03-04 10:42:07 -07:00
James Yonan
48fd793c4e Minor changes to test suite test/ssl/proto.cpp:
* On Windows, allow build parameters to be specified in
  protowin.h.

* For client and server, initialize tls_version_min to
  TLSVersion::UNDEF.
2014-03-03 18:43:13 -07:00
James Yonan
b95c7dff1a Core: when tls-version directive is unspecified, internally
represent that as TLSVersion::UNDEF.  For OpenSSL driver,
TLSVersion::UNDEF will trigger legacy TLSv1 connections
using TLSv1_server_method() and TLSv1_client_method().
2014-03-03 18:38:44 -07:00
James Yonan
ce70a32578 Core: implement force_aes_cbc_ciphersuites for OpenSSL. 2014-03-03 16:52:18 -07:00
James Yonan
e1b91621e6 Fixed minor issue with test/ovpncli/cli.cpp on Windows where it
was not draining the keyboard input buffer after every sample
period, potentially causing delays in handling of keyboard events.
2014-03-03 15:48:52 -07:00
James Yonan
12480e2efd Core: ported PolarSSL driver from PolarSSL 1.2.10 -> 1.3.4. 2014-03-03 14:50:52 -07:00
James Yonan
bd02377947 Changes to core self test test/ssl/proto.cpp :
* Fixed compile issue due to need to replace cc.enable_debug()
  with cc.ssl_debug_level = 1.

* Added RENEG var to control number of "virtual seconds" between
  SSL renegotiations.

* Doc changes in README.txt.
2014-03-03 14:43:38 -07:00
James Yonan
4491ce194f Added --google-dns, -g, enable Google DNS fallback option to
cli.cpp frontend.
2014-03-03 14:41:25 -07:00
James Yonan
5975b4b53c Core build script changes:
* Added new cross-platform boost/build-boost script.

* Added new LINK_MODE var (static|shared) that is
  used by Boost, PolarSSL, and OpenSSL (Linux) builds.

* More DEP_DIR flexibility:
  (a) DEP_DIR can be defined prior to call of build-all scripts.
  (b) On Linux, vars-linux script will not override DEP_DIR.
2014-03-03 14:34:39 -07:00