Ignore:
Timestamp:
Nov 16, 2016 5:53:23 AM (8 years ago)
Author:
ming
Message:

Re #1975: Add autoconf detection of OpenSSL elliptic curve and sigalg support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/aconfigure

    r5458 r5483  
    642642ac_no_opencore_amrwb 
    643643ac_no_opencore_amrnb 
     644ec_curve_present 
     645set_curve_present 
    644646libcrypto_present 
    645647libssl_present 
    646648openssl_h_present 
     649ac_ssl_has_sigalg 
     650ac_ssl_has_ec 
    647651ac_ssl_has_aes_gcm 
    648652ac_no_ssl 
     
    54155419 
    54165420 
     5421 
    54175422ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r" 
    54185423if test "x$ac_cv_func_localtime_r" = xyes; then : 
     
    54205425 
    54215426fi 
     5427 
    54225428 
    54235429{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_OS_NAME to $target" >&5 
     
    77847790ac_ssl_has_aes_gcm=0 
    77857791 
     7792ac_ssl_has_ec=0 
     7793 
     7794ac_ssl_has_sigalg=0 
     7795 
    77867796# Check whether --enable-ssl was given. 
    77877797if test "${enable_ssl+set}" = set; then : 
     
    79457955$as_echo "OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos" >&6; } 
    79467956                        fi 
     7957 
     7958                        # Check if OpenSSL supports setting curve algorithm 
     7959                        # and has elliptic curve 
     7960 
     7961                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenSSL setting curve functions" >&5 
     7962$as_echo_n "checking OpenSSL setting curve functions... " >&6; } 
     7963                        set_curve_present=0 
     7964 
     7965                        ec_curve_present=0 
     7966 
     7967                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     7968/* end confdefs.h.  */ 
     7969#include <openssl/ssl.h> 
     7970 
     7971int 
     7972main () 
     7973{ 
     7974 SSL_set1_curves(NULL, NULL, 0); 
     7975 
     7976  ; 
     7977  return 0; 
     7978} 
     7979_ACEOF 
     7980if ac_fn_c_try_link "$LINENO"; then : 
     7981   set_curve_present=1 
     7982                                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 
     7983$as_echo "ok" >&6; } 
     7984 
     7985else 
     7986 
     7987                                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
     7988$as_echo "no" >&6; } 
     7989 
     7990fi 
     7991rm -f core conftest.err conftest.$ac_objext \ 
     7992    conftest$ac_exeext conftest.$ac_ext 
     7993 
     7994                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EC_curve_nid2nist in -lssl" >&5 
     7995$as_echo_n "checking for EC_curve_nid2nist in -lssl... " >&6; } 
     7996if ${ac_cv_lib_ssl_EC_curve_nid2nist+:} false; then : 
     7997  $as_echo_n "(cached) " >&6 
     7998else 
     7999  ac_check_lib_save_LIBS=$LIBS 
     8000LIBS="-lssl  $LIBS" 
     8001cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     8002/* end confdefs.h.  */ 
     8003 
     8004/* Override any GCC internal prototype to avoid an error. 
     8005   Use char because int might match the return type of a GCC 
     8006   builtin and then its argument prototype would still apply.  */ 
     8007#ifdef __cplusplus 
     8008extern "C" 
     8009#endif 
     8010char EC_curve_nid2nist (); 
     8011int 
     8012main () 
     8013{ 
     8014return EC_curve_nid2nist (); 
     8015  ; 
     8016  return 0; 
     8017} 
     8018_ACEOF 
     8019if ac_fn_c_try_link "$LINENO"; then : 
     8020  ac_cv_lib_ssl_EC_curve_nid2nist=yes 
     8021else 
     8022  ac_cv_lib_ssl_EC_curve_nid2nist=no 
     8023fi 
     8024rm -f core conftest.err conftest.$ac_objext \ 
     8025    conftest$ac_exeext conftest.$ac_ext 
     8026LIBS=$ac_check_lib_save_LIBS 
     8027fi 
     8028{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_EC_curve_nid2nist" >&5 
     8029$as_echo "$ac_cv_lib_ssl_EC_curve_nid2nist" >&6; } 
     8030if test "x$ac_cv_lib_ssl_EC_curve_nid2nist" = xyes; then : 
     8031  ec_curve_present=1 
     8032fi 
     8033 
     8034                        if test "x$set_curve_present" = "x1" -a "x$ec_curve_present" = "x1"; then 
     8035                                ac_ssl_has_ec=1 
     8036                                { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL has elliptic curve support" >&5 
     8037$as_echo "OpenSSL has elliptic curve support" >&6; } 
     8038                        else 
     8039                                { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL elliptic curve algorithm unsupported" >&5 
     8040$as_echo "OpenSSL elliptic curve algorithm unsupported" >&6; } 
     8041                        fi 
     8042 
     8043                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenSSL setting sigalg" >&5 
     8044$as_echo_n "checking OpenSSL setting sigalg... " >&6; } 
     8045                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     8046/* end confdefs.h.  */ 
     8047#include <openssl/ssl.h> 
     8048 
     8049int 
     8050main () 
     8051{ 
     8052SSL_set1_sigalgs_list(NULL, NULL); 
     8053 
     8054  ; 
     8055  return 0; 
     8056} 
     8057_ACEOF 
     8058if ac_fn_c_try_link "$LINENO"; then : 
     8059   ac_ssl_has_sigalg=1 
     8060                                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 
     8061$as_echo "ok" >&6; } 
     8062 
     8063else 
     8064 
     8065                                   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
     8066$as_echo "no" >&6; } 
     8067 
     8068fi 
     8069rm -f core conftest.err conftest.$ac_objext \ 
     8070    conftest$ac_exeext conftest.$ac_ext 
    79478071 
    79488072                        # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK 
Note: See TracChangeset for help on using the changeset viewer.