AC_CHECK_LIB([crypto], [RAND_bytes], [], [HAVE_OPENSSL=no])
LIB_SUBST_FLAGS(openssl)
if test $HAVE_OPENSSL = yes; then
- AC_CHECK_LIB([crypto], [RSA_set0_key],
- AC_DEFINE([HAVE_RSA_SET0_KEY], [1], [openssl-1.1]))
+ HAVE_RSA_SET0_KEY=yes
+ AC_CHECK_DECL([RSA_set0_key], [], [], [#include <openssl/rsa.h>])
+ AC_CHECK_LIB([crypto], [RSA_set0_key], [], [])
+ if test "$ac_cv_have_decl_RSA_set0_key" != "$ac_cv_lib_crypto_RSA_set0_key"; then
+ AC_MSG_ERROR([openssl header/library mismatch])
+ fi
+ test "$ac_cv_have_decl_RSA_set0_key" = yes &&
+ AC_DEFINE([HAVE_RSA_SET0_KEY], [1], [openssl >= 1.1])
fi
UNSTASH_FLAGS
######################################################################### gcrypt