Ignore:
Timestamp:
Nov 16, 2016 5:53:23 AM (7 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.ac

    r5458 r5483  
    15341534AC_SUBST(ac_no_ssl) 
    15351535AC_SUBST(ac_ssl_has_aes_gcm,0) 
     1536AC_SUBST(ac_ssl_has_ec,0) 
     1537AC_SUBST(ac_ssl_has_sigalg,0) 
    15361538AC_ARG_ENABLE(ssl, 
    15371539              AS_HELP_STRING([--disable-ssl], 
     
    15681570                                AC_MSG_RESULT([OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos]) 
    15691571                        fi 
     1572 
     1573                        # Check if OpenSSL supports setting curve algorithm 
     1574                        # and has elliptic curve 
     1575                         
     1576                        AC_MSG_CHECKING([OpenSSL setting curve functions]) 
     1577                        AC_SUBST(set_curve_present,0) 
     1578                        AC_SUBST(ec_curve_present,0) 
     1579                        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <openssl/ssl.h> 
     1580                                                  ]], 
     1581                                                  [ SSL_set1_curves(NULL, NULL, 0);] 
     1582                                                 )], 
     1583                                 [ set_curve_present=1 
     1584                                   AC_MSG_RESULT(ok) 
     1585                                  ], 
     1586                                 [ 
     1587                                   AC_MSG_RESULT(no) 
     1588                                 ]) 
     1589 
     1590                        AC_CHECK_LIB(ssl,EC_curve_nid2nist,[ec_curve_present=1]) 
     1591                        if test "x$set_curve_present" = "x1" -a "x$ec_curve_present" = "x1"; then 
     1592                                [ac_ssl_has_ec=1] 
     1593                                AC_MSG_RESULT([OpenSSL has elliptic curve support]) 
     1594                        else 
     1595                                AC_MSG_RESULT([OpenSSL elliptic curve algorithm unsupported]) 
     1596                        fi 
     1597 
     1598                        AC_MSG_CHECKING([OpenSSL setting sigalg]) 
     1599                        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <openssl/ssl.h> 
     1600                                                  ]], 
     1601                                                  [SSL_set1_sigalgs_list(NULL, NULL);] 
     1602                                                 )], 
     1603                                 [ ac_ssl_has_sigalg=1 
     1604                                   AC_MSG_RESULT(ok) 
     1605                                  ], 
     1606                                 [ 
     1607                                   AC_MSG_RESULT(no) 
     1608                                 ]) 
    15701609 
    15711610                        # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK 
Note: See TracChangeset for help on using the changeset viewer.