]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
configure: Detect openssl sm3 support
authorMichal Suchanek <msuchanek@suse.de>
Tue, 18 Jul 2023 12:01:52 +0000 (14:01 +0200)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 17 Oct 2023 17:27:59 +0000 (12:27 -0500)
Older openssl versions do not support sm3. The code has an option to
disable the sm3 hash but the lack of openssl support is not detected
automatically.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Link: https://lore.kernel.org/r/b97e20faa07e9e31c6eaf96683011aa24e80760c.1689681454.git.msuchanek@suse.de
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
configure.ac

index 82a853289a83f017278283e949cf645728c9ecae..e5bceeaa1722d6c42c008a2cef67d0eaa8e48530 100644 (file)
@@ -123,6 +123,13 @@ AC_ARG_WITH([openssl],
 AS_IF([test "x$with_openssl" != "xno"], [
        PKG_CHECK_MODULES([libcrypto], [libcrypto >= 1.1.0], [LIBS="$LIBS $libcrypto_LIBS"])
        AC_DEFINE([ENABLE_OPENSSL], [1], [Enable openssl for modinfo.])
+       AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <openssl/ssl.h>
+               int nid = NID_sm3;]])], [
+               AC_MSG_NOTICE([openssl supports sm3])
+       ], [
+               AC_MSG_NOTICE([openssl sm3 support not detected])
+               CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SM3"
+       ])
 ], [
        AC_MSG_NOTICE([openssl support not requested])
 ])