]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Do not try to use the encrypt-then-mac ciphers from OpenSSL 3.6.0
authorArne Schwabe <arne@rfc2549.org>
Thu, 23 Oct 2025 11:11:33 +0000 (13:11 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 23 Oct 2025 15:27:06 +0000 (17:27 +0200)
These ciphers claim to be CBC but since they are also include an HMAC
are more a mix of AEAD and CBC. Nevertheless, we do not support these
and also have no (good) reason to support them.

This patch defines the flag if the SSL library does not define the flag
to also work when the SSL library is upgraded after OpenVPN has been compiled.

Change-Id: Iafe3c94b952cd3fbecf6f3d05816e5859f425e7d
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1294
Message-Id: <20251023111138.25245-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg33846.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/crypto_openssl.c
src/openvpn/openssl_compat.h

index 7688addb06a02bb1b90978bd881d84b76a06aa35..f596b8c8a3954e29be0ae848cfbd88d549fcdeb8 100644 (file)
@@ -789,7 +789,8 @@ cipher_kt_mode_cbc(const char *ciphername)
 #ifdef EVP_CIPH_FLAG_CTS
                    && !(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_CTS)
 #endif
-                   && !(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER));
+                   && !(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)
+                   && !(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_ENC_THEN_MAC));
     EVP_CIPHER_free(cipher);
     return ret;
 }
index e3e7cf8e8765e5c8b69baa8391a0761ee0ff9848..fb3c9b15b2d115d6acba8fc026f5a083bf565f3a 100644 (file)
@@ -211,4 +211,9 @@ SSL_get0_group_name(SSL *s)
 #endif
 #endif
 
+/* Introduced in OpenSSL 3.6.0 */
+#ifndef EVP_CIPH_FLAG_ENC_THEN_MAC
+#define EVP_CIPH_FLAG_ENC_THEN_MAC 0x10000000
+#endif
+
 #endif /* OPENSSL_COMPAT_H_ */