Changeset 5483
- Timestamp:
- Nov 16, 2016 5:53:23 AM (8 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/aconfigure
r5458 r5483 642 642 ac_no_opencore_amrwb 643 643 ac_no_opencore_amrnb 644 ec_curve_present 645 set_curve_present 644 646 libcrypto_present 645 647 libssl_present 646 648 openssl_h_present 649 ac_ssl_has_sigalg 650 ac_ssl_has_ec 647 651 ac_ssl_has_aes_gcm 648 652 ac_no_ssl … … 5415 5419 5416 5420 5421 5417 5422 ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r" 5418 5423 if test "x$ac_cv_func_localtime_r" = xyes; then : … … 5420 5425 5421 5426 fi 5427 5422 5428 5423 5429 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_OS_NAME to $target" >&5 … … 7784 7790 ac_ssl_has_aes_gcm=0 7785 7791 7792 ac_ssl_has_ec=0 7793 7794 ac_ssl_has_sigalg=0 7795 7786 7796 # Check whether --enable-ssl was given. 7787 7797 if test "${enable_ssl+set}" = set; then : … … 7945 7955 $as_echo "OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos" >&6; } 7946 7956 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 7971 int 7972 main () 7973 { 7974 SSL_set1_curves(NULL, NULL, 0); 7975 7976 ; 7977 return 0; 7978 } 7979 _ACEOF 7980 if 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 7985 else 7986 7987 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 7988 $as_echo "no" >&6; } 7989 7990 fi 7991 rm -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; } 7996 if ${ac_cv_lib_ssl_EC_curve_nid2nist+:} false; then : 7997 $as_echo_n "(cached) " >&6 7998 else 7999 ac_check_lib_save_LIBS=$LIBS 8000 LIBS="-lssl $LIBS" 8001 cat 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 8008 extern "C" 8009 #endif 8010 char EC_curve_nid2nist (); 8011 int 8012 main () 8013 { 8014 return EC_curve_nid2nist (); 8015 ; 8016 return 0; 8017 } 8018 _ACEOF 8019 if ac_fn_c_try_link "$LINENO"; then : 8020 ac_cv_lib_ssl_EC_curve_nid2nist=yes 8021 else 8022 ac_cv_lib_ssl_EC_curve_nid2nist=no 8023 fi 8024 rm -f core conftest.err conftest.$ac_objext \ 8025 conftest$ac_exeext conftest.$ac_ext 8026 LIBS=$ac_check_lib_save_LIBS 8027 fi 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; } 8030 if test "x$ac_cv_lib_ssl_EC_curve_nid2nist" = xyes; then : 8031 ec_curve_present=1 8032 fi 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 8049 int 8050 main () 8051 { 8052 SSL_set1_sigalgs_list(NULL, NULL); 8053 8054 ; 8055 return 0; 8056 } 8057 _ACEOF 8058 if 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 8063 else 8064 8065 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 8066 $as_echo "no" >&6; } 8067 8068 fi 8069 rm -f core conftest.err conftest.$ac_objext \ 8070 conftest$ac_exeext conftest.$ac_ext 7947 8071 7948 8072 # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK -
pjproject/trunk/aconfigure.ac
r5458 r5483 1534 1534 AC_SUBST(ac_no_ssl) 1535 1535 AC_SUBST(ac_ssl_has_aes_gcm,0) 1536 AC_SUBST(ac_ssl_has_ec,0) 1537 AC_SUBST(ac_ssl_has_sigalg,0) 1536 1538 AC_ARG_ENABLE(ssl, 1537 1539 AS_HELP_STRING([--disable-ssl], … … 1568 1570 AC_MSG_RESULT([OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos]) 1569 1571 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 ]) 1570 1609 1571 1610 # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK -
pjproject/trunk/pjlib/build/os-auto.mak.in
r4727 r5483 34 34 export TARGETS_EXE = $(TEST_EXE) 35 35 36 ifeq (@ac_ssl_has_ec@,1) 37 export PJLIB_CFLAGS += -DPJ_SSL_SOCK_OSSL_HAS_EC=1 38 endif 36 39 40 ifeq (@ac_ssl_has_sigalg@,1) 41 export PJLIB_CFLAGS += -DPJ_SSL_SOCK_OSSL_HAS_SIGALG=1 42 endif -
pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
r5472 r5483 53 53 #include <openssl/engine.h> 54 54 55 #if !defined(OPENSSL_NO_EC)55 #if defined(PJ_SSL_SOCK_OSSL_HAS_EC) && PJ_SSL_SOCK_OSSL_HAS_EC==1 56 56 extern int tls1_ec_nid2curve_id(int nid); 57 57 extern int tls1_ec_curve_id2nid(int curve_id); … … 386 386 ssl->session = SSL_SESSION_new(); 387 387 388 #if !defined(OPENSSL_NO_EC)388 #if defined(PJ_SSL_SOCK_OSSL_HAS_EC) && PJ_SSL_SOCK_OSSL_HAS_EC==1 389 389 openssl_curves_num = SSL_get_shared_curve(ssl,-1); 390 390 if (openssl_curves_num > PJ_ARRAY_SIZE(openssl_curves)) … … 1000 1000 static pj_status_t set_curves_list(pj_ssl_sock_t *ssock) 1001 1001 { 1002 #if !defined(OPENSSL_NO_EC)1002 #if defined(PJ_SSL_SOCK_OSSL_HAS_EC) && PJ_SSL_SOCK_OSSL_HAS_EC==1 1003 1003 int ret; 1004 1004 int curves[PJ_SSL_SOCK_MAX_CURVES]; … … 1023 1023 return GET_SSL_STATUS(ssock); 1024 1024 } 1025 #endif 1025 1026 1026 1027 return PJ_SUCCESS; 1027 #else1028 return PJ_ENOTSUP;1029 #endif1030 1028 } 1031 1029 1032 1030 static pj_status_t set_sigalgs(pj_ssl_sock_t *ssock) 1033 1031 { 1032 #if defined(PJ_SSL_SOCK_OSSL_HAS_SIGALG) && PJ_SSL_SOCK_OSSL_HAS_SIGALG==1 1034 1033 int ret; 1035 1034 … … 1046 1045 return GET_SSL_STATUS(ssock); 1047 1046 } 1047 #endif 1048 1048 1049 1049 return PJ_SUCCESS; … … 2394 2394 2395 2395 for (i = 0; i < *curve_num; ++i) 2396 2396 curves[i] = openssl_curves[i].id; 2397 2397 2398 2398 return PJ_SUCCESS;
Note: See TracChangeset
for help on using the changeset viewer.