Skip to content

Commit 5d418d6

Browse files
committed
Allow to enable DES3 support without the DES3 ciphers
DES3 support is required to use PBES2-3DES-CBC-encoded keys but also enabling the DES3 ciphers may be undesirable. When using Privoxy it results in a "Bad" rating at sites like https://www.howsmyssl.com/ due to the Sweet32 attack.
1 parent 0c40fb5 commit 5d418d6

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

configure.ac

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4791,6 +4791,13 @@ then
47914791
ENABLED_DES3="yes"
47924792
fi
47934793

4794+
# DES3 ciphers
4795+
AC_ARG_ENABLE([des3-ciphers],
4796+
[AS_HELP_STRING([--enable-des3-ciphers],[Enable DES3 ciphers (default: disabled unless des3 is enabled)])],
4797+
[ ENABLED_DES3_CIPHERS=$enableval ],
4798+
[ ENABLED_DES3_CIPHERS=no ]
4799+
)
4800+
47944801
# ARC4
47954802
if (test "$ENABLED_OPENSSH" = "yes" && test "x$ENABLED_FIPS" = "xno") || \
47964803
test "$ENABLED_WPAS" = "yes" || test "$ENABLED_KRB" = "yes"
@@ -8690,6 +8697,14 @@ else
86908697
fi
86918698
fi
86928699

8700+
if test "x$ENABLED_DES3_CIPHERS" = "xno"
8701+
then
8702+
AM_CFLAGS="$AM_CFLAGS -DNO_DES3_CIPHERS"
8703+
else
8704+
AS_IF([test "x$ENABLED_DES3" = "xno"],
8705+
[AC_MSG_ERROR([DES3 ciphers require DES3])])
8706+
fi
8707+
86938708
if test "$ENABLED_AESGCM" != "no"
86948709
then
86958710
if test "$ENABLED_AESGCM" = "word"
@@ -9488,6 +9503,7 @@ echo " * AES-EAX: $ENABLED_AESEAX"
94889503
echo " * AES Bitspliced: $ENABLED_AESBS"
94899504
echo " * ARIA: $ENABLED_ARIA"
94909505
echo " * DES3: $ENABLED_DES3"
9506+
echo " * DES3_CIPHERS: $ENABLED_DES3_CIPHERS"
94919507
echo " * Camellia: $ENABLED_CAMELLIA"
94929508
echo " * SM4-ECB: $ENABLED_SM4_ECB"
94939509
echo " * SM4-CBC: $ENABLED_SM4_CBC"

wolfssl/internal.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@
343343
#endif
344344
#endif
345345

346-
#if !defined(NO_RSA) && !defined(NO_DES3)
346+
#if !defined(NO_RSA) && !defined(NO_DES3) && !defined(NO_DES3_CIPHERS)
347347
#if !defined(NO_SHA)
348348
#if defined(WOLFSSL_STATIC_RSA)
349349
#define BUILD_SSL_RSA_WITH_3DES_EDE_CBC_SHA
@@ -500,7 +500,7 @@
500500
#if defined(WOLFSSL_AES_256) && defined(HAVE_AES_CBC)
501501
#define BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
502502
#endif
503-
#if !defined(NO_DES3)
503+
#if !defined(NO_DES3) && !defined(NO_DES3_CIPHERS)
504504
#define BUILD_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
505505
#endif
506506
#endif
@@ -686,7 +686,8 @@
686686
#endif
687687
#endif
688688
#if !defined(NO_DES3) && !(defined(WSSL_HARDEN_TLS) && \
689-
WSSL_HARDEN_TLS > 112)
689+
WSSL_HARDEN_TLS > 112) && \
690+
!defined(NO_DES3_CIPHERS)
690691
/* 3DES offers only 112 bits of security.
691692
* Using guidance from section 5.6.1
692693
* https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-57pt1r5.pdf */

0 commit comments

Comments
 (0)