fi
if test x$kdf = xfalse; then
+ openssl_hkdf=false
+ if test x$openssl = xtrue; then
+ AC_MSG_CHECKING(for OpenSSL >= 3.0 for HKDF)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <openssl/opensslv.h>]],
+ [[#if OPENSSL_VERSION_NUMBER < 0x30000000L && !defined(OPENSSL_IS_AWSLC)
+ #error OpenSSL version unusable
+ #endif]])],
+ [AC_MSG_RESULT([yes]); openssl_hkdf=true],
+ [AC_MSG_RESULT([no])]
+ )
+ fi
if test x$aesni = xtrue -o x$cmac = xtrue -o x$xcbc = xtrue; then
AC_MSG_WARN(m4_normalize([
kdf plugin is required for possible use of PRF_AES128_XCBC/CMAC
by one of these plugins: aesni, cmac, xcbc]))
kdf=true
- elif test x$botan = xfalse -a x$openssl = xfalse -a x$wolfssl = xfalse; then
+ elif test x$botan = xfalse -a x$openssl_hkdf = xfalse -a x$wolfssl = xfalse; then
AC_MSG_WARN(m4_normalize([
kdf plugin is required because none of the following plugins is
- enabled: botan, openssl, wolfssl]))
+ enabled or usable: botan, openssl, wolfssl]))
kdf=true
fi
fi
use_custom_openssl $1
elif system_uses_openssl3; then
prepare_system_openssl $1
+ else
+ # the kdf plugin is necessary to build against older OpenSSL versions
+ TESTS_PLUGINS="$TESTS_PLUGINS kdf"
fi
;;
gcrypt)
TARGET=
else
CONFIG="$CONFIG --enable-openssl"
- case "$IMG" in
- 2015|2017)
- # old OpenSSL versions don't provide HKDF
- CONFIG="$CONFIG --enable-kdf"
- ;;
- esac
-
CFLAGS="$CFLAGS -I$OPENSSL_DIR/include"
LDFLAGS="-L$OPENSSL_DIR/lib"
case "$IMG" in
PLUGIN_PROVIDE(SIGNER, AUTH_HMAC_SHA2_512_256),
PLUGIN_PROVIDE(SIGNER, AUTH_HMAC_SHA2_512_512),
#endif
-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
- /* HKDF is available since 1.1.0, expand-only mode only since 1.1.1 */
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L || \
+ defined (OPENSSL_IS_AWSLC)
+ /* HKDF is available since 1.1.0, expand-only mode only since 1.1.1,
+ * but 3.0.0 is required to support larger MODP groups and nonces
+ * with its 2048 byte buffer size */
PLUGIN_REGISTER(KDF, openssl_kdf_create),
PLUGIN_PROVIDE(KDF, KDF_PRF),
PLUGIN_PROVIDE(KDF, KDF_PRF_PLUS),