diff --git a/configure.ac b/configure.ac index 431e3003a..8ab5b78fd 100644 --- a/configure.ac +++ b/configure.ac @@ -224,13 +224,42 @@ then fi AC_SUBST([ENABLED_ASM]) - # FIPS 140 AC_ARG_ENABLE([fips], [AS_HELP_STRING([--enable-fips],[Enable FIPS 140-2, Will NOT work w/o FIPS license (default: disabled)])], [ENABLED_FIPS=$enableval], [ENABLED_FIPS="no"]) +# wolfEngine Options +AC_ARG_ENABLE([engine], + [AS_HELP_STRING([--enable-engine],[Enable wolfEngine options (default: disabled)])], + [ ENABLED_WOLFENGINE=$enableval ], + [ ENABLED_WOLFENGINE=no ] + ) + +AS_CASE([$ENABLED_WOLFENGINE], + [no],[ + ENABLED_WOLFENGINE="no" + ], + [disabled],[ + ENABLED_WOLFENGINE="no" + ], + [yes|fips-v2|cert3389],[ + ENABLED_WOLFENGINE="yes" + ENABLED_FIPS="v2" + ], + [fips-ready],[ + ENABLED_WOLFENGINE="yes" + ENABLED_FIPS="ready" + ], + [no-fips],[ + ENABLED_WOLFENGINE="yes" + ENABLED_FIPS="no" + ], + [ + AC_MSG_ERROR([Invalid value for --enable-engine "$ENABLED_WOLFENGINE" (options: fips-v2, fips-ready, no-fips, no, disabled)]) + ]) + # The FIPS options are: # no - FIPS build disabled, FIPS sources forbidden in build tree # disabled - FIPS build disabled, FIPS sources ignored in build tree @@ -1169,7 +1198,8 @@ AC_ARG_ENABLE([opensslcoexist], [ ENABLED_OPENSSLCOEXIST=$enableval ], [ ENABLED_OPENSSLCOEXIST=no ] ) -if test "x$ENABLED_OPENSSLCOEXIST" = "xyes" + +if test "x$ENABLED_OPENSSLCOEXIST" = "xyes" || test "$ENABLED_WOLFENGINE" = "yes" then # make sure old names are disabled enable_oldnames=no @@ -1721,7 +1751,7 @@ AC_ARG_ENABLE([aesccm], [ ENABLED_AESCCM=no ] ) -if test "$ENABLED_AESCCM" = "yes" +if test "$ENABLED_AESCCM" = "yes" || test "$ENABLED_WOLFENGINE" = "yes" then AM_CFLAGS="$AM_CFLAGS -DHAVE_AESCCM" fi @@ -1744,7 +1774,7 @@ AC_ARG_ENABLE([aesctr], [ ENABLED_AESCTR=$enableval ], [ ENABLED_AESCTR=no ] ) -if test "$ENABLED_OPENVPN" = "yes" || test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_AESSIV" = "yes" +if test "$ENABLED_OPENVPN" = "yes" || test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_AESSIV" = "yes" || test "$ENABLED_WOLFENGINE" = "yes" then ENABLED_AESCTR=yes fi @@ -2414,7 +2444,7 @@ AC_ARG_ENABLE([keygen], [ ENABLED_KEYGEN=no ] ) -if test "$ENABLED_BIND" = "yes" || test "$ENABLED_NTP" = "yes" || test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_OPENRESTY" = "yes" || test "$ENABLED_NGINX" = "yes" +if test "$ENABLED_BIND" = "yes" || test "$ENABLED_NTP" = "yes" || test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_OPENRESTY" = "yes" || test "$ENABLED_NGINX" = "yes" || test "$ENABLED_WOLFENGINE" = "yes" then ENABLED_KEYGEN=yes fi @@ -2497,7 +2527,7 @@ AC_ARG_ENABLE([x963kdf], [ ENABLED_X963KDF=$enableval ], [ ENABLED_X963KDF=no ] ) -if test "$ENABLED_X963KDF" = "yes" +if test "$ENABLED_X963KDF" = "yes" || test "$ENABLED_WOLFENGINE" = "yes" then AM_CFLAGS="$AM_CFLAGS -DHAVE_X963_KDF" fi @@ -3475,7 +3505,7 @@ AC_ARG_ENABLE([des3], [ ENABLED_DES3=no ] ) -if test "$ENABLED_OPENSSH" = "yes" || test "$ENABLED_QT" = "yes" || test "$ENABLED_OPENVPN" = "yes" || test "x$ENABLED_WPAS" != "xno" || test "$ENABLED_NETSNMP" = "yes" || test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_KRB" = "yes" +if test "$ENABLED_OPENSSH" = "yes" || test "$ENABLED_QT" = "yes" || test "$ENABLED_OPENVPN" = "yes" || test "x$ENABLED_WPAS" != "xno" || test "$ENABLED_NETSNMP" = "yes" || test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_KRB" = "yes" || test "$ENABLED_WOLFENGINE" = "yes" then ENABLED_DES3="yes" fi @@ -3500,14 +3530,12 @@ AC_ARG_ENABLE([md5], [ ENABLED_MD5=yes ] ) - # SHA AC_ARG_ENABLE([sha], [AS_HELP_STRING([--enable-sha],[Enable SHA (default: enabled)])], [ ENABLED_SHA=$enableval ], [ ENABLED_SHA=yes ] ) - if test "$ENABLED_SHA" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_SHA -DNO_OLD_TLS" @@ -3539,7 +3567,7 @@ AC_ARG_ENABLE([cmac], [ ENABLED_CMAC=no ] ) -if test "$ENABLED_WPAS" != "no" || test "$ENABLED_NTP" = "yes" || test "$ENABLED_AESSIV" = "yes" +if test "$ENABLED_WPAS" != "no" || test "$ENABLED_NTP" = "yes" || test "$ENABLED_AESSIV" = "yes" || test "$ENABLED_WOLFENGINE" = "yes" then ENABLED_CMAC=yes fi @@ -7331,6 +7359,27 @@ then ENABLED_IOTSAFE_HWRNG=yes fi +if test "x$ENABLED_WOLFENGINE" = "xyes" +then + AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_ECB" + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT" + AM_CFLAGS="$AM_CFLAGS -DWC_RSA_NO_PADDING" + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_MP" + AM_CFLAGS="$AM_CFLAGS -DECC_MIN_KEY_SZ=192" +fi + +if test "$ENABLED_WOLFENGINE" = "yes" && test "$ENABLED_FIPS" != "no" +then + AM_CFLAGS="$AM_CFLAGS -DSha3=wc_Sha3" + AM_CFLAGS="$AM_CFLAGS -DNO_OLD_SHA256_NAMES" + AM_CFLAGS="$AM_CFLAGS -DNO_OLD_MD5_NAME" +fi + +if test "$ENABLED_WOLFENGINE" = "yes" && test "$ENABLED_FIPS" = "no" +then + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PSS_LONG_SALT" + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PSS_SALT_LEN_DISCOVER" +fi AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes"], [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MAX_STRENGTH"]) @@ -8062,6 +8111,7 @@ echo " * All TLS Extensions: $ENABLED_TLSX" echo " * PKCS#7: $ENABLED_PKCS7" echo " * S/MIME: $ENABLED_SMIME" echo " * wolfSSH: $ENABLED_WOLFSSH" +echo " * wolfEngine: $ENABLED_WOLFENGINE" echo " * wolfTPM: $ENABLED_WOLFTPM" echo " * wolfCLU: $ENABLED_WOLFCLU" echo " * wolfSCEP: $ENABLED_WOLFSCEP"