X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=configure.in;h=8902de42c56ea936cefdfc731a21998186336685;hb=0ec4d4c9cf2bb3eb1055ee9fc2817654cb99d16c;hp=8fa8df2a1928a0fb0204915f35ad538c0820c1a3;hpb=a1306ed01c3ce7a2ce956ef3448562275fc3c66d;p=platform%2Fupstream%2Fcryptsetup.git diff --git a/configure.in b/configure.in index 8fa8df2..8902de4 100644 --- a/configure.in +++ b/configure.in @@ -1,9 +1,9 @@ AC_PREREQ([2.67]) -AC_INIT([cryptsetup],[1.4.0-cvs]) +AC_INIT([cryptsetup],[1.5.0-rc2]) dnl library version from ..[-] LIBCRYPTSETUP_VERSION=$(echo $PACKAGE_VERSION | cut -f1 -d-) -LIBCRYPTSETUP_VERSION_INFO=4:0:0 +LIBCRYPTSETUP_VERSION_INFO=7:0:3 AC_CONFIG_SRCDIR(src/cryptsetup.c) AC_CONFIG_MACRO_DIR([m4]) @@ -31,11 +31,11 @@ AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h malloc.h inttypes.h sys/ioctl.h sys/mman.h \ ctype.h unistd.h locale.h) -AC_CHECK_HEADERS(uuid/uuid.h,,[AC_MSG_ERROR('You need the uuid library')]) -AC_CHECK_HEADER(libdevmapper.h,,[AC_MSG_ERROR('You need the device-mapper library')]) +AC_CHECK_HEADERS(uuid/uuid.h,,[AC_MSG_ERROR([You need the uuid library.])]) +AC_CHECK_HEADER(libdevmapper.h,,[AC_MSG_ERROR([You need the device-mapper library.])]) saved_LIBS=$LIBS -AC_CHECK_LIB(uuid, uuid_clear, ,[AC_MSG_ERROR('You need the uuid library')]) +AC_CHECK_LIB(uuid, uuid_clear, ,[AC_MSG_ERROR([You need the uuid library.])]) AC_SUBST(UUID_LIBS, $LIBS) LIBS=$saved_LIBS @@ -62,10 +62,41 @@ 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]) + + 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,11 +111,13 @@ 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], [ PKG_CHECK_MODULES([OPENSSL], [openssl >= 0.9.8],, - AC_MSG_ERROR('You need openssl library')) + AC_MSG_ERROR([You need openssl library.])) CRYPTO_CFLAGS=$OPENSSL_CFLAGS CRYPTO_LIBS=$OPENSSL_LIBS @@ -95,43 +128,50 @@ AC_DEFUN([CONFIGURE_OPENSSL], [ CRYPTO_STATIC_LIBS=$OPENSSL_LIBS PKG_CONFIG=$saved_PKG_CONFIG fi + NO_FIPS([]) ]) AC_DEFUN([CONFIGURE_NSS], [ if test x$enable_static_cryptsetup = xyes; then - AC_MSG_ERROR([Static build of cryptsetup is not supported with NSS.]), + AC_MSG_ERROR([Static build of cryptsetup is not supported with NSS.]) fi AC_MSG_WARN([NSS backend does NOT provide backward compatibility (missing ripemd160 hash).]) PKG_CHECK_MODULES([NSS], [nss],, - AC_MSG_ERROR('You need nss library')) + AC_MSG_ERROR([You need nss library.])) + + saved_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $NSS_CFLAGS" + AC_CHECK_DECLS([NSS_GetVersion], [], [], [#include ]) + CFLAGS=$saved_CFLAGS + CRYPTO_CFLAGS=$NSS_CFLAGS CRYPTO_LIBS=$NSS_LIBS + NO_FIPS([]) ]) AC_DEFUN([CONFIGURE_KERNEL], [ AC_CHECK_HEADERS(linux/if_alg.h,, - [AC_MSG_ERROR('You need Linux kernel with userspace crypto interface.')]) + [AC_MSG_ERROR([You need Linux kernel with userspace crypto interface.])]) # AC_CHECK_DECLS([AF_ALG],, -# [AC_MSG_ERROR('You need Linux kernel with userspace crypto interface.')], +# [AC_MSG_ERROR([You need Linux kernel with userspace crypto interface.])], # [#include ]) - + NO_FIPS([]) ]) AC_DEFUN([CONFIGURE_NETTLE], [ AC_CHECK_HEADERS(nettle/sha.h,, - [AC_MSG_ERROR('You need Nettle cryptographic library.')]) + [AC_MSG_ERROR([You need Nettle cryptographic library.])]) saved_LIBS=$LIBS - AC_CHECK_LIB(nettle, nettle_sha512_init,, - [AC_MSG_ERROR('You need Nettle library version 2.1 or more recent.')]) + AC_CHECK_LIB(nettle, nettle_ripemd160_init,, + [AC_MSG_ERROR([You need Nettle library version 2.4 or more recent.])]) CRYPTO_LIBS=$LIBS LIBS=$saved_LIBS - AC_MSG_WARN([Nettle backend does NOT provide backward compatibility (missing ripemd160 hash).]) - CRYPTO_STATIC_LIBS=$CRYPTO_LIBS + NO_FIPS([]) ]) dnl ========================================================================== @@ -146,7 +186,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], @@ -168,6 +218,7 @@ LIBS=$saved_LIBS LIBS="$LIBS $DEVMAPPER_LIBS" AC_CHECK_DECLS([dm_task_secure_data], [], [], [#include ]) +AC_CHECK_DECLS([dm_task_retry_remove], [], [], [#include ]) AC_CHECK_DECLS([DM_UDEV_DISABLE_DISK_RULES_FLAG], [have_cookie=yes], [have_cookie=no], [#include ]) if test "x$enable_udev" = xyes; then if test "x$have_cookie" = xno; then @@ -220,6 +271,11 @@ if test x$enable_static_cryptsetup = xyes; then AC_CHECK_LIB(devmapper, dm_task_set_uuid,, AC_MSG_ERROR([Cannot link with static device-mapper library.])) + dnl Try to detect uuid static library. + LIBS="$saved_LIBS -static" + AC_CHECK_LIB(uuid, uuid_generate,, + AC_MSG_ERROR([Cannot find static uuid library.])) + LIBS=$saved_LIBS PKG_CONFIG=$saved_PKG_CONFIG fi @@ -257,6 +313,25 @@ AC_DEFUN([CS_NUM_WITH], [AC_ARG_WITH([$1], [CS_DEFINE([$1], [$3], [$2])] )]) +dnl ========================================================================== +dnl Python bindings +AC_ARG_ENABLE([python], AS_HELP_STRING([--enable-python],[enable Python bindings]), +[with_python=$enableval], +[with_python=no]) + +if test "x$with_python" = "xyes"; then + AM_PATH_PYTHON([2.4]) + + if ! test -x "$PYTHON-config" ; then + AC_MSG_ERROR([Cannot find python development packages to build bindings]) + fi + + PYTHON_INCLUDES=$($PYTHON-config --includes) + AC_SUBST(PYTHON_INCLUDES) +fi +AM_CONDITIONAL([PYTHON_CRYPTSETUP], [test "x$with_python" = "xyes"]) + +dnl ========================================================================== CS_STR_WITH([plain-hash], [password hashing function for plain mode], [ripemd160]) CS_STR_WITH([plain-cipher], [cipher for plain mode], [aes]) CS_STR_WITH([plain-mode], [cipher mode for plain mode], [cbc-essiv:sha256]) @@ -273,6 +348,11 @@ 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_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 ========================================================================== AC_CONFIG_FILES([ Makefile @@ -281,9 +361,11 @@ lib/libcryptsetup.pc lib/crypto_backend/Makefile lib/luks1/Makefile lib/loopaes/Makefile +lib/verity/Makefile src/Makefile po/Makefile.in man/Makefile tests/Makefile +python/Makefile ]) AC_OUTPUT