Changeset 5517
- Timestamp:
- Jan 10, 2017 9:17:07 AM (8 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/aconfigure
r5509 r5517 642 642 ac_no_opencore_amrwb 643 643 ac_no_opencore_amrnb 644 ec_curve_present645 set_curve_present646 644 libcrypto_present 647 645 libssl_present 648 646 openssl_h_present 649 ac_ssl_has_sigalg650 ac_ssl_has_ec651 647 ac_ssl_has_aes_gcm 652 648 ac_no_ssl … … 760 756 oldincludedir 761 757 includedir 758 runstatedir 762 759 localstatedir 763 760 sharedstatedir … … 882 879 sharedstatedir='${prefix}/com' 883 880 localstatedir='${prefix}/var' 881 runstatedir='${localstatedir}/run' 884 882 includedir='${prefix}/include' 885 883 oldincludedir='/usr/include' … … 1134 1132 silent=yes ;; 1135 1133 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 1136 1143 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) 1137 1144 ac_prev=sbindir ;; … … 1271 1278 datadir sysconfdir sharedstatedir localstatedir includedir \ 1272 1279 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ 1273 libdir localedir mandir 1280 libdir localedir mandir runstatedir 1274 1281 do 1275 1282 eval ac_val=\$$ac_var … … 1424 1431 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] 1425 1432 --localstatedir=DIR modifiable single-machine data [PREFIX/var] 1433 --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] 1426 1434 --libdir=DIR object code libraries [EPREFIX/lib] 1427 1435 --includedir=DIR C header files [PREFIX/include] … … 2345 2353 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 2346 2354 as_fn_error $? "failed to load site script $ac_site_file 2347 See \`config.log' for more details" "$LINENO" 5 2355 See \`config.log' for more details" "$LINENO" 5; } 2348 2356 fi 2349 2357 done … … 2488 2496 case $ac_cv_build in 2489 2497 *-*-*) ;; 2490 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 2498 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; 2491 2499 esac 2492 2500 build=$ac_cv_build … … 2521 2529 case $ac_cv_host in 2522 2530 *-*-*) ;; 2523 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 2531 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; 2524 2532 esac 2525 2533 host=$ac_cv_host … … 2554 2562 case $ac_cv_target in 2555 2563 *-*-*) ;; 2556 *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 2564 *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; 2557 2565 esac 2558 2566 target=$ac_cv_target … … 2891 2899 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 2892 2900 as_fn_error $? "no acceptable C compiler found in \$PATH 2893 See \`config.log' for more details" "$LINENO" 5 2901 See \`config.log' for more details" "$LINENO" 5; } 2894 2902 2895 2903 # Provide some information about the compiler. … … 3006 3014 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3007 3015 as_fn_error 77 "C compiler cannot create executables 3008 See \`config.log' for more details" "$LINENO" 5 3016 See \`config.log' for more details" "$LINENO" 5; } 3009 3017 else 3010 3018 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 … … 3049 3057 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3050 3058 as_fn_error $? "cannot compute suffix of executables: cannot compile and link 3051 See \`config.log' for more details" "$LINENO" 5 3059 See \`config.log' for more details" "$LINENO" 5; } 3052 3060 fi 3053 3061 rm -f conftest conftest$ac_cv_exeext … … 3108 3116 as_fn_error $? "cannot run C compiled programs. 3109 3117 If you meant to cross compile, use \`--host'. 3110 See \`config.log' for more details" "$LINENO" 5 3118 See \`config.log' for more details" "$LINENO" 5; } 3111 3119 fi 3112 3120 fi … … 3160 3168 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 3161 3169 as_fn_error $? "cannot compute suffix of object files: cannot compile 3162 See \`config.log' for more details" "$LINENO" 5 3170 See \`config.log' for more details" "$LINENO" 5; } 3163 3171 fi 3164 3172 rm -f conftest.$ac_cv_objext conftest.$ac_ext … … 4554 4562 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 4555 4563 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check 4556 See \`config.log' for more details" "$LINENO" 5 4564 See \`config.log' for more details" "$LINENO" 5; } 4557 4565 fi 4558 4566 … … 5044 5052 *) 5045 5053 as_fn_error $? "unknown endianness 5046 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 5054 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; 5047 5055 esac 5048 5056 … … 7617 7625 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 7618 7626 as_fn_error $? "Error: unable to recognize your IPP installation. Make sure the paths and ARCH suffix are set correctly, run with --help for more info 7619 See \`config.log' for more details" "$LINENO" 5 7627 See \`config.log' for more details" "$LINENO" 5; } 7620 7628 fi 7621 7629 rm -f core conftest.err conftest.$ac_objext \ … … 7673 7681 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 7674 7682 as_fn_error $? "Unable to find to find built binaries under $IPPSAMPLES/speech-codecs/{bin,_bin}. Have you built the IPP samples? 7675 See \`config.log' for more details" "$LINENO" 5 7683 See \`config.log' for more details" "$LINENO" 5; } 7676 7684 fi 7677 7685 else … … 7679 7687 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 7680 7688 as_fn_error $? "unable to find $IPPSAMPLES/speech-codecs/bin/*gcc*/lib or $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib directory. Have you built the samples? 7681 See \`config.log' for more details" "$LINENO" 5 7689 See \`config.log' for more details" "$LINENO" 5; } 7682 7690 fi 7683 7691 … … 7687 7695 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 7688 7696 as_fn_error $? "There's something wrong with this script, directory $IPPSAMP_DIR does not exist 7689 See \`config.log' for more details" "$LINENO" 5 7697 See \`config.log' for more details" "$LINENO" 5; } 7690 7698 exit 1; 7691 7699 fi … … 7701 7709 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 7702 7710 as_fn_error $? "bug in this script: unsupported IPP version 7703 See \`config.log' for more details" "$LINENO" 5 7711 See \`config.log' for more details" "$LINENO" 5; } 7704 7712 fi 7705 7713 … … 7708 7716 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 7709 7717 as_fn_error $? "$IPPSAMP_LIBS doesn't exist in $IPPSAMP_DIR 7710 See \`config.log' for more details" "$LINENO" 5 7718 See \`config.log' for more details" "$LINENO" 5; } 7711 7719 fi 7712 7720 … … 7744 7752 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 7745 7753 as_fn_error $? "no 7746 See \`config.log' for more details" "$LINENO" 5 7754 See \`config.log' for more details" "$LINENO" 5; } 7747 7755 fi 7748 7756 rm -f core conftest.err conftest.$ac_objext \ … … 7789 7797 7790 7798 ac_ssl_has_aes_gcm=0 7791 7792 ac_ssl_has_ec=07793 7794 ac_ssl_has_sigalg=07795 7799 7796 7800 # Check whether --enable-ssl was given. … … 7955 7959 $as_echo "OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos" >&6; } 7956 7960 fi 7957 7958 # Check if OpenSSL supports setting curve algorithm7959 # and has elliptic curve7960 7961 { $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenSSL setting curve functions" >&57962 $as_echo_n "checking OpenSSL setting curve functions... " >&6; }7963 set_curve_present=07964 7965 ec_curve_present=07966 7967 cat confdefs.h - <<_ACEOF >conftest.$ac_ext7968 /* end confdefs.h. */7969 #include <openssl/ssl.h>7970 7971 int7972 main ()7973 {7974 SSL_set1_curves(NULL, NULL, 0);7975 7976 ;7977 return 0;7978 }7979 _ACEOF7980 if ac_fn_c_try_link "$LINENO"; then :7981 set_curve_present=17982 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&57983 $as_echo "ok" >&6; }7984 7985 else7986 7987 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&57988 $as_echo "no" >&6; }7989 7990 fi7991 rm -f core conftest.err conftest.$ac_objext \7992 conftest$ac_exeext conftest.$ac_ext7993 7994 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EC_curve_nid2nist in -lssl" >&57995 $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) " >&67998 else7999 ac_check_lib_save_LIBS=$LIBS8000 LIBS="-lssl $LIBS"8001 cat confdefs.h - <<_ACEOF >conftest.$ac_ext8002 /* 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 GCC8006 builtin and then its argument prototype would still apply. */8007 #ifdef __cplusplus8008 extern "C"8009 #endif8010 char EC_curve_nid2nist ();8011 int8012 main ()8013 {8014 return EC_curve_nid2nist ();8015 ;8016 return 0;8017 }8018 _ACEOF8019 if ac_fn_c_try_link "$LINENO"; then :8020 ac_cv_lib_ssl_EC_curve_nid2nist=yes8021 else8022 ac_cv_lib_ssl_EC_curve_nid2nist=no8023 fi8024 rm -f core conftest.err conftest.$ac_objext \8025 conftest$ac_exeext conftest.$ac_ext8026 LIBS=$ac_check_lib_save_LIBS8027 fi8028 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_EC_curve_nid2nist" >&58029 $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=18032 fi8033 8034 if test "x$set_curve_present" = "x1" -a "x$ec_curve_present" = "x1"; then8035 ac_ssl_has_ec=18036 { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL has elliptic curve support" >&58037 $as_echo "OpenSSL has elliptic curve support" >&6; }8038 else8039 { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL elliptic curve algorithm unsupported" >&58040 $as_echo "OpenSSL elliptic curve algorithm unsupported" >&6; }8041 fi8042 8043 { $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenSSL setting sigalg" >&58044 $as_echo_n "checking OpenSSL setting sigalg... " >&6; }8045 cat confdefs.h - <<_ACEOF >conftest.$ac_ext8046 /* end confdefs.h. */8047 #include <openssl/ssl.h>8048 8049 int8050 main ()8051 {8052 SSL_set1_sigalgs_list(NULL, NULL);8053 8054 ;8055 return 0;8056 }8057 _ACEOF8058 if ac_fn_c_try_link "$LINENO"; then :8059 ac_ssl_has_sigalg=18060 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&58061 $as_echo "ok" >&6; }8062 8063 else8064 8065 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&58066 $as_echo "no" >&6; }8067 8068 fi8069 rm -f core conftest.err conftest.$ac_objext \8070 conftest$ac_exeext conftest.$ac_ext8071 7961 8072 7962 # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK … … 9400 9290 "third_party/build/os-auto.mak") CONFIG_FILES="$CONFIG_FILES third_party/build/os-auto.mak" ;; 9401 9291 9402 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 9292 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 9403 9293 esac 9404 9294 done … … 9717 9607 case $ac_mode$ac_tag in 9718 9608 :[FHL]*:*);; 9719 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 9609 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; 9720 9610 :[FH]-) ac_tag=-:-;; 9721 9611 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; … … 9745 9635 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; 9746 9636 esac || 9747 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 9637 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; 9748 9638 esac 9749 9639 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac … … 9772 9662 case $ac_tag in 9773 9663 *:-:* | *:-) cat >"$ac_tmp/stdin" \ 9774 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 9664 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; 9775 9665 esac 9776 9666 ;; -
pjproject/trunk/aconfigure.ac
r5509 r5517 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)1538 1536 AC_ARG_ENABLE(ssl, 1539 1537 AS_HELP_STRING([--disable-ssl], … … 1570 1568 AC_MSG_RESULT([OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos]) 1571 1569 fi 1572 1573 # Check if OpenSSL supports setting curve algorithm1574 # and has elliptic curve1575 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=11584 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"; then1592 [ac_ssl_has_ec=1]1593 AC_MSG_RESULT([OpenSSL has elliptic curve support])1594 else1595 AC_MSG_RESULT([OpenSSL elliptic curve algorithm unsupported])1596 fi1597 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=11604 AC_MSG_RESULT(ok)1605 ],1606 [1607 AC_MSG_RESULT(no)1608 ])1609 1570 1610 1571 # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK -
pjproject/trunk/pjlib/build/os-auto.mak.in
r5483 r5517 33 33 export TARGETS = $(PJLIB_LIB) $(PJLIB_SONAME) 34 34 export TARGETS_EXE = $(TEST_EXE) 35 36 ifeq (@ac_ssl_has_ec@,1)37 export PJLIB_CFLAGS += -DPJ_SSL_SOCK_OSSL_HAS_EC=138 endif39 40 ifeq (@ac_ssl_has_sigalg@,1)41 export PJLIB_CFLAGS += -DPJ_SSL_SOCK_OSSL_HAS_SIGALG=142 endif -
pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
r5501 r5517 52 52 #include <openssl/rand.h> 53 53 #include <openssl/engine.h> 54 55 #if defined(PJ_SSL_SOCK_OSSL_HAS_EC) && PJ_SSL_SOCK_OSSL_HAS_EC==1 56 extern int tls1_ec_nid2curve_id(int nid); 57 extern int tls1_ec_curve_id2nid(int curve_id); 54 #include <openssl/opensslconf.h> 55 56 #if !defined(OPENSSL_NO_EC) && OPENSSL_VERSION_NUMBER >= 0x1000200fL 57 58 # include <openssl/obj_mac.h> 59 60 static const unsigned nid_cid_map[] = { 61 NID_sect163k1, /* sect163k1 (1) */ 62 NID_sect163r1, /* sect163r1 (2) */ 63 NID_sect163r2, /* sect163r2 (3) */ 64 NID_sect193r1, /* sect193r1 (4) */ 65 NID_sect193r2, /* sect193r2 (5) */ 66 NID_sect233k1, /* sect233k1 (6) */ 67 NID_sect233r1, /* sect233r1 (7) */ 68 NID_sect239k1, /* sect239k1 (8) */ 69 NID_sect283k1, /* sect283k1 (9) */ 70 NID_sect283r1, /* sect283r1 (10) */ 71 NID_sect409k1, /* sect409k1 (11) */ 72 NID_sect409r1, /* sect409r1 (12) */ 73 NID_sect571k1, /* sect571k1 (13) */ 74 NID_sect571r1, /* sect571r1 (14) */ 75 NID_secp160k1, /* secp160k1 (15) */ 76 NID_secp160r1, /* secp160r1 (16) */ 77 NID_secp160r2, /* secp160r2 (17) */ 78 NID_secp192k1, /* secp192k1 (18) */ 79 NID_X9_62_prime192v1, /* secp192r1 (19) */ 80 NID_secp224k1, /* secp224k1 (20) */ 81 NID_secp224r1, /* secp224r1 (21) */ 82 NID_secp256k1, /* secp256k1 (22) */ 83 NID_X9_62_prime256v1, /* secp256r1 (23) */ 84 NID_secp384r1, /* secp384r1 (24) */ 85 NID_secp521r1, /* secp521r1 (25) */ 86 NID_brainpoolP256r1, /* brainpoolP256r1 (26) */ 87 NID_brainpoolP384r1, /* brainpoolP384r1 (27) */ 88 NID_brainpoolP512r1 /* brainpoolP512r1 (28) */ 89 }; 90 91 static unsigned get_cid_from_nid(unsigned nid) 92 { 93 unsigned i, cid = 0; 94 for (i=0; i<PJ_ARRAY_SIZE(nid_cid_map); ++i) { 95 if (nid == nid_cid_map[i]) { 96 cid = i+1; 97 break; 98 } 99 } 100 return cid; 101 }; 102 103 static unsigned get_nid_from_cid(unsigned cid) 104 { 105 if ((cid == 0) || (cid > PJ_ARRAY_SIZE(nid_cid_map))) 106 return 0; 107 108 return nid_cid_map[cid-1]; 109 } 110 58 111 #endif 59 112 … … 386 439 ssl->session = SSL_SESSION_new(); 387 440 388 #if defined(PJ_SSL_SOCK_OSSL_HAS_EC) && PJ_SSL_SOCK_OSSL_HAS_EC==1441 #if !defined(OPENSSL_NO_EC) && OPENSSL_VERSION_NUMBER >= 0x1000200fL 389 442 openssl_curves_num = SSL_get_shared_curve(ssl,-1); 390 443 if (openssl_curves_num > PJ_ARRAY_SIZE(openssl_curves)) … … 403 456 } 404 457 405 openssl_curves[i].id = tls1_ec_nid2curve_id(nid);458 openssl_curves[i].id = get_cid_from_nid(nid); 406 459 openssl_curves[i].name = cname; 407 460 } … … 1002 1055 static pj_status_t set_curves_list(pj_ssl_sock_t *ssock) 1003 1056 { 1004 #if defined(PJ_SSL_SOCK_OSSL_HAS_EC) && PJ_SSL_SOCK_OSSL_HAS_EC==11057 #if !defined(OPENSSL_NO_EC) && OPENSSL_VERSION_NUMBER >= 0x1000200fL 1005 1058 int ret; 1006 1059 int curves[PJ_SSL_SOCK_MAX_CURVES]; 1007 intcnt;1060 unsigned cnt; 1008 1061 1009 1062 if (ssock->param.curves_num == 0) … … 1011 1064 1012 1065 for (cnt = 0; cnt < ssock->param.curves_num; cnt++) { 1013 curves[cnt] = tls1_ec_curve_id2nid(ssock->param.curves[cnt]);1066 curves[cnt] = get_nid_from_cid(ssock->param.curves[cnt]); 1014 1067 } 1015 1068 … … 1028 1081 PJ_UNUSED_ARG(ssock); 1029 1082 #endif 1030 1031 1083 return PJ_SUCCESS; 1032 1084 } … … 1034 1086 static pj_status_t set_sigalgs(pj_ssl_sock_t *ssock) 1035 1087 { 1036 #if defined(PJ_SSL_SOCK_OSSL_HAS_SIGALG) && PJ_SSL_SOCK_OSSL_HAS_SIGALG==11088 #if OPENSSL_VERSION_NUMBER >= 0x1000200fL 1037 1089 int ret; 1038 1090 … … 1052 1104 PJ_UNUSED_ARG(ssock); 1053 1105 #endif 1054 1055 1106 return PJ_SUCCESS; 1056 1107 }
Note: See TracChangeset
for help on using the changeset viewer.