Skip to content

Commit 56e7afc

Browse files
committed
Gate mlkem.h include behind autoconf check
- Move AC_CHECK_HEADERS/AC_CHECK_LIB in configure.ac after wolfSSL path resolution - Probe for wolfssl/wolfcrypt/mlkem.h in the header check list - Guard mlkem.h include in src/internal.c with HAVE_WOLFSSL_WOLFCRYPT_MLKEM_H
1 parent 444aa0f commit 56e7afc

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

configure.ac

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ AC_TYPE_SIZE_T
5555
AC_TYPE_UINT8_T
5656
AC_TYPE_UINTPTR_T
5757

58-
# Check headers/libs
59-
AC_CHECK_HEADERS([limits.h sys/select.h sys/time.h sys/ioctl.h pty.h util.h termios.h])
60-
AC_CHECK_LIB([network],[socket])
61-
AC_CHECK_LIB([util],[forkpty])
62-
6358
#wolfssl
6459
AC_MSG_CHECKING([for wolfSSL])
6560
if test "x$prefix" = "xNONE"
@@ -86,6 +81,10 @@ AC_ARG_WITH(wolfssl,
8681
]
8782
)
8883

84+
# Check headers/libs
85+
AC_CHECK_HEADERS([limits.h sys/select.h sys/time.h sys/ioctl.h pty.h util.h termios.h wolfssl/wolfcrypt/mlkem.h])
86+
AC_CHECK_LIB([network],[socket])
87+
AC_CHECK_LIB([util],[forkpty])
8988
AC_CHECK_LIB([wolfssl],[wolfCrypt_Init],,[AC_MSG_ERROR([libwolfssl is required for ${PACKAGE}. It can be obtained from https://www.wolfssl.com/download.html/ .])])
9089
AC_CHECK_FUNCS([gethostbyname getaddrinfo gettimeofday inet_ntoa memset socket wc_ecc_set_rng])
9190
AC_CHECK_DECLS([[pread],[pwrite]],,[unistd.h])

src/internal.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@
5757
#endif
5858

5959
#ifdef WOLFSSL_HAVE_MLKEM
60-
#include <wolfssl/wolfcrypt/mlkem.h>
61-
#include <wolfssl/wolfcrypt/wc_mlkem.h>
60+
#ifdef HAVE_WOLFSSL_WOLFCRYPT_MLKEM_H
61+
#include <wolfssl/wolfcrypt/mlkem.h>
62+
#endif
63+
#include <wolfssl/wolfcrypt/wc_mlkem.h>
6264
#endif
6365

6466
#ifdef NO_INLINE

0 commit comments

Comments
 (0)