Ignore:
Timestamp:
Nov 16, 2016 5:53:23 AM (8 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/pjlib/src/pj/ssl_sock_ossl.c

    r5472 r5483  
    5353#include <openssl/engine.h> 
    5454 
    55 #if !defined(OPENSSL_NO_EC) 
     55#if defined(PJ_SSL_SOCK_OSSL_HAS_EC) && PJ_SSL_SOCK_OSSL_HAS_EC==1 
    5656   extern int tls1_ec_nid2curve_id(int nid); 
    5757   extern int tls1_ec_curve_id2nid(int curve_id); 
     
    386386        ssl->session = SSL_SESSION_new(); 
    387387 
    388 #if !defined(OPENSSL_NO_EC) 
     388#if defined(PJ_SSL_SOCK_OSSL_HAS_EC) && PJ_SSL_SOCK_OSSL_HAS_EC==1 
    389389        openssl_curves_num = SSL_get_shared_curve(ssl,-1); 
    390390        if (openssl_curves_num > PJ_ARRAY_SIZE(openssl_curves)) 
     
    10001000static pj_status_t set_curves_list(pj_ssl_sock_t *ssock) 
    10011001{ 
    1002 #if !defined(OPENSSL_NO_EC) 
     1002#if defined(PJ_SSL_SOCK_OSSL_HAS_EC) && PJ_SSL_SOCK_OSSL_HAS_EC==1 
    10031003    int ret; 
    10041004    int curves[PJ_SSL_SOCK_MAX_CURVES]; 
     
    10231023            return GET_SSL_STATUS(ssock); 
    10241024    } 
     1025#endif 
    10251026 
    10261027    return PJ_SUCCESS; 
    1027 #else 
    1028     return PJ_ENOTSUP; 
    1029 #endif 
    10301028} 
    10311029 
    10321030static pj_status_t set_sigalgs(pj_ssl_sock_t *ssock) 
    10331031{ 
     1032#if defined(PJ_SSL_SOCK_OSSL_HAS_SIGALG) && PJ_SSL_SOCK_OSSL_HAS_SIGALG==1 
    10341033    int ret; 
    10351034 
     
    10461045            return GET_SSL_STATUS(ssock); 
    10471046    } 
     1047#endif 
    10481048 
    10491049    return PJ_SUCCESS; 
     
    23942394 
    23952395    for (i = 0; i < *curve_num; ++i) 
    2396     curves[i] = openssl_curves[i].id; 
     2396        curves[i] = openssl_curves[i].id; 
    23972397 
    23982398    return PJ_SUCCESS; 
Note: See TracChangeset for help on using the changeset viewer.