Remove some gcc extra warnings (signed/unsigned problems etc).
[platform/upstream/cryptsetup.git] / configure.in
index 2050efb..ed84b2f 100644 (file)
@@ -1,9 +1,11 @@
 AC_PREREQ([2.67])
-AC_INIT([cryptsetup],[1.4.1])
+AC_INIT([cryptsetup],[1.6.0-git])
 
 dnl library version from <major>.<minor>.<release>[-<suffix>]
 LIBCRYPTSETUP_VERSION=$(echo $PACKAGE_VERSION | cut -f1 -d-)
-LIBCRYPTSETUP_VERSION_INFO=4:0:0
+LIBCRYPTSETUP_VERSION_INFO=8:0:4
+dnl library file name for FIPS selfcheck
+LIBCRYPTSETUP_VERSION_FIPS="libcryptsetup.so.4"
 
 AC_CONFIG_SRCDIR(src/cryptsetup.c)
 AC_CONFIG_MACRO_DIR([m4])
@@ -62,10 +64,43 @@ AC_SUBST(POPT_LIBS, $LIBS)
 LIBS=$saved_LIBS
 
 dnl ==========================================================================
+dnl FIPS extensions
+AC_ARG_ENABLE([fips], AS_HELP_STRING([--enable-fips],[enable FIPS mode restrictions]),
+[with_fips=$enableval],
+[with_fips=no])
+
+if test "x$with_fips" = "xyes"; then
+       AC_DEFINE(ENABLE_FIPS, 1, [Enable FIPS mode restrictions])
+       AC_DEFINE_UNQUOTED(LIBCRYPTSETUP_VERSION_FIPS, ["$LIBCRYPTSETUP_VERSION_FIPS"],
+               [library file name for FIPS selfcheck])
+
+       if test "x$enable_static" = "xyes" -o "x$enable_static_cryptsetup" = "xyes" ; then
+               AC_MSG_ERROR([Static build is not compatible with FIPS.])
+       fi
+
+       saved_LIBS=$LIBS
+       AC_CHECK_LIB(fipscheck, FIPSCHECK_verify, ,[AC_MSG_ERROR([You need the fipscheck library.])])
+       AC_SUBST(FIPSCHECK_LIBS, $LIBS)
+       LIBS=$saved_LIBS
+
+fi
+
+AC_DEFUN([NO_FIPS], [
+       if test "x$with_fips" = "xyes"; then
+               AC_MSG_ERROR([This option is not compatible with FIPS.])
+       fi
+])
+
+dnl ==========================================================================
 dnl Crypto backend functions
 
 AC_DEFUN([CONFIGURE_GCRYPT], [
-       AM_PATH_LIBGCRYPT(1.1.42,,[AC_MSG_ERROR([You need the gcrypt library.])])
+       if test "x$with_fips" = "xyes"; then
+               GCRYPT_REQ_VERSION=1.4.5
+       else
+               GCRYPT_REQ_VERSION=1.1.42
+       fi
+       AM_PATH_LIBGCRYPT($GCRYPT_REQ_VERSION,,[AC_MSG_ERROR([You need the gcrypt library.])])
 
        if test x$enable_static_cryptsetup = xyes; then
                saved_LIBS=$LIBS
@@ -80,6 +115,8 @@ AC_DEFUN([CONFIGURE_GCRYPT], [
        CRYPTO_CFLAGS=$LIBGCRYPT_CFLAGS
        CRYPTO_LIBS=$LIBGCRYPT_LIBS
        CRYPTO_STATIC_LIBS=$LIBGCRYPT_STATIC_LIBS
+
+       AC_DEFINE_UNQUOTED(GCRYPT_REQ_VERSION, ["$GCRYPT_REQ_VERSION"], [Requested gcrypt version])
 ])
 
 AC_DEFUN([CONFIGURE_OPENSSL], [
@@ -95,6 +132,7 @@ AC_DEFUN([CONFIGURE_OPENSSL], [
                CRYPTO_STATIC_LIBS=$OPENSSL_LIBS
                PKG_CONFIG=$saved_PKG_CONFIG
        fi
+       NO_FIPS([])
 ])
 
 AC_DEFUN([CONFIGURE_NSS], [
@@ -106,8 +144,15 @@ AC_DEFUN([CONFIGURE_NSS], [
 
        PKG_CHECK_MODULES([NSS], [nss],,
                AC_MSG_ERROR([You need nss library.]))
+
+       saved_CFLAGS=$CFLAGS
+       CFLAGS="$CFLAGS $NSS_CFLAGS"
+       AC_CHECK_DECLS([NSS_GetVersion], [], [], [#include <nss.h>])
+       CFLAGS=$saved_CFLAGS
+
        CRYPTO_CFLAGS=$NSS_CFLAGS
        CRYPTO_LIBS=$NSS_LIBS
+       NO_FIPS([])
 ])
 
 AC_DEFUN([CONFIGURE_KERNEL], [
@@ -116,7 +161,7 @@ AC_DEFUN([CONFIGURE_KERNEL], [
 #      AC_CHECK_DECLS([AF_ALG],,
 #              [AC_MSG_ERROR([You need Linux kernel with userspace crypto interface.])],
 #              [#include <sys/socket.h>])
-
+       NO_FIPS([])
 ])
 
 AC_DEFUN([CONFIGURE_NETTLE], [
@@ -130,6 +175,7 @@ AC_DEFUN([CONFIGURE_NETTLE], [
        LIBS=$saved_LIBS
 
        CRYPTO_STATIC_LIBS=$CRYPTO_LIBS
+       NO_FIPS([])
 ])
 
 dnl ==========================================================================
@@ -144,7 +190,17 @@ if test x$enable_static_cryptsetup = xyes; then
                enable_static=yes
        fi
 fi
-AM_CONDITIONAL(STATIC_CRYPTSETUP, test x$enable_static_cryptsetup = xyes)
+AM_CONDITIONAL(STATIC_TOOLS, test x$enable_static_cryptsetup = xyes)
+
+AC_ARG_ENABLE(veritysetup,
+       AS_HELP_STRING([--disable-veritysetup],
+       [disable veritysetup support]),[], [enable_veritysetup=yes])
+AM_CONDITIONAL(VERITYSETUP, test x$enable_veritysetup = xyes)
+
+AC_ARG_ENABLE([cryptsetup-reencrypt],
+       AS_HELP_STRING([--enable-cryptsetup-reencrypt],
+       [enable cryptsetup-reencrypt tool]))
+AM_CONDITIONAL(REENCRYPT, test x$enable_cryptsetup_reencrypt = xyes)
 
 AC_ARG_ENABLE(selinux,
        AS_HELP_STRING([--disable-selinux],
@@ -166,6 +222,7 @@ LIBS=$saved_LIBS
 
 LIBS="$LIBS $DEVMAPPER_LIBS"
 AC_CHECK_DECLS([dm_task_secure_data], [], [], [#include <libdevmapper.h>])
+AC_CHECK_DECLS([dm_task_retry_remove], [], [], [#include <libdevmapper.h>])
 AC_CHECK_DECLS([DM_UDEV_DISABLE_DISK_RULES_FLAG], [have_cookie=yes], [have_cookie=no], [#include <libdevmapper.h>])
 if test "x$enable_udev" = xyes; then
        if test "x$have_cookie" = xno; then
@@ -236,6 +293,7 @@ AC_SUBST([CRYPTO_STATIC_LIBS])
 
 AC_SUBST([LIBCRYPTSETUP_VERSION])
 AC_SUBST([LIBCRYPTSETUP_VERSION_INFO])
+AC_SUBST([LIBCRYPTSETUP_VERSION_FIPS])
 
 dnl ==========================================================================
 AC_ARG_ENABLE([dev-random], AS_HELP_STRING([--enable-dev-random],
@@ -288,12 +346,18 @@ CS_STR_WITH([luks1-hash],   [hash function for LUKS1 header], [sha1])
 CS_STR_WITH([luks1-cipher], [cipher for LUKS1], [aes])
 CS_STR_WITH([luks1-mode],   [cipher mode for LUKS1], [cbc-essiv:sha256])
 CS_NUM_WITH([luks1-keybits],[key length in bits for LUKS1], [256])
+CS_NUM_WITH([luks1-iter-time],[PBKDF2 iteration time for LUKS1 (in ms)], [1000])
 
 CS_STR_WITH([loopaes-cipher], [cipher for loop-AES mode], [aes])
 CS_NUM_WITH([loopaes-keybits],[key length in bits for loop-AES mode], [256])
 
-CS_NUM_WITH([keyfile-size-maxkb],[maximum keyfile size (in kilobytes)], [8192])
-CS_NUM_WITH([passphrase-size-max],[maximum keyfile size (in kilobytes)], [512])
+CS_NUM_WITH([keyfile-size-maxkb],[maximum keyfile size (in KiB)], [8192])
+CS_NUM_WITH([passphrase-size-max],[maximum keyfile size (in characters)], [512])
+
+CS_STR_WITH([verity-hash],       [hash function for verity mode], [sha256])
+CS_NUM_WITH([verity-data-block], [data block size for verity mode], [4096])
+CS_NUM_WITH([verity-hash-block], [hash block size for verity mode], [4096])
+CS_NUM_WITH([verity-salt-size],  [salt size for verity mode], [32])
 
 dnl ==========================================================================
 
@@ -303,6 +367,8 @@ lib/libcryptsetup.pc
 lib/crypto_backend/Makefile
 lib/luks1/Makefile
 lib/loopaes/Makefile
+lib/verity/Makefile
+lib/tcrypt/Makefile
 src/Makefile
 po/Makefile.in
 man/Makefile