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

31 Commits

Author SHA1 Message Date
Arne Schwabe
c78aaecad7 Differentiate Packet ID types into data channel and control channel ids
Data channel packet ids (in the formats that OpenVPN 3.x supports)
are plain 32 or 64 bit ids while control channel is a 32 bit time + 32
bit counter id. Seperate these more clearly and let CBC mode use the
same Packet ID implementation that AEAD mode uses.

Also add more unit tests related to data channel tests packets by
adapting the control channel test where applicable and add a few more
related to packet id wrapping

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-09-11 13:23:31 +00:00
Mark Deric
989dd7ead5 Port the psid cookie defense from ovpn2
The psid cookie defense is designed to thwart resource exhaustion and
amplification attacks wherein a malicious client sends the server a
flood of CONTROL_HARD_RESET_CLIENT_V2 packets with spooofed source
addresses.  This patch allows the server to defer client tracking
state creation until the client responds to the server's
CONTROL_HARD_RESET_SERVER_V2 message.

Signed-off-by: Mark Deric <jmark@openvpn.net>
2023-10-03 12:42:29 -07:00
David Sommerseth
dde1574596
Reformatting source code to new coding style
This is the result after running 'clang-format -i' on all C++ files and
headers, with the defined formatting rules in .clang-format.

Only the openvpn/common/unicode-impl.hpp has been excluded, as that is
mostly a copy of an external project.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2023-01-18 19:24:15 +01:00
David Sommerseth
4996c38ed4
Merge lastest changes from Core v3.7.2 2022-12-14 17:34:29 +01:00
Arne Schwabe
e9630e86d7 Rework ack logic
This commit removes the ability to pass down the windows sizes for ack
windows down from the configuration. This capability was never used and
instead the receive and send window were both hardcoded at 4. Also
change the receive window to 12 and the send window to 6 like
OpenVPN 2.6 does.

Also to improve control channel reliability, resend previous ACKs in MRU
fashion if there is still room for them in a control channel packet.

This patch is based on a patch was written
by Charlie Vigue <charlie.vigue@openvpn.net>.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-11-23 17:08:00 +01:00
David Sommerseth
8c94a8f774
copyright: Update to 2022
Signed-off-by: David Sommerseth <davids@openvpn.net>
2022-09-29 12:00:26 +02:00
David Sommerseth
3fbe0a2701
Update copyrights
Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-03-18 19:37:32 +01:00
David Sommerseth
16b10559f2 [OVPN3-140] Update company names in copyrights
OpenVPN Technologies, Inc. change their name to OpenVPN Inc. during the
autumn of 2017.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2017-12-22 17:59:39 +08:00
David Sommerseth
6caca2c313 [OVPN3-140] Relicense back to AGPLv3
This is essentially a revert of commit 04b2a3c9b7 and commit
ef42e59e05.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2017-12-22 17:59:39 +08:00
James Yonan
b2cd82a5bf copyright: updated to 2017.
Signed-off-by: James Yonan <james@openvpn.net>
2017-03-18 13:11:09 -06:00
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
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
c2c7292a70 Updated copyright to 2015. 2015-01-06 12:56:21 -07:00
James Yonan
2c6d972ad6 Added AGPL copyright/licensing language. 2014-07-20 21:22:06 -06: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
a6b6d487ef Global edit to add copyright notice at head of each source file. 2012-08-24 21:13:42 +00:00
James Yonan
bd4673c60f Added IP address classes for IPv4/v6.
Implemented get_default_gateway() for Mac OS X.
2012-01-11 06:15:32 +00:00
James Yonan
990231b226 First successful negotiation with AS.
Still need to parse and apply PUSH_REPLY options.
2011-12-16 10:02:15 +00:00
James Yonan
1aa65c259b Implemented soft reset in proto.hpp. 2011-12-13 04:46:56 +00:00
James Yonan
f3e9239d80 Full-protocol unit test using ProtoContext, w/o soft resets.
Test in test/ssl/proto.cpp.
2011-12-11 08:28:55 +00:00
James Yonan
3ed5459996 Minor fixes. 2011-12-05 21:00:43 +00:00
James Yonan
ee46876142 Added HMAC and Packet ID integrity checks to reliable/SSL test. 2011-12-05 06:11:51 +00:00
James Yonan
abf3df3039 Added PACKET abstraction to ProtoStackBase. 2011-12-04 10:55:28 +00:00
James Yonan
e4902ec958 Minor changes. 2011-12-04 06:05:34 +00:00
James Yonan
3c57bf9b05 ProtoStack with Apple SSL client and OpenSSL server
successfully tested by test/reliable/ssl.cpp.
2011-12-02 22:00:56 +00:00
James Yonan
67304fc671 Initial implementation of class ProtoStackBase.
Compiles, but not yet tested.
2011-11-30 19:47:30 +00:00
James Yonan
b45e9c2e15 Started on ProtoContext object (master OpenVPN protocol
context object).

Implemented TLS PRF functions.
2011-11-21 04:58:54 +00:00
James Yonan
f09b9ae12a Added reltest.cpp for testing ReliableRecv and ReliableSend
objects by simulating an unreliable packet stream.

Modified packet_id code so that current time (now) is passed
via function calls rather than accessed as a global.

Added integer random number support via boost::random.
2011-11-09 05:52:52 +00:00
James Yonan
b1b313ec28 Implemented new time system based on Time and Time::Duration,
with Asio integration using boost::asio::time_traits<openvpn::Time>.

Started reliable receive class (ReliableRecv).
2011-11-01 13:00:49 +00:00