Changeset 5517


Ignore:
Timestamp:
Jan 10, 2017 9:17:07 AM (8 years ago)
Author:
riza
Message:

Re #1975:

  • Change autoconf detection in r5483 to compile time check.
  • Don't use tls1_ec_nid2curve_id()/tls1_ec_curve_id2nid() since they are not public API.

Thanks to Alexander Traud for the suggestions.

Location:
pjproject/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/aconfigure

    r5509 r5517  
    642642ac_no_opencore_amrwb 
    643643ac_no_opencore_amrnb 
    644 ec_curve_present 
    645 set_curve_present 
    646644libcrypto_present 
    647645libssl_present 
    648646openssl_h_present 
    649 ac_ssl_has_sigalg 
    650 ac_ssl_has_ec 
    651647ac_ssl_has_aes_gcm 
    652648ac_no_ssl 
     
    760756oldincludedir 
    761757includedir 
     758runstatedir 
    762759localstatedir 
    763760sharedstatedir 
     
    882879sharedstatedir='${prefix}/com' 
    883880localstatedir='${prefix}/var' 
     881runstatedir='${localstatedir}/run' 
    884882includedir='${prefix}/include' 
    885883oldincludedir='/usr/include' 
     
    11341132    silent=yes ;; 
    11351133 
     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 
    11361143  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) 
    11371144    ac_prev=sbindir ;; 
     
    12711278                datadir sysconfdir sharedstatedir localstatedir includedir \ 
    12721279                oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ 
    1273                 libdir localedir mandir 
     1280                libdir localedir mandir runstatedir 
    12741281do 
    12751282  eval ac_val=\$$ac_var 
     
    14241431  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com] 
    14251432  --localstatedir=DIR     modifiable single-machine data [PREFIX/var] 
     1433  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run] 
    14261434  --libdir=DIR            object code libraries [EPREFIX/lib] 
    14271435  --includedir=DIR        C header files [PREFIX/include] 
     
    23452353$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
    23462354as_fn_error $? "failed to load site script $ac_site_file 
    2347 See \`config.log' for more details" "$LINENO" 5 ; } 
     2355See \`config.log' for more details" "$LINENO" 5; } 
    23482356  fi 
    23492357done 
     
    24882496case $ac_cv_build in 
    24892497*-*-*) ;; 
    2490 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; 
     2498*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; 
    24912499esac 
    24922500build=$ac_cv_build 
     
    25212529case $ac_cv_host in 
    25222530*-*-*) ;; 
    2523 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; 
     2531*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; 
    25242532esac 
    25252533host=$ac_cv_host 
     
    25542562case $ac_cv_target in 
    25552563*-*-*) ;; 
    2556 *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; 
     2564*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; 
    25572565esac 
    25582566target=$ac_cv_target 
     
    28912899$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
    28922900as_fn_error $? "no acceptable C compiler found in \$PATH 
    2893 See \`config.log' for more details" "$LINENO" 5 ; } 
     2901See \`config.log' for more details" "$LINENO" 5; } 
    28942902 
    28952903# Provide some information about the compiler. 
     
    30063014$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
    30073015as_fn_error 77 "C compiler cannot create executables 
    3008 See \`config.log' for more details" "$LINENO" 5 ; } 
     3016See \`config.log' for more details" "$LINENO" 5; } 
    30093017else 
    30103018  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 
     
    30493057$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
    30503058as_fn_error $? "cannot compute suffix of executables: cannot compile and link 
    3051 See \`config.log' for more details" "$LINENO" 5 ; } 
     3059See \`config.log' for more details" "$LINENO" 5; } 
    30523060fi 
    30533061rm -f conftest conftest$ac_cv_exeext 
     
    31083116as_fn_error $? "cannot run C compiled programs. 
    31093117If you meant to cross compile, use \`--host'. 
    3110 See \`config.log' for more details" "$LINENO" 5 ; } 
     3118See \`config.log' for more details" "$LINENO" 5; } 
    31113119    fi 
    31123120  fi 
     
    31603168$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
    31613169as_fn_error $? "cannot compute suffix of object files: cannot compile 
    3162 See \`config.log' for more details" "$LINENO" 5 ; } 
     3170See \`config.log' for more details" "$LINENO" 5; } 
    31633171fi 
    31643172rm -f conftest.$ac_cv_objext conftest.$ac_ext 
     
    45544562$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
    45554563as_fn_error $? "C preprocessor \"$CPP\" fails sanity check 
    4556 See \`config.log' for more details" "$LINENO" 5 ; } 
     4564See \`config.log' for more details" "$LINENO" 5; } 
    45574565fi 
    45584566 
     
    50445052   *) 
    50455053     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 ;; 
    50475055 esac 
    50485056 
     
    76177625$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
    76187626as_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 ; } 
     7627See \`config.log' for more details" "$LINENO" 5; } 
    76207628fi 
    76217629rm -f core conftest.err conftest.$ac_objext \ 
     
    76737681$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
    76747682as_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 ; } 
     7683See \`config.log' for more details" "$LINENO" 5; } 
    76767684            fi 
    76777685        else 
     
    76797687$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
    76807688as_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 ; } 
     7689See \`config.log' for more details" "$LINENO" 5; } 
    76827690        fi 
    76837691 
     
    76877695$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
    76887696as_fn_error $? "There's something wrong with this script, directory $IPPSAMP_DIR does not exist 
    7689 See \`config.log' for more details" "$LINENO" 5 ; } 
     7697See \`config.log' for more details" "$LINENO" 5; } 
    76907698            exit 1; 
    76917699        fi 
     
    77017709$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
    77027710as_fn_error $? "bug in this script: unsupported IPP version 
    7703 See \`config.log' for more details" "$LINENO" 5 ; } 
     7711See \`config.log' for more details" "$LINENO" 5; } 
    77047712        fi 
    77057713 
     
    77087716$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
    77097717as_fn_error $? "$IPPSAMP_LIBS doesn't exist in $IPPSAMP_DIR 
    7710 See \`config.log' for more details" "$LINENO" 5 ; } 
     7718See \`config.log' for more details" "$LINENO" 5; } 
    77117719        fi 
    77127720 
     
    77447752$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
    77457753as_fn_error $? "no 
    7746 See \`config.log' for more details" "$LINENO" 5 ; } 
     7754See \`config.log' for more details" "$LINENO" 5; } 
    77477755fi 
    77487756rm -f core conftest.err conftest.$ac_objext \ 
     
    77897797 
    77907798ac_ssl_has_aes_gcm=0 
    7791  
    7792 ac_ssl_has_ec=0 
    7793  
    7794 ac_ssl_has_sigalg=0 
    77957799 
    77967800# Check whether --enable-ssl was given. 
     
    79557959$as_echo "OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos" >&6; } 
    79567960                        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 
    80717961 
    80727962                        # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK 
     
    94009290    "third_party/build/os-auto.mak") CONFIG_FILES="$CONFIG_FILES third_party/build/os-auto.mak" ;; 
    94019291 
    9402   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; 
     9292  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 
    94039293  esac 
    94049294done 
     
    97179607  case $ac_mode$ac_tag in 
    97189608  :[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;; 
    97209610  :[FH]-) ac_tag=-:-;; 
    97219611  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; 
     
    97459635           *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; 
    97469636           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;; 
    97489638      esac 
    97499639      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac 
     
    97729662    case $ac_tag in 
    97739663    *:-:* | *:-) 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 ;; 
    97759665    esac 
    97769666    ;; 
  • pjproject/trunk/aconfigure.ac

    r5509 r5517  
    15341534AC_SUBST(ac_no_ssl) 
    15351535AC_SUBST(ac_ssl_has_aes_gcm,0) 
    1536 AC_SUBST(ac_ssl_has_ec,0) 
    1537 AC_SUBST(ac_ssl_has_sigalg,0) 
    15381536AC_ARG_ENABLE(ssl, 
    15391537              AS_HELP_STRING([--disable-ssl], 
     
    15701568                                AC_MSG_RESULT([OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos]) 
    15711569                        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                                  ]) 
    16091570 
    16101571                        # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK 
  • pjproject/trunk/pjlib/build/os-auto.mak.in

    r5483 r5517  
    3333export TARGETS      =   $(PJLIB_LIB) $(PJLIB_SONAME) 
    3434export TARGETS_EXE  =   $(TEST_EXE) 
    35  
    36 ifeq (@ac_ssl_has_ec@,1) 
    37 export PJLIB_CFLAGS += -DPJ_SSL_SOCK_OSSL_HAS_EC=1 
    38 endif 
    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

    r5501 r5517  
    5252#include <openssl/rand.h> 
    5353#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 
     60static 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 
     91static 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 
     103static 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 
    58111#endif 
    59112 
     
    386439        ssl->session = SSL_SESSION_new(); 
    387440 
    388 #if defined(PJ_SSL_SOCK_OSSL_HAS_EC) && PJ_SSL_SOCK_OSSL_HAS_EC==1 
     441#if !defined(OPENSSL_NO_EC) && OPENSSL_VERSION_NUMBER >= 0x1000200fL 
    389442        openssl_curves_num = SSL_get_shared_curve(ssl,-1); 
    390443        if (openssl_curves_num > PJ_ARRAY_SIZE(openssl_curves)) 
     
    403456            } 
    404457 
    405             openssl_curves[i].id   = tls1_ec_nid2curve_id(nid); 
     458            openssl_curves[i].id   = get_cid_from_nid(nid); 
    406459            openssl_curves[i].name = cname; 
    407460        } 
     
    10021055static pj_status_t set_curves_list(pj_ssl_sock_t *ssock) 
    10031056{ 
    1004 #if defined(PJ_SSL_SOCK_OSSL_HAS_EC) && PJ_SSL_SOCK_OSSL_HAS_EC==1 
     1057#if !defined(OPENSSL_NO_EC) && OPENSSL_VERSION_NUMBER >= 0x1000200fL 
    10051058    int ret; 
    10061059    int curves[PJ_SSL_SOCK_MAX_CURVES]; 
    1007     int cnt; 
     1060    unsigned cnt; 
    10081061 
    10091062    if (ssock->param.curves_num == 0) 
     
    10111064 
    10121065    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]); 
    10141067    } 
    10151068 
     
    10281081    PJ_UNUSED_ARG(ssock); 
    10291082#endif 
    1030  
    10311083    return PJ_SUCCESS; 
    10321084} 
     
    10341086static pj_status_t set_sigalgs(pj_ssl_sock_t *ssock) 
    10351087{ 
    1036 #if defined(PJ_SSL_SOCK_OSSL_HAS_SIGALG) && PJ_SSL_SOCK_OSSL_HAS_SIGALG==1 
     1088#if OPENSSL_VERSION_NUMBER >= 0x1000200fL 
    10371089    int ret; 
    10381090 
     
    10521104    PJ_UNUSED_ARG(ssock); 
    10531105#endif 
    1054  
    10551106    return PJ_SUCCESS; 
    10561107} 
Note: See TracChangeset for help on using the changeset viewer.