- Timestamp:
- Jan 23, 2017 3:34:17 AM (8 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/aconfigure
r5517 r5537 756 756 oldincludedir 757 757 includedir 758 runstatedir759 758 localstatedir 760 759 sharedstatedir … … 879 878 sharedstatedir='${prefix}/com' 880 879 localstatedir='${prefix}/var' 881 runstatedir='${localstatedir}/run'882 880 includedir='${prefix}/include' 883 881 oldincludedir='/usr/include' … … 1132 1130 silent=yes ;; 1133 1131 1134 -runstatedir | --runstatedir | --runstatedi | --runstated \1135 | --runstate | --runstat | --runsta | --runst | --runs \1136 | --run | --ru | --r)1137 ac_prev=runstatedir ;;1138 -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \1139 | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \1140 | --run=* | --ru=* | --r=*)1141 runstatedir=$ac_optarg ;;1142 1143 1132 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) 1144 1133 ac_prev=sbindir ;; … … 1278 1267 datadir sysconfdir sharedstatedir localstatedir includedir \ 1279 1268 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ 1280 libdir localedir mandir runstatedir1269 libdir localedir mandir 1281 1270 do 1282 1271 eval ac_val=\$$ac_var … … 1431 1420 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] 1432 1421 --localstatedir=DIR modifiable single-machine data [PREFIX/var] 1433 --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]1434 1422 --libdir=DIR object code libraries [EPREFIX/lib] 1435 1423 --includedir=DIR C header files [PREFIX/include] … … 7866 7854 fi 7867 7855 7868 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_ library_initin -lssl" >&57869 $as_echo_n "checking for SSL_ library_initin -lssl... " >&6; }7870 if ${ac_cv_lib_ssl_SSL_ library_init+:} false; then :7856 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_CTX_new in -lssl" >&5 7857 $as_echo_n "checking for SSL_CTX_new in -lssl... " >&6; } 7858 if ${ac_cv_lib_ssl_SSL_CTX_new+:} false; then : 7871 7859 $as_echo_n "(cached) " >&6 7872 7860 else … … 7882 7870 extern "C" 7883 7871 #endif 7884 char SSL_ library_init();7872 char SSL_CTX_new (); 7885 7873 int 7886 7874 main () 7887 7875 { 7888 return SSL_ library_init();7876 return SSL_CTX_new (); 7889 7877 ; 7890 7878 return 0; … … 7892 7880 _ACEOF 7893 7881 if ac_fn_c_try_link "$LINENO"; then : 7894 ac_cv_lib_ssl_SSL_ library_init=yes7895 else 7896 ac_cv_lib_ssl_SSL_ library_init=no7882 ac_cv_lib_ssl_SSL_CTX_new=yes 7883 else 7884 ac_cv_lib_ssl_SSL_CTX_new=no 7897 7885 fi 7898 7886 rm -f core conftest.err conftest.$ac_objext \ … … 7900 7888 LIBS=$ac_check_lib_save_LIBS 7901 7889 fi 7902 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_ library_init" >&57903 $as_echo "$ac_cv_lib_ssl_SSL_ library_init" >&6; }7904 if test "x$ac_cv_lib_ssl_SSL_ library_init" = xyes; then :7890 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_CTX_new" >&5 7891 $as_echo "$ac_cv_lib_ssl_SSL_CTX_new" >&6; } 7892 if test "x$ac_cv_lib_ssl_SSL_CTX_new" = xyes; then : 7905 7893 libssl_present=1 && LIBS="-lssl $LIBS" 7906 7894 fi … … 7911 7899 7912 7900 # Check if SRTP should be compiled with OpenSSL 7913 # support, to enable cryptos such as AES GCM 7914 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_128_gcm in -lcrypto" >&5 7915 $as_echo_n "checking for EVP_aes_128_gcm in -lcrypto... " >&6; } 7916 if ${ac_cv_lib_crypto_EVP_aes_128_gcm+:} false; then : 7917 $as_echo_n "(cached) " >&6 7918 else 7919 ac_check_lib_save_LIBS=$LIBS 7920 LIBS="-lcrypto $LIBS" 7921 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 7901 # support, to enable cryptos such as AES GCM. 7902 7903 # EVP_CIPHER_CTX is now opaque in OpenSSL 1.1.0, libsrtp 1.5.4 uses it as a transparent type. 7904 # AC_CHECK_LIB(crypto,EVP_aes_128_gcm,[ac_ssl_has_aes_gcm=1]) 7905 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 7922 7906 /* end confdefs.h. */ 7923 7924 /* Override any GCC internal prototype to avoid an error. 7925 Use char because int might match the return type of a GCC 7926 builtin and then its argument prototype would still apply. */ 7927 #ifdef __cplusplus 7928 extern "C" 7929 #endif 7930 char EVP_aes_128_gcm (); 7907 #include <openssl/evp.h> 7931 7908 int 7932 7909 main () 7933 7910 { 7934 return EVP_aes_128_gcm();7911 EVP_CIPHER_CTX ctx;EVP_aes_128_gcm(); 7935 7912 ; 7936 7913 return 0; 7937 7914 } 7938 7915 _ACEOF 7939 if ac_fn_c_try_link "$LINENO"; then : 7940 ac_cv_lib_crypto_EVP_aes_128_gcm=yes 7941 else 7942 ac_cv_lib_crypto_EVP_aes_128_gcm=no 7943 fi 7944 rm -f core conftest.err conftest.$ac_objext \ 7945 conftest$ac_exeext conftest.$ac_ext 7946 LIBS=$ac_check_lib_save_LIBS 7947 fi 7948 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_128_gcm" >&5 7949 $as_echo "$ac_cv_lib_crypto_EVP_aes_128_gcm" >&6; } 7950 if test "x$ac_cv_lib_crypto_EVP_aes_128_gcm" = xyes; then : 7916 if ac_fn_c_try_compile "$LINENO"; then : 7951 7917 ac_ssl_has_aes_gcm=1 7952 7918 fi 7953 7919 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 7954 7920 if test "x$ac_ssl_has_aes_gcm" = "x1"; then 7955 7921 { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL has AES GCM support, SRTP will use OpenSSL" >&5 -
pjproject/trunk/aconfigure.ac
r5517 r5537 1556 1556 AC_CHECK_HEADER(openssl/ssl.h,[openssl_h_present=1]) 1557 1557 AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && LIBS="-lcrypto $LIBS"]) 1558 AC_CHECK_LIB(ssl,SSL_ library_init,[libssl_present=1 && LIBS="-lssl $LIBS"])1558 AC_CHECK_LIB(ssl,SSL_CTX_new,[libssl_present=1 && LIBS="-lssl $LIBS"]) 1559 1559 if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then 1560 1560 AC_MSG_RESULT([OpenSSL library found, SSL support enabled]) 1561 1561 1562 1562 # Check if SRTP should be compiled with OpenSSL 1563 # support, to enable cryptos such as AES GCM 1564 AC_CHECK_LIB(crypto,EVP_aes_128_gcm,[ac_ssl_has_aes_gcm=1]) 1563 # support, to enable cryptos such as AES GCM. 1564 1565 # EVP_CIPHER_CTX is now opaque in OpenSSL 1.1.0, libsrtp 1.5.4 uses it as a transparent type. 1566 # AC_CHECK_LIB(crypto,EVP_aes_128_gcm,[ac_ssl_has_aes_gcm=1]) 1567 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/evp.h>]], 1568 [EVP_CIPHER_CTX ctx;EVP_aes_128_gcm();])], 1569 [ac_ssl_has_aes_gcm=1]) 1565 1570 if test "x$ac_ssl_has_aes_gcm" = "x1"; then 1566 1571 AC_MSG_RESULT([OpenSSL has AES GCM support, SRTP will use OpenSSL]) -
pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
r5517 r5537 46 46 * Include OpenSSL headers 47 47 */ 48 #include <openssl/asn1.h> 48 49 #include <openssl/bio.h> 49 50 #include <openssl/ssl.h> … … 111 112 #endif 112 113 114 115 #if OPENSSL_VERSION_NUMBER >= 0x10100000L 116 # define OPENSSL_NO_SSL2 /* seems to be removed in 1.1.0 */ 117 # define M_ASN1_STRING_data(x) ASN1_STRING_get0_data(x) 118 # define M_ASN1_STRING_length(x) ASN1_STRING_length(x) 119 #else 120 # define SSL_CIPHER_get_id(c) (c)->id 121 # define SSL_set_session(ssl, s) (ssl)->session = (s) 122 #endif 123 124 113 125 #ifdef _MSC_VER 114 126 # pragma comment( lib, "libeay32") 115 127 # pragma comment( lib, "ssleay32") 128 # pragma comment( lib, "crypt32") 116 129 #endif 117 130 … … 432 445 c = sk_SSL_CIPHER_value(sk_cipher,i); 433 446 openssl_ciphers[i].id = (pj_ssl_cipher) 434 (pj_uint32_t)c->id & 0x00FFFFFF; 447 (pj_uint32_t)SSL_CIPHER_get_id(c) & 448 0x00FFFFFF; 435 449 openssl_ciphers[i].name = SSL_CIPHER_get_name(c); 436 450 } 437 451 openssl_cipher_num = n; 438 452 439 ssl->session = SSL_SESSION_new();453 SSL_set_session(ssl, SSL_SESSION_new()); 440 454 441 455 #if !defined(OPENSSL_NO_EC) && OPENSSL_VERSION_NUMBER >= 0x1000200fL … … 1014 1028 c = sk_SSL_CIPHER_value(sk_cipher, j); 1015 1029 if (ssock->param.ciphers[i] == (pj_ssl_cipher) 1016 ((pj_uint32_t)c->id & 0x00FFFFFF)) 1030 ((pj_uint32_t)SSL_CIPHER_get_id(c) & 1031 0x00FFFFFF)) 1017 1032 { 1018 1033 const char *c_name; … … 1067 1082 } 1068 1083 1069 if( ssock->ossl_ssl->server) {1084 if( SSL_is_server(ssock->ossl_ssl) ) { 1070 1085 ret = SSL_set1_curves(ssock->ossl_ssl, curves, 1071 1086 ssock->param.curves_num); … … 1226 1241 char buf[512]; 1227 1242 pj_uint8_t serial_no[64] = {0}; /* should be >= sizeof(ci->serial_no) */ 1228 pj_uint8_t *q;1243 const pj_uint8_t *q; 1229 1244 unsigned len; 1230 1245 GENERAL_NAMES *names = NULL; … … 1236 1251 1237 1252 /* Get serial no */ 1238 q = ( pj_uint8_t*) M_ASN1_STRING_data(X509_get_serialNumber(x));1253 q = (const pj_uint8_t*) M_ASN1_STRING_data(X509_get_serialNumber(x)); 1239 1254 len = M_ASN1_STRING_length(X509_get_serialNumber(x)); 1240 1255 if (len > sizeof(ci->serial_no)) … … 2643 2658 /* Current cipher */ 2644 2659 cipher = SSL_get_current_cipher(ssock->ossl_ssl); 2645 info->cipher = ( cipher->id& 0x00FFFFFF);2660 info->cipher = (SSL_CIPHER_get_id(cipher) & 0x00FFFFFF); 2646 2661 2647 2662 /* Remote address */
Note: See TracChangeset
for help on using the changeset viewer.