| 1 |
AC_DEFUN([ACX_OPENSSL_ECC],[ |
| 2 |
AC_MSG_CHECKING(for OpenSSL ECC support) |
| 3 |
|
| 4 |
tmp_CPPFLAGS=$CPPFLAGS |
| 5 |
tmp_LIBS=$LIBS |
| 6 |
|
| 7 |
CPPFLAGS="$CPPFLAGS $CRYPTO_INCLUDES" |
| 8 |
LIBS="$CRYPTO_LIBS $LIBS" |
| 9 |
|
| 10 |
AC_LANG_PUSH([C]) |
| 11 |
AC_CACHE_VAL([acx_cv_lib_openssl_ecc_support],[ |
| 12 |
acx_cv_lib_openssl_ecc_support=no |
| 13 |
AC_RUN_IFELSE([ |
| 14 |
AC_LANG_SOURCE([[ |
| 15 |
#include <openssl/ecdsa.h> |
| 16 |
#include <openssl/objects.h> |
| 17 |
int main() |
| 18 |
{ |
| 19 |
EC_KEY *ec256, *ec384, *ec521; |
| 20 |
|
| 21 |
ec256 = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); |
| 22 |
ec384 = EC_KEY_new_by_curve_name(NID_secp384r1); |
| 23 |
ec521 = EC_KEY_new_by_curve_name(NID_secp521r1); |
| 24 |
if (ec256 == NULL || ec384 == NULL || ec521 == NULL) |
| 25 |
return 1; |
| 26 |
return 0; |
| 27 |
} |
| 28 |
]]) |
| 29 |
],[ |
| 30 |
AC_MSG_RESULT([Found P256, P384, and P521]) |
| 31 |
acx_cv_lib_openssl_ecc_support=yes |
| 32 |
],[ |
| 33 |
AC_MSG_RESULT([Cannot find P256, P384, or P521]) |
| 34 |
acx_cv_lib_openssl_ecc_support=no |
| 35 |
],[ |
| 36 |
AC_MSG_WARN([Cannot test, assuming P256, P384, and P521]) |
| 37 |
acx_cv_lib_openssl_ecc_support=yes |
| 38 |
]) |
| 39 |
]) |
| 40 |
AC_LANG_POP([C]) |
| 41 |
|
| 42 |
CPPFLAGS=$tmp_CPPFLAGS |
| 43 |
LIBS=$tmp_LIBS |
| 44 |
have_lib_openssl_ecc_support="${acx_cv_lib_openssl_ecc_support}" |
| 45 |
]) |