move krb4 test before test for openssl, and bail out if krb4 is
requested, but the crypto library is not the same as krb4 git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11429 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
93
cf/crypto.m4
93
cf/crypto.m4
@@ -14,49 +14,6 @@ DIR_des=
|
|||||||
AC_MSG_CHECKING([for crypto library])
|
AC_MSG_CHECKING([for crypto library])
|
||||||
|
|
||||||
openssl=no
|
openssl=no
|
||||||
if test "$crypto_lib" = "unknown" -a "$with_openssl" != "no"; then
|
|
||||||
|
|
||||||
save_CPPFLAGS="$CPPFLAGS"
|
|
||||||
save_LIBS="$LIBS"
|
|
||||||
INCLUDE_des=
|
|
||||||
LIB_des=
|
|
||||||
if test "$with_openssl_include" != ""; then
|
|
||||||
INCLUDE_des="-I${with_openssl}/include"
|
|
||||||
fi
|
|
||||||
if test "$with_openssl_lib" != ""; then
|
|
||||||
LIB_des="-L${with_openssl}/lib"
|
|
||||||
fi
|
|
||||||
CPPFLAGS="${INCLUDE_des} ${CPPFLAGS}"
|
|
||||||
LIB_des="${LIB_des} -lcrypto"
|
|
||||||
LIB_des_a="$LIB_des"
|
|
||||||
LIB_des_so="$LIB_des"
|
|
||||||
LIB_des_appl="$LIB_des"
|
|
||||||
LIBS="${LIBS} ${LIB_des}"
|
|
||||||
AC_TRY_LINK([
|
|
||||||
#include <openssl/md4.h>
|
|
||||||
#include <openssl/md5.h>
|
|
||||||
#include <openssl/sha.h>
|
|
||||||
#include <openssl/des.h>
|
|
||||||
#include <openssl/rc4.h>
|
|
||||||
],
|
|
||||||
[
|
|
||||||
void *schedule = 0;
|
|
||||||
MD4_CTX md4;
|
|
||||||
MD5_CTX md5;
|
|
||||||
SHA_CTX sha1;
|
|
||||||
|
|
||||||
MD4_Init(&md4);
|
|
||||||
MD5_Init(&md5);
|
|
||||||
SHA1_Init(&sha1);
|
|
||||||
|
|
||||||
des_cbc_encrypt(0, 0, 0, schedule, 0, 0);
|
|
||||||
RC4(0, 0, 0, 0);
|
|
||||||
], [
|
|
||||||
crypto_lib=libcrypto openssl=yes
|
|
||||||
AC_MSG_RESULT([libcrypto])])
|
|
||||||
CPPFLAGS="$save_CPPFLAGS"
|
|
||||||
LIBS="$save_LIBS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$crypto_lib" = "unknown" -a "$with_krb4" != "no"; then
|
if test "$crypto_lib" = "unknown" -a "$with_krb4" != "no"; then
|
||||||
save_CPPFLAGS="$CPPFLAGS"
|
save_CPPFLAGS="$CPPFLAGS"
|
||||||
@@ -172,6 +129,50 @@ if test "$crypto_lib" = "unknown" -a "$with_krb4" != "no"; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$crypto_lib" = "unknown" -a "$with_openssl" != "no"; then
|
||||||
|
|
||||||
|
save_CPPFLAGS="$CPPFLAGS"
|
||||||
|
save_LIBS="$LIBS"
|
||||||
|
INCLUDE_des=
|
||||||
|
LIB_des=
|
||||||
|
if test "$with_openssl_include" != ""; then
|
||||||
|
INCLUDE_des="-I${with_openssl}/include"
|
||||||
|
fi
|
||||||
|
if test "$with_openssl_lib" != ""; then
|
||||||
|
LIB_des="-L${with_openssl}/lib"
|
||||||
|
fi
|
||||||
|
CPPFLAGS="${INCLUDE_des} ${CPPFLAGS}"
|
||||||
|
LIB_des="${LIB_des} -lcrypto"
|
||||||
|
LIB_des_a="$LIB_des"
|
||||||
|
LIB_des_so="$LIB_des"
|
||||||
|
LIB_des_appl="$LIB_des"
|
||||||
|
LIBS="${LIBS} ${LIB_des}"
|
||||||
|
AC_TRY_LINK([
|
||||||
|
#include <openssl/md4.h>
|
||||||
|
#include <openssl/md5.h>
|
||||||
|
#include <openssl/sha.h>
|
||||||
|
#include <openssl/des.h>
|
||||||
|
#include <openssl/rc4.h>
|
||||||
|
],
|
||||||
|
[
|
||||||
|
void *schedule = 0;
|
||||||
|
MD4_CTX md4;
|
||||||
|
MD5_CTX md5;
|
||||||
|
SHA_CTX sha1;
|
||||||
|
|
||||||
|
MD4_Init(&md4);
|
||||||
|
MD5_Init(&md5);
|
||||||
|
SHA1_Init(&sha1);
|
||||||
|
|
||||||
|
des_cbc_encrypt(0, 0, 0, schedule, 0, 0);
|
||||||
|
RC4(0, 0, 0, 0);
|
||||||
|
], [
|
||||||
|
crypto_lib=libcrypto openssl=yes
|
||||||
|
AC_MSG_RESULT([libcrypto])])
|
||||||
|
CPPFLAGS="$save_CPPFLAGS"
|
||||||
|
LIBS="$save_LIBS"
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$crypto_lib" = "unknown"; then
|
if test "$crypto_lib" = "unknown"; then
|
||||||
|
|
||||||
DIR_des='des'
|
DIR_des='des'
|
||||||
@@ -184,6 +185,12 @@ if test "$crypto_lib" = "unknown"; then
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$with_krb4" != no -a "$crypto_lib" != krb4; then
|
||||||
|
AC_MSG_ERROR([the crypto library used by krb4 lacks features
|
||||||
|
required by Kerberos 5; to continue, you need to install a newer
|
||||||
|
Kerberos 4 or configure --without-krb4])
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$openssl" = "yes"; then
|
if test "$openssl" = "yes"; then
|
||||||
AC_DEFINE([HAVE_OPENSSL], 1, [define to use openssl's libcrypto])
|
AC_DEFINE([HAVE_OPENSSL], 1, [define to use openssl's libcrypto])
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user