Fixed OpenSSL build on newer versions lacking AES_ctr128_encrypt.
git-svn-id: http://voip.null.ro/svn/yate@6290 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
2b1a2a9fea
commit
e769dfec8e
18
configure.ac
18
configure.ac
|
@ -1441,6 +1441,24 @@ elif [[ "x$ac_cv_use_openssl" != "xno" ]]; then
|
|||
fi
|
||||
AC_MSG_RESULT([$verssl])
|
||||
fi
|
||||
if [[ "x$HAVE_OPENSSL" != "xno" ]]; then
|
||||
HAVE_AESCTR=no
|
||||
SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $OPENSSL_INC -Wall -Werror"
|
||||
AC_MSG_CHECKING([for OpenSSL AES_ctr128_encrypt])
|
||||
AC_TRY_COMPILE([
|
||||
#include <openssl/aes.h>
|
||||
],[
|
||||
unsigned char *data = 0;
|
||||
AES_KEY *key = 0;
|
||||
unsigned char ivec[AES_BLOCK_SIZE];
|
||||
unsigned char ecount[AES_BLOCK_SIZE];
|
||||
unsigned int num = 0;
|
||||
AES_ctr128_encrypt(data,data,AES_BLOCK_SIZE,key,ivec,ecount,&num);
|
||||
],HAVE_AESCTR="yes",OPENSSL_INC="-DNO_AESCTR $OPENSSL_INC")
|
||||
AC_MSG_RESULT([$HAVE_AESCTR])
|
||||
CFLAGS="$SAVE_CFLAGS"
|
||||
fi
|
||||
AC_SUBST(HAVE_OPENSSL)
|
||||
AC_SUBST(OPENSSL_INC)
|
||||
AC_SUBST(OPENSSL_LIB)
|
||||
|
|
|
@ -30,6 +30,11 @@
|
|||
|
||||
#ifndef OPENSSL_NO_AES
|
||||
#include <openssl/aes.h>
|
||||
#ifdef NO_AESCTR
|
||||
#include <openssl/modes.h>
|
||||
#define AES_ctr128_encrypt(in,out,len,key,ivec,ecount,num) \
|
||||
CRYPTO_ctr128_encrypt(in,out,len,key,ivec,ecount,num,(block128_f)AES_encrypt)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_DES
|
||||
|
|
Loading…
Reference in New Issue