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

166 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
Arne Schwabe
16b2c4afe0 Remove UDP/TCP mode from PacketIDReceiveType
This mode is only relevant for old OpenVPN 2.3.x clients in CBC mode
ciphers when using kovpn. Remove the mode from PID control and move
logic to kovpn key logic.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-09-11 13:23:31 +00:00
Charlie Vigue
ef8da98bd4 Buffer: Prepare to decouple allocated buffer / RC
Rename BufferAllocated --> BufferAllocatedRc

Buffer: split RC from BufferAllocated
Also make changes as needed where BufferAllocated is used

Buffer: Split allocation flags into own struct
Leaving flags in template causes each alias to have identical flags
by different names, which requires each type to pointlessly use
the nested name.

Make RC: Clean up headers buffer.hpp, make_rc.hpp

Signed-off-by: Charlie Vigue <charlie.vigue@openvpn.com>
2024-09-11 13:23:28 +00:00
Arne Schwabe
ca91f3e91c Implement data v3 features for AEAD tag at the end and 64 bit packet counter
Split the implementation of the packet counter for normal packet ID
that includes the "weird" long format for long 64 bit packet ids used
in tls-auth and tls-crypt and a simplified implementation for AEAD that
only does 32 bit and 64 bit flat counters.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-08-19 12:18:49 +00:00
Arne Schwabe
a384f16b32 Refactor data channel setting to CryptoDCSettingsData class
Instead of passing around a number of individual argument, use a data
holder class to describe all the settings. This will also allow adding
more data channel parameters in the future (tag location, 64 bit IV)
easier.  This has a slight cost of something passing more parameters
than needed.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-08-19 12:18:49 +00:00
Heiko Hund
8c8e96e138 streamline overriding virtual function syntax
In the code base three different syntaxes for overriding virtual member
functions could be found:

  1) virtual ... override
  2) virtual ...
  3) ... override

This converts all of them to the third syntax, as recommended by the ISO
C++ core guidelines in C.128

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2024-08-13 02:01:24 +02:00
James Yonan
e4368fd83e CryptoAlgs: added missing #include <list>
CryptoAlgs uses std::list but did not #include <list>

Signed-off-by: James Yonan <james@openvpn.net>
2024-08-09 10:10:05 +00:00
Leonard Ossa
3646265d15 Refactor nested namespace to C++17 style
Signed-off-by: Leonard Ossa <leonard.ossa@openvpn.com>
2024-07-03 10:20:11 +00:00
Arne Schwabe
2780eb9581 Spell none cipher with lowercase
OpenVPN uses a idiosyncrasy that all ciphers are uppercase but none is
spelt lowercase and excepts this idiosyncrasy also in IV_CIPHERS

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-05-08 16:39:25 +00:00
Frank Lichtenheld
eaf9147fcd
Add various moves as suggested by Coverity
Out of all the suggestions by Coverity I picked
the ones that move non-Ptr objects into variables
or attributes.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2024-01-31 17:02:45 +01:00
Heiko Hund
be3f20dc58 introduce base types for strong and weak RNGs
The need of having to call the assert_crypto() member function to ensure
that a cryptographically strong RNG is used where needed, was reported
as potentially insecure, since calling it manually can easily be missed.

In the commit the two new classes StrongRandomAPI and WeakRandomAPI are
introduced. They are to be used instead of just RandomAPI, unless it
doesn't matter what strength the RNG is.

All the places the assert_crypto() was called were converted to using
StrongRandomAPI instead. Also the RNGs for which assert_crypto() was not
throwing are now inheriting from StrongRandomAPI.

Variable names, which have the StrongRandomAPI type, but were called
prng, are changed to rng instead to follow the source code convention.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2023-11-22 04:49:31 +01:00
Frank Lichtenheld
f00c816a0f
cryptodc: remove stray ';'
This causes only warnings with -Wpedantic, which we don't
intend to use. But doesn't hurt to fix anyway.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-11-08 21:10:22 +01: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
Charlie Vigue
ae663c573a
Using new numeric conversion tools
Using is_safe_conversion in places where it is a better fit than
numeric_cast.

Signed-off-by: Charlie Vigue <charlie.vigue@openvpn.com>
2023-08-23 18:44:29 +02:00
David Sommerseth
43669510ed
Merging in OpenVPN 3 Core Library v3.8.1
Signed-off-by: David Sommerseth <davids@openvpn.net>
2023-08-01 14:42:25 +02:00
Arne Schwabe
2219ccfb8d
Use inline to ensure only one copy of crypto::algs is present
We need to ensure that there is only one copy of these algorithms defined
as we modify them with the method allow_default_dc_algs to set the
F_DC_ALLOW flag on. Having more than one copy means that we have different
copies with different flags which we want to avoid.

The use of inline to a normal variable is a C++17 feature.

From https://en.cppreference.com/w/cpp/language/inline

An inline function or variable (since C++17) with external linkage
(e.g. not declared static) has the following additional properties:

There may be more than one definition of an inline function or variable
(since C++17) in the program as long as each definition appears in a
different translation unit and (for non-static inline functions and
variables (since C++17)) all definitions are identical. For example,
an inline function or an inline variable (since C++17) may be defined
in a header file that is included in multiple source files.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2023-07-18 14:54:00 +02:00
David Sommerseth
8f5afdd3f8 OpenVPN 3 Core library version 3.8
-----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEgDq5E1p1aZrNLFFkhs+UTJZx/fIFAmSb2ywTHGRhdmlkc0Bv
 cGVudnBuLm5ldAAKCRCGz5RMlnH98lKHD/4z+eI5Jlek9f1q+CcPopGwTBZHkN1u
 lTtnUgKtGZ7x42PZr5t5W+vcQspHSMurlYOjCES6d4DjYJ6vW3/a5qm4s7OokW6u
 Ts2iGWGSf09kDXVff7ogfsJs3LTi/GDNq9VTTWH3fGyEaM89w2ss9OpUBjDImpbs
 nCU7B3BgXIBKKsl4sKNfm8kulakEp4YZlMlvuvGujfTWc8ATqP2tsGdV8HN82gXl
 7uw9N7/aaU6VFgpGjqgdkChAHJlcr9koUWPtVr+4Hf934jQYX4d80SI3umzs2JfW
 xEIcWwStTKztFB5l/Vr6hNmR5sMdW5AEvHfc2W/31gng5cK/0VxEElPQMvVxFteC
 7SlkpNH70mUC5FgO9lIuoUGxYV0MV3+lHrYHBcj2/7z4B4C57K7reqToNHMpT1Ns
 7Cdfu50wijtOnwy0VY/PCkPNLC5lfO2tka+ZLuIDq6p7V1uapA49Axqli9QZ+IZ8
 mYIFQrFKkD3E6NTlDKiMBGnWqKR9U/O49hQAN6I7Kx79GqrPTj/3Q8Z7pZ5iulPQ
 aXjWKvfBdWpR3XmkU30EGKN5J98Wh1qPv56gJ3d71ab4FM57eTfp9BdXbuGHxq9P
 YdExIbZM2Wmv5AQMLAMkw4O7FtABSIPONCz7lD8d9PoCRb1trsnDKQ8ZgFfrOIcs
 BeDyC2eZeBeMnw==
 =1Hd0
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEgDq5E1p1aZrNLFFkhs+UTJZx/fIFAmSb3boTHGRhdmlkc0Bv
 cGVudnBuLm5ldAAKCRCGz5RMlnH98hjnD/0XyldUsdoEgrM0PKDe7u/u7RYxQx1n
 gCrhLZQbnE++U1qITRraHfQu0qLLLXwFIDBiagIVuotcxwOWPz1+tTyUICc4KsLS
 zzkuube2aSBRtbwa8C4FfDuKSWosCOTv56ZE/3Ioq6v0Hf7sDqMDCvUxBjNlQLWu
 m604/yxWxAEnu6lHPY5rj3+9U5TSpErXJk/DqW6ewJjh/TFWG5nA1Z2Q/IF0XIR9
 pbqnhL1Dhd7Z350s7bjsl2ejxj7FmrEXaCh3geK8ovfYfurpX5me8i389LcaM/TD
 MvBStvZIJa2inYxU5IUQnGtqGYdtU4IW8VM3aq8pNy2+U9WNnC/3Q1msplOjPPur
 a2WzNnRcFqxxeVgNmYZgdiS3m6FvAaG3bGUN9haFz3Rjz0yaumbhA4VrLmcimghj
 9AarITBznK8h+JqHdEIarZWwOfLj7A7sdsKQwe7ycBs29WbRW6+iSkhNxnI0BcLu
 mgwf00il4czEWIUthlTF7KcREj/WE/rMSDGAcW+TKJZpdffS2FVQeQITG9SLuBJa
 fVD9C1UYfrrkk408YuButJK2aEYICVFkDfmWcRxF2s8zxyPaVhCLyx2jTaIILV5M
 7HzgnHjlc8e5mhwI3/bE09pzrogtXd3n0s2Yf+f1h8y31GgUHKZRIqY2ESIZghML
 9BZmMAnOprRuWw==
 =HH92
 -----END PGP SIGNATURE-----

Release Merge: OpenVPN 3 Core library version 3.8

Signed-off-by: David Sommerseth <davids@openvpn.net>
2023-06-28 09:13:00 +02:00
Arne Schwabe
ccf7972ba2
Use static inline to ensure only one copy of crypto::algs is present
While there should be no problem of having these basically static
definition multiple times, avoiding multiple copies of it is a good
thing.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2023-06-07 17:14:17 +02:00
Arne Schwabe
93e8acc5f3
Fix check for USE_OPENSSL in crypo/definitions.hpp
In all other places we check only if USE_OPENSSL is defined but not
if it is 0/1. Use the same check in definitions.hpp

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2023-06-07 17:14:16 +02:00
Lev Stipakov
48863ace12
digestapi.hpp: pass libctx to digest api
Digest API calculates MD4/MD5 digests etc which
are deprecated. In order to use those one needs to
load OpenSSL legacy provider and EVP_MD_fetch() to
fetch digest implementation from all loaded providers.

EVP_MD_fetch() takes library context as an argument,
so we need to pass it there through the digest api stack.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-06-07 17:09:49 +02:00
Lev Stipakov
2be0dcdad4
digestapi.hpp: remove unused DigestContext
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-06-07 17:09:44 +02:00
David Sommerseth
bc3b549ed6
Merge changes from releaseprep/3.8
Signed-off-by: David Sommerseth <davids@openvpn.net>
2023-03-08 17:24:24 +01:00
Arne Schwabe
171fd2f0af
Fix mbed TLS AEAD encrypt/decrypt with newer mbed TLS 2.x versions
Newer mbed TLS version changed the API. This fixes our usage of the API and
also removed the micro optimisation of reusing the buffer for plain and cipher
text.

It also adds a unit test to ensure the data is correctly encrypted/decrypted.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2023-03-08 17:06:24 +01:00
Charlie Vigue
f38e97e1c3 Eliminate some conversion warnings
- [ipv4.hpp, ipv6.hpp] In both v4 and v6 headers it is safe to cast the hex
so as to eliminate the spurious warnings.

- [lz4.hpp] Apply value clamp to the hint that is sent to the compressor
to prevent a potential conversion overflow.

- [zlib.hpp] In compress_gzip, zs.s.avail_in and zs.s.avail_out are
theoretically susceptable to overflow. To prevent this we use
numeric_cast. In decompress_gzip we do a similar thing for zs.s.avail_in
but only value clamp avail_out, since the read loop looks like it will
compensate

- [buffmt.hpp] It's safe to cast the result of the arithmentically caused
promotion back down to char.

- [base64.hpp] In Base64 CTOR, changed type of a couple variables to
match the type of the table they generate. In decode, perform a static
cast to the type of the template elements the function is
instantiated for.

- [core.hpp] Perform static cast long --> int on value representing
number of cores. If we run on systems where there are more cores than
int can represent this will behave oddly, but this circumstance
seems unlikely at the present time.

- [environ.hpp] The casts seem to be safe but I have added a todo ticket
to evaluate this change further.

- [hexstr.hpp] In render_hex_char there were two conversion warnings
and a bug involving out of range input. Those are addressed.
In dump_hex the result of some math and logic is now clamped
to the range of acceptable input values for string::spaces
In parse_hex the result of converting from a hex string to an
integral value is cast to the template value_type

- [hostport.hpp] The static_cast should be safe because the value
produced by validate_port is range checked.

- [split.hpp] Applied numeric cast to ensure output of lex.get stays
within acceptable type limit.

- [stop.hpp] In Stop::Scope It's extremely unlikely but was possible for
the vector size to exceed the limit of int. The size now has a much lower
limit applied and will throw if it is exceeded.

- [string.hpp] Changed the call to toupper/tolower so they call the
locale function template instead of the cctype C function. This
eliminates the warning and the need for the cast.

- [cliproto.hpp] The computation of mss_fix is stored in a size_t and
then assigned to an unsigned short. We clamp this assignment
to the range of unsigned short.

- [tempfile.hpp] In TempFile CTOR suffixLen is computed as one type
and consumed as another. Since the CTOR is already throwing
for a couple other error conditions, I have added a
numeric_cast to the conversion that also throws in case of a
value overflow.

- [unicode.hpp] In an 8 --> 16 bit string conversion we mask and assign
in a way the compiler can't be certain is safe even though it is safe.
Added static cast to let the compiler know it's safe. In the second case
the class uses unsigned int to store a size, and then uses it in with size_t
which generates conversion warnings. I have changed the type of size
to size_t

- [logperiod.hpp] in log_period changed return type specification to
match the actual return type.

- [usergroup_retain_cap.hpp] In the unlikely event the caps size (size_t)
exceeds the range cap_set_flag can accept, an exception will be thrown.

- [crypto_aead.hpp] StaticKey::size provides a size_t where unsigned int
is required. We use numeric_cast to check the size() value in the
extremely unlikely event it is manipulated to exceed the allowed value.

- [packet_id.hpp] Code packs a time_t into a uint32_t for replay packet
ID protection purposes. The warning is supressed by a mask and cast
since the 32 bit limit is baked into the protocol and the overflow itself
does not cause a severe breakage.

- [headredact.hpp] Altered code such that the type that stores the find
result is compatible with the result from find. Additionally used the
npos constant instead of -1. There is a commented out code block that
claims to be dropped due to requiring C++ '14 - consider just using
that.

- [csum.hpp] in csum fold and cfold one has a mask and cast, the
second is just a cast to undo a promotion. Both appear safe.

- [ipv4.hpp] Values are masked and shifted so the cast should be safe.
Added cast.

- [ping4.hpp] ICMP ID and sequence number function arguments are
changed to the same type as needed by the structure. For
IPv4 header version_len 2nd arg is int but sizeof is not, so we
cast it. IPv4 tot_len is a uint16_t so we clamp to that value
range and compute it once.

- [ping6.hpp] Enforces a value constraint on the len argument to
csum_icmp, then checks the result of some math to ensure
the result will fit in the type it has to fit. In generate_echo_request
the ICMP ID and sequence args are changed to match the
type they are assigned to in the struct, and added
numeric_cast to range check payload_len.

 - [remotelist.hpp] In get_endpoint, endpoint.port is called with an
unsigned int where the function is expecting an unsigned short int.
Since parse_number_throw is a function template, we just ask it to
return the correct type now.

- [compress.hpp] In v2_push we accept an int value that is assigned to
an unsigned char we push to the buffer. I changed the function to
accept an unsigned char directly.

Added unit tests - thanks Mark Deric.

Signed-off-by: Charlie Vigue <charlie.vigue@openvpn.net>
2023-03-08 15:21:50 +00:00
Heiko Hund
b91e138106 add OpenVPNStaticKey::XOR() function
Allows to XOR (^) the key with the contents of another one.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2023-02-01 23:05:05 +01: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
2ff291e767 Implement client side early negotion and tls-crypt cookie support 2022-11-16 17:22:18 +01:00
Arne Schwabe
6bc1a7c6a0 Add CONTROL_WKC_V1 definitions and improve packetdump of tls-crypt-v2 2022-11-16 17:22:09 +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
Lev Stipakov
1d4334c701 dco-win: support for ChaCha20-Poly1305
Probe cipher support in runtime (works in Windows Server 2022 and Windows 11)
and add it to the list of allowed ciphers.

White on it, add missing halt check in dco-win client code.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-05-04 18:15:07 +03:00
Arne Schwabe
d0a9b61b4b
Do not allow SWEET32 vulnerable algorithms and MD4 without enableLegacyAlgorithm
With OpenSSL3, these algorithms are no longer allowed. With this change
we do the same regardless of the crypto library. Note that in contrast
to OpenSSL3, we include here 3DES into the legacy algorithms.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-01-12 18:30:04 +01:00
Arne Schwabe
291e675748
Move SSL context from OpenSSL Context to OpenSSL Config
We already load the certificates from the config and need the SSL
library context initialised there to allow loading of keys encrypted
with legacy algorithm. Also ensure that enable legacy provider is
set before actually attempting to load the private keys.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-01-12 18:29:50 +01:00
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
Arne Schwabe
708be87c72
[OSSL 3.0] Implement using a library context for OpenSSL 3.0
This allows use to load non default providers while also not touching
the default library context. THis is necessary to have profile with and
without legacy library for example

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2021-11-12 20:58:30 +01:00
Heiko Hund
0f11551143 remove CryptoOvpnHMACContext legal_dc_digest call
The class CryptoOvpnHMACContext is used for handling the --tls-auth
option. Since tls-auth is a control channel feature, checking for
a valid data channel digest is wrong.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-07-03 13:16:48 -06: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
Heiko Hund
f3133090a6 remove unnecessary const from return type qualifier
Adding const here serves no purpose, since the return type is
a rvalue and cannot be modified anyways.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-05-18 06:13:31 +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
a1250b9bed Announce Chacha20-poly1305 in IV_CIPHER if supported
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-02-18 18:50:27 +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
Arne Schwabe
424d9b34af Rename GCM classes and files to AEAD
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