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

75 Commits

Author SHA1 Message Date
Samuli Seppänen
04b2a3c9b7 Switch from AGPLv3 to GPLv3
Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
2017-03-16 14:43:55 +02:00
James Yonan
971abda88f copyright : updated to 2016 2016-09-03 23:29:23 -06:00
James Yonan
662bf7833e ovpn3 core : Added automatic data limits for Blowfish,
Triple DES, and other 64-bit block-size ciphers vulnerable
to "Sweet32" birthday attack (CVE-2016-6329).  Limit such
cipher keys to no more than 64 MB of data
encrypted/decrypted.  While our overall goal is to limit
data-limited keys to 64 MB, we trigger a renegotiation
at 48 MB to compensate for possible delays in renegotiation
and rollover to the new key.

This client-side implementation extends data limit
protection to the entire session, even when the server
doesn't implement data limits.

This capability is advertised to servers via the a
peer info setting:

  IV_BS64DL=1

meaning "Block-Size 64-bit Data Limit".  The "1" indicates
the implementation version.

The implementation currently has some limitations:

* Keys are renegotiated at a maximum rate of once per
  5 seconds to reduce the likelihood of loss of
  synchronization between peers.

* The maximum renegotiation rate may be further extended
  if the peer delays rollover from the old to new key
  after renegotiation.

Added N_KEY_LIMIT_RENEG stats counter to count the number
of data-limit-triggered renegotiations.

Added new stats counter KEY_STATE_ERROR which roughly
corresponds to the OpenVPN 2.x error "TLS Error:
local/remote TLS keys are out of sync".

Prevously, the TLS ack/retransmit timeout was hardcoded to
2 seconds.  Now we lower the default to 1 second and make
it variable using the (pushable) "tls-timeout" directive.
Additionally, the tls-timeout directive can be specified
in milliseconds instead of seconds by using the
"tls-timeout-ms" form of the directive.

Made the "become primary" time duration configurable via
the (pushable) "become-primary" directive which accepts
a number-of-seconds parameter.  become-primary indicates
the time delay between renegotiation and rollover to the
new key for encryption/transmission.  become-primary
defaults to the handshake-window which in turn defaults
to 60 seconds.

Incremented core version to 3.0.20.
2016-09-01 15:19:00 -06:00
James Yonan
5957ab8af1 server APIs : added set_acl_id(), set_fwmark(), and changed
the signature of push_reply().
2016-08-17 11:36:34 -07:00
James Yonan
a3ecdf3260 route : removed mark as a route-specific property. 2016-08-17 11:31:11 -07:00
James Yonan
689bfd7e8f keepalive : added is_keepalive_enabled() method. 2016-07-12 22:15:35 -07:00
James Yonan
2f1fd1ad83 Added INFO notification to OpenVPN control channel protocol:
INFO,<payload>

Payload can be any UTF-8 printable string under 64 KB
(multiple lines are okay).

INFO notifications can be sent from server to client
in real-time, on any active client connection.

The client will attach the payload to an INFO event and
forward it to the controlling app via the event callback:

  virtual void event(const Event&) = 0;
2016-05-10 17:53:09 -06:00
James Yonan
4083281bd1 buffer : added Buffer::null_terminate() method to
null-terminate a buffer that is not already null-terminated.
2016-05-10 17:50:03 -06:00
James Yonan
74d89fab7c OpenVPN protocol core : when passing objects to methods that
may assert ownership over them, use C++11 rvalue/move
semantics.
2016-05-10 13:02:11 -06:00
James Yonan
2255bab03a OpenVPN protocol core : added logic to control channel
receive path to reassemble messages fragmented by the
SSL layer up to a max message size of 64 KB.

Ramifications:

* Peer info data and pushed options can be significantly
  larger (i.e. approaching 64 KB).

* Less need for the options continuation feature.

Limitations:

* While this patch doesn't change the underlying OpenVPN
  protocol, it can result in messages being sent that are
  fragmented by the receiving SSL implementation into
  multiple buffers.  Implementations that lack reassembly
  capabilities (such as OpenVPN 2.x at this point in time)
  would see each buffer fragment as a separate message.

* This patch running on the server will break negotiation
  with pre-peer-info clients.  Basically this means it will
  interoperate with any OpenVPN 3 version or OpenVPN 2.x
  version that includes the June 2010 commit "Implemented a
  key/value auth channel from client to server.
  Version 2.1.1i".
2016-05-09 21:39:04 -06:00
James Yonan
cd1a20964b vpnservpool : major refactor for OMI.
* eliminated the GENERAL_POOL enumeration and vector.

* added support for standalone "ifconfig-push" directive
  as alternative to "server" for OMI agents that
  manage their own IP address pools.
2016-05-05 00:37:10 -06:00
James Yonan
a2fe68ae68 HaltRestart : added new RAW type for OMI. 2016-05-05 00:36:00 -06:00
James Yonan
6965eade7a class Protocol : add enum for client/server suffix. 2016-05-05 00:13:43 -06:00
James Yonan
71cb95c436 servproto : push_halt_restart_msg() needs to ensure
that time is up-to-date.
2016-04-14 13:38:47 -06:00
James Yonan
acf59d7600 Added request_ipv6 bool to VPNServerPool acquire() methods. 2016-02-04 15:53:46 -07:00
James Yonan
871f4c1299 Added VPNServerPool::IP46::to_string() method. 2016-01-27 14:14:57 -07:00
James Yonan
e8a63d1fdd Added HaltRestart::RESTART_PASSIVE type that sends a
RESTART_PSID to client but doesn't disconnect the internal
client instance object.
2016-01-27 14:12:33 -07:00
James Yonan
958d27d0c2 Added AUTH_FAILED to HaltRestart::Type.
In ServerProto::Session (servproto.hpp),
push_halt_restart_msg() can now push AUTH_FAILED messages
as well.

In fact ServerProto::Session::auth_failed() is now defined
in terms of push_halt_restart_msg().
2016-01-26 23:32:49 -07:00
James Yonan
030ede7a96 Added class IP46AutoRelease, derived from IP46, that automatically
releases allocated IP addresses in the destructor.
2016-01-26 23:30:48 -07:00
James Yonan
89ead953b3 Added Listen::Item::port_offset() method for generating
sequences of port numbers.
2016-01-18 00:37:37 -07:00
James Yonan
db118c46ff In Listen::Item, use C++11 member initialization. 2015-11-20 19:03:08 -07:00
James Yonan
32b6912931 Added Windows named-pipe support to RemoteList,
Listen::List, Protocol, and AsioPolySock.
2015-10-16 21:00:51 -06:00
James Yonan
9023c34929 Changes to vpnservnetblock.hpp and vpnservpool.hpp to
allow the use of multiple server-side VPN IP address
pools.
2015-09-20 20:58:35 -07:00
James Yonan
276a52d811 Added SSL switch (on/off/unspecified) to Listen::Item.
When parsing listen directives, "ssl" or "!ssl" may
be specified as the last parameter to set the ssl
switch.  By default, the switch is set to unspecified.
2015-09-08 05:58:32 -07:00
James Yonan
e0a51ad181 Added LoadMode enum on Listen::List constructor that supports
empty construction via AllowEmpty.
2015-09-02 03:20:12 -07:00
James Yonan
aa01b37d74 Added API method so management implementations can access
client bandwidth stats.
2015-07-18 14:19:08 -07:00
James Yonan
883620a95c Added new Listen::List constructor that accepts a single
Listen::Item.
2015-07-04 16:05:42 -06:00
James Yonan
16bde170c0 Don't use deprecated asio features. 2015-06-30 00:05:37 -06:00
James Yonan
0ec1bf62ba Perform additional size-based sanitization on creds
before passing to ManClientInstanceSend::auth_request()
2015-06-27 16:34:41 -06:00
James Yonan
9e50e8048a Added new methods to ManClientInstanceSend API: describe_user()
and disconnect_user().
2015-06-27 16:32:19 -06:00
James Yonan
1acc33feaf Obsoleted asiodispatch in favor of C++11 lambdas. 2015-06-25 13:59:12 -06:00
James Yonan
062391463c In options parser, add support for "remote" and "listen"
directives to refer to unix domain sockets.
2015-06-24 16:23:07 -06:00
James Yonan
496e797a21 Added client hooks for DCO (Data Channel offload).
Updated tun implementation on Linux.
2015-06-17 01:48:33 -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
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
be2922de39 Refactored methods for parsing/validating hosts/ports
into openvpn/common/hostport.hpp
2015-05-19 15:01:53 -06:00
James Yonan
e609e318ca Renamed openvpn/common/port.hpp -> openvpn/common/hostport.hpp 2015-05-19 13:33:29 -06:00
James Yonan
4366b3d3de In servproto.hpp, add to list of errors common enough that they
don't need an explicit "Session invalidated:" log message.

This list currently includes:

  Error::KEV_NEGOTIATE_ERROR
  Error::KEEPALIVE_TIMEOUT
2015-05-18 17:57:20 -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
3bcf8743c1 More conversions of threads/mutexes from boost to C++11 std.
As part of this work, removed openvpn/common/thread.hpp
2015-05-10 20:04:22 -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
b1550519b1 Added default constructor for Listen::List. 2015-04-19 11:21:24 -06:00
James Yonan
d313704255 On server side, count instead of log Error::KEV_NEGOTIATE_ERROR. 2015-04-12 11:14:33 -06:00
James Yonan
73b2b41f75 Extended Listen::List/Item to support different "listen"
directives.
2015-03-19 14:02:34 -06:00
James Yonan
65b24f39e9 Server: null-terminate transmitted control channel messages. 2015-01-22 17:55:57 -07:00
James Yonan
226785cbe2 Increased initial allocation of server-side AUTH_FAILED
buffer to 128 bytes.
2015-01-22 17:54:12 -07:00
James Yonan
3350db2c41 For Listen::List parser, allow number of threads parameter
to be multiplied by the number of processor cores on the machine
using this syntax:

  listen 0.0.0.0 1194 udp 4*N

The 4*N syntax indicates that OpenVPN should spawn 4 * N threads
to listen on 0.0.0.0:1194 where N is the number of processor
cores on the machine.
2015-01-19 14:26:41 -07:00
James Yonan
6f3aed5f90 Minor debug output change. 2015-01-16 00:22:14 -07:00