diff options
author | Liong Sauw Ming <ming@teluu.com> | 2016-11-16 05:53:23 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2016-11-16 05:53:23 +0000 |
commit | 21a681c52e3e8c1fe95125a87363ee1f846a1ab9 (patch) | |
tree | dfdb16ebeb7918d8c7a8680652f358e8807a5e12 /aconfigure.ac | |
parent | 273b7964359262ab42523ea657f3c5313c151988 (diff) |
Re #1975: Add autoconf detection of OpenSSL elliptic curve and sigalg support
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5483 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'aconfigure.ac')
-rw-r--r-- | aconfigure.ac | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/aconfigure.ac b/aconfigure.ac index 387a37ce..50595682 100644 --- a/aconfigure.ac +++ b/aconfigure.ac @@ -1533,6 +1533,8 @@ fi dnl # Include SSL support AC_SUBST(ac_no_ssl) AC_SUBST(ac_ssl_has_aes_gcm,0) +AC_SUBST(ac_ssl_has_ec,0) +AC_SUBST(ac_ssl_has_sigalg,0) AC_ARG_ENABLE(ssl, AS_HELP_STRING([--disable-ssl], [Exclude SSL support the build (default: autodetect)]) @@ -1568,6 +1570,43 @@ AC_ARG_ENABLE(ssl, AC_MSG_RESULT([OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos]) fi + # Check if OpenSSL supports setting curve algorithm + # and has elliptic curve + + AC_MSG_CHECKING([OpenSSL setting curve functions]) + AC_SUBST(set_curve_present,0) + AC_SUBST(ec_curve_present,0) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <openssl/ssl.h> + ]], + [ SSL_set1_curves(NULL, NULL, 0);] + )], + [ set_curve_present=1 + AC_MSG_RESULT(ok) + ], + [ + AC_MSG_RESULT(no) + ]) + + AC_CHECK_LIB(ssl,EC_curve_nid2nist,[ec_curve_present=1]) + if test "x$set_curve_present" = "x1" -a "x$ec_curve_present" = "x1"; then + [ac_ssl_has_ec=1] + AC_MSG_RESULT([OpenSSL has elliptic curve support]) + else + AC_MSG_RESULT([OpenSSL elliptic curve algorithm unsupported]) + fi + + AC_MSG_CHECKING([OpenSSL setting sigalg]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <openssl/ssl.h> + ]], + [SSL_set1_sigalgs_list(NULL, NULL);] + )], + [ ac_ssl_has_sigalg=1 + AC_MSG_RESULT(ok) + ], + [ + AC_MSG_RESULT(no) + ]) + # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK #AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1) AC_DEFINE(PJ_HAS_SSL_SOCK, 1) |