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

30 Commits

Author SHA1 Message Date
Arne Schwabe
3f90304154
Allow controlling usage of non preferred DC ciphers via option
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2021-11-12 20:58:46 +01:00
Arne Schwabe
9fe7a29148
Implement allowing only data channel ciphers that are actually available by the library
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2021-11-12 20:58:37 +01:00
Heiko Hund
f58ad6b739 remove CryptoAlgs::F_NO_CIPHER_DIGEST flag
Checking for AEAD cipher mode is sufficient.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-06-23 17:50:18 +02:00
Heiko Hund
efd7e01289 add dc_cipher/digest functions to CryptoAlgs::Alg
Moving interpretation of the flags into the class in preparation
of submitting only supported data channel ciphers in IV_CIPHERS.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-06-23 17:49:59 +02:00
Heiko Hund
2975585761 add CryptoAlgs::for_each() to interate algs
Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-06-18 15:10:03 +02:00
Heiko Hund
dd104e8392 make it possible to specify dc algorithms
DCO only supports a limited set of ciphers, currently it is
discovered quite late if a unsupported algorithm is configured
(or pushed).

This introduces CryptoAlgs::allow_dc_algs() with which the
supported set of data channel algorithms can be specified.

The DCO code makes use of this, at the time a new_controller()
is created.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-06-18 15:09:35 +02:00
Heiko Hund
84c8b4aca6 convert CryptoAlgs::algs array to std::array
Remove constexpr in preparation for making it possible to modify the
data channel ciphers. Use std::array so the SIZE can be specified.

Remove the unused CryptoAlgs:get_index_ptr() function.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-06-17 20:32:21 +02:00
Heiko Hund
d28b241380 combine the two CryptoAlgs::name functions
Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-06-17 20:16:51 +02:00
Arne Schwabe
285474a6dc Implement TLS Keying Material Export data key derivation
Tested against OpenVPN 2.x server

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-08-27 13:00:11 +02:00
David Sommerseth
3fbe0a2701
Update copyrights
Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-03-18 19:37:32 +01:00
Arne Schwabe
80399075d4 Implement CHACHA20-Poly1305 support for data channel
This also changes the mbed TLS implementation from using the AES GCM
specific API to the generic AEAD API in mbed TLS. As result we can
refactor the commonly used parts of AEAD and normal cipher into a
common class.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-02-18 18:50:27 +01:00
David Sommerseth
29e060ffb3
CryptoAlgs: Don't report any digests for ciphers not using them
The CryptoDCSettings::digest() method returns SHA1 digest when the
cipher is an AEAD cipher.  This is incorrect, as AEAD ciphers does not
use digests for authentication at all; the authentication is an
integral part of the AEAD cipher itself.

To solve this, the CryptoAlgs::AlgFlags has been extended with a new
F_NO_CIPHER_DIGEST flag which is expected to be set on ciphers not
depending on any digests for authentication, like AES-GCM/AEAD
ciphers.  A new method, use_cipher_digest(), will return True if
the cipher depends on a digest for authentication.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-10-24 14:48:22 +02: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
190ece92d4 CryptoAlgs: added mode() method.
Signed-off-by: James Yonan <james@openvpn.net>
2017-12-22 17:59:38 +08:00
James Yonan
76e65cf4c9 CryptoAlgs: added AEAD_NONCE_TAIL_SIZE constant (set to 8
bytes) to represent the size in bytes of AEAD "nonce tail"
normally taken from the HMAC key material.

Signed-off-by: James Yonan <james@openvpn.net>
2017-12-22 17:59:38 +08:00
Antonio Quartulli
56a831f92a [OVPN3-5] crypto/ssl: add support for AES-256-CTR
Add support for AES-256-CTR (used by tls-crypt) in the crypto
layer and make sure that each SSL library plugin is aware of it.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2017-09-27 16:16:18 +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
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
5d1bc1c952 Moved array_size() function to its own header file. 2015-05-17 12:57:23 -06:00
James Yonan
c2c7292a70 Updated copyright to 2015. 2015-01-06 12:56:21 -07:00
James Yonan
7e1d159cee Major protocol upgrades:
* peer_id/DATA_V2/op32
  client -> server:
    IV_PROTO=2
  server -> client :
    push "peer-id 1234"
    push "peer-id -1"

* AEAD/GCM support
  client -> server:
    IV_NCP=2
  server -> client:
    push "cipher AES-256-GCM"

* Compression V2
  client -> server:
    IV_LZ4v2=1
    IV_COMP_STUBv2=1
  server -> client:
    push "compress stub-v2"
    push "compress lz4-v2"

* TCP non-linear packet ID
  client -> server:
    IV_TCPNL=1
  server -> client:
    [always enabled]
2014-12-21 10:32:37 -07:00
James Yonan
eb25f37d11 Route:
* Make class Route standalone, moving it out of namespace
  CIDRMap.

CryptoAlgs:

* Added comments

* For type-safety, mode() now returns a Mode rather than an
  int.

CryptoDC:

* Added CRYPTO_DEFINED flag to indicate when encrypt() and
  decrypt() methods are implemented by a data channel
  provider.

Manage:

* Implemented skeleton management API for server-side client
  authentication and managing client-instance properties.

Proto:

* Added Config::update_dc_factory() method.

* Support new CryptoDCInstance::CRYPTO_DEFINED flag.

* Updated server_auth() method to support SafeString transit
  of client-provided auth-user-pass password to management
  layer.

* control_send now does a reset() on the provided
  Ptr reference before returning to reflect the
  transfer-of-ownership of the underlying buffer.

* Implemented disable_keepalive() and override_dc_factory
  methods.

Transbase (server) new methods:

  // disable keepalive for rest of session
  virtual void disable_keepalive() = 0;

  // override the data channel factory
  virtual void override_dc_factory(const CryptoDCFactory::Ptr& dc_factory) = 0;

  // override the tun provider
  virtual TunClientInstanceRecv* override_tun(TunClientInstanceSend* tun) = 0;

ServProto:

* Added abstract base classes for Tun factories and client instance
  sender/receivers.

* Added Tun and Management linkages.

* Added new receiver methods for overriding the data channel
  factory, Tun factory, and keepalive config.

* Added AuthCreds support.
2014-10-30 10:41:53 -06:00
James Yonan
a36b95a165 Standardize on size_t for crypto attributes. 2014-10-23 19:20:59 -06:00
James Yonan
99fa118ad3 Removed CRYPTO_API::Cipher and CRYPTO_API::Digest from all crypto
implementations, replacing with general-purpose CryptoAlgs::Type.
2014-10-23 19:19:08 -06:00
James Yonan
287bfd71e9 Extend CryptoAlgs::Alg to contain all info about ciphers/digests
that we need, so we don't need to rely on crypto library for this.
2014-10-23 14:08:30 -06:00
James Yonan
1465964f21 Minor refactor of CryptoDC virtual methods to achieve
a better fit between users and providers.
2014-10-23 09:17:10 -06:00
James Yonan
bd04ed3755 Added CryptoAlgs for managing crypto algorithms independently of
underlying crypto implementation.

Modified proto.hpp to use the new CryptoAlgs types for
cipher/digest selection.

Added initial PolarSSL implementation for cipher/digest
selection using CryptoAlgs types.

Note: this implementation is incomplete, see fixmes.
2014-10-18 10:50:51 -06:00