1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Make use of gcry_kdf_derive.

Factoring common code out is always a Good Thing.  Also added a
configure test to print an error if gcry_kdf_derive is missing in
Libgcrypt.
This commit is contained in:
Werner Koch 2011-03-10 18:39:34 +01:00
parent 35c731d889
commit b9bcc77d6c
5 changed files with 59 additions and 140 deletions

View file

@ -742,6 +742,22 @@ AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION",
have_libgcrypt=yes,have_libgcrypt=no)
# FIxme: Remove this test after libgcrypt 1.5.0 has been released.
AC_CACHE_CHECK([whether Libgcrypt has gcry_kdf_derive],
gnupg_cv_gcry_kdf_derive,
[ _gnupg_gcry_save_cflags=$CFLAGS
_gnupg_gcry_save_libs=$LIBS
CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
LIBS="$LIBS $LIBGCRYPT_LIBS"
AC_TRY_LINK(
[#include <gcrypt.h>],
[ return gcry_kdf_derive (NULL,0,0,0,NULL,0,0,0,NULL); ],
gnupg_cv_gcry_kdf_derive=yes,
gnupg_cv_gcry_kdf_derive=no)
LIBS=$_gnupg_gcry_save_libs
CFLAGS=$_gnupg_gcry_save_cflags])
#
# libassuan is used for IPC
#
@ -1605,6 +1621,15 @@ if test "$have_libgcrypt" = "no"; then
*** ftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/
*** (at least version $NEED_LIBGCRYPT_VERSION using API $NEED_LIBGCRYPT_API is required.)
***]])
elif test "$gnupg_cv_gcry_kdf_derive" = no; then
die=yes
AC_MSG_NOTICE([[
***
*** Libgcrypt 1.5.0 has not yet been released and thus the API
*** is a bit in a flux. Your version misses the function
*** gcry_kdf_derive
*** You need to install a newer Libgcrypt version.
***]])
fi
if test "$have_libassuan" = "no"; then
die=yes