From 0532df5ce1955d39ed51b1419e0db3d662d09ac0 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Thu, 8 May 2025 12:20:05 -0500 Subject: [PATCH] configure.ac: further fixes+cleanups for curve25519/ed25519 feature setup. now recognizes =asm as an override optionally preventing implicit noasm (linuxkm), and fixes wrong -DHAVE_CURVE25519 added to flags in FIPS builds. --- configure.ac | 53 +++++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/configure.ac b/configure.ac index 8621e7489..2b647dade 100644 --- a/configure.ac +++ b/configure.ac @@ -4452,25 +4452,6 @@ then ENABLED_CURVE25519="yes" fi -if test "$ENABLED_CURVE25519" != "no" -then - if test "$ENABLED_CURVE25519" = "small" || test "$ENABLED_LOWRESOURCE" = "yes" - then - AM_CFLAGS="$AM_CFLAGS -DCURVE25519_SMALL" - ENABLED_CURVE25519_SMALL=yes - ENABLED_CURVE25519=yes - fi - - if test "$ENABLED_CURVE25519" = "no128bit" || test "$ENABLED_32BIT" = "yes" - then - AM_CFLAGS="$AM_CFLAGS -DNO_CURVED25519_128BIT" - fi - - AM_CFLAGS="$AM_CFLAGS -DHAVE_CURVE25519" - AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_CURVE25519" - ENABLED_FEMATH=yes -fi - # ED25519 AC_ARG_ENABLE([ed25519], @@ -9799,12 +9780,12 @@ then ENABLED_OPENSSLEXTRA="yes" fi -if test "$ENABLED_CURVE25519" != "no" && test "$ENABLED_LINUXKM_DEFAULTS" = "yes" +if test "$ENABLED_CURVE25519" != "no" && test "$ENABLED_CURVE25519" != "asm" && test "$ENABLED_LINUXKM_DEFAULTS" = "yes" then ENABLED_CURVE25519=noasm fi -if test "$ENABLED_ED25519" != "no" && test "$ENABLED_LINUXKM_DEFAULTS" = "yes" +if test "$ENABLED_ED25519" != "no" && test "$ENABLED_ED25519" != "asm" && test "$ENABLED_LINUXKM_DEFAULTS" = "yes" then ENABLED_ED25519=noasm fi @@ -9814,18 +9795,37 @@ then AM_CFLAGS="$AM_CFLAGS -DNO_CURVED25519_X64" fi +if test "$ENABLED_CURVE25519" != "no" +then + if test "$ENABLED_CURVE25519" = "small" || test "$ENABLED_LOWRESOURCE" = "yes" + then + AM_CFLAGS="$AM_CFLAGS -DCURVE25519_SMALL" + ENABLED_CURVE25519_SMALL=yes + fi + + if test "$ENABLED_CURVE25519" = "no128bit" || test "$ENABLED_32BIT" = "yes" + then + AM_CFLAGS="$AM_CFLAGS -DNO_CURVED25519_128BIT" + fi + + AM_CFLAGS="$AM_CFLAGS -DHAVE_CURVE25519" + AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_CURVE25519" + ENABLED_FEMATH=yes +fi + if test "$ENABLED_ED25519" != "no" then if test "$ENABLED_ED25519" = "small" || test "$ENABLED_LOWRESOURCE" = "yes" then + AM_CFLAGS="$AM_CFLAGS -DED25519_SMALL" ENABLED_ED25519_SMALL=yes ENABLED_CURVE25519_SMALL=yes - ENABLED_ED25519=yes fi + AM_CFLAGS="$AM_CFLAGS -DHAVE_ED25519" + AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_ED25519" ENABLED_FEMATH=yes ENABLED_GEMATH=yes - ENABLED_CERTS=yes fi if test "$ENABLED_ED25519" != "no" || test "$ENABLED_ED448" != "no" @@ -9988,13 +9988,6 @@ AS_IF([test "x$ENABLED_CERTGEN" = "xyes"], AS_IF([test "x$ENABLED_CERTEXT" = "xyes"], [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"]) -AS_IF([test "$ENABLED_ED25519" != "no"], - [AM_CFLAGS="$AM_CFLAGS -DHAVE_ED25519" - AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_ED25519"]) - -AS_IF([test "x$ENABLED_ED25519_SMALL" = "xyes"], - [AM_CFLAGS="$AM_CFLAGS -DED25519_SMALL"]) - AS_IF([test "x$ENABLED_OCSP" = "xyes"], [AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"])