Changeset 5623


Ignore:
Timestamp:
Jul 7, 2017 2:52:44 AM (2 years ago)
Author:
nanang
Message:

Close #1999: Support OpenSSL 1.1.0 with backward compatibility setting turned of (no deprecated APIs).

Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c

    r5597 r5623  
    116116#  define M_ASN1_STRING_data(x)     ASN1_STRING_get0_data(x) 
    117117#  define M_ASN1_STRING_length(x)   ASN1_STRING_length(x) 
     118#  define X509_get_notBefore(x)     X509_get0_notBefore(x) 
     119#  define X509_get_notAfter(x)      X509_get0_notAfter(x) 
    118120#else 
    119121#  define SSL_CIPHER_get_id(c)      (c)->id 
     
    405407 
    406408    /* Init OpenSSL lib */ 
     409#if OPENSSL_VERSION_NUMBER < 0x10100000L 
    407410    SSL_library_init(); 
    408411    SSL_load_error_strings(); 
     412#else 
     413    OPENSSL_init_ssl(0, NULL); 
     414#endif 
    409415#if OPENSSL_VERSION_NUMBER < 0x009080ffL 
    410416    /* This is now synonym of SSL_library_init() */ 
     
    422428        const char *cname; 
    423429 
     430#if OPENSSL_VERSION_NUMBER < 0x10100000L 
    424431        meth = (SSL_METHOD*)SSLv23_server_method(); 
    425432        if (!meth) 
     
    433440            meth = (SSL_METHOD*)SSLv2_server_method(); 
    434441#endif 
     442 
     443#else 
     444        /* Specific version methods are deprecated in 1.1.0 */ 
     445        meth = (SSL_METHOD*)TLS_method(); 
     446#endif 
     447 
    435448        pj_assert(meth); 
    436449 
     
    650663 
    651664    /* Determine SSL method to use */ 
     665#if OPENSSL_VERSION_NUMBER < 0x10100000L 
    652666    switch (ssock->param.proto) { 
    653667    case PJ_SSL_SOCK_PROTO_TLS1: 
     
    665679        break; 
    666680    } 
     681#else 
     682    /* Specific version methods are deprecated in 1.1.0 */ 
     683    ssl_method = (SSL_METHOD*)TLS_method(); 
     684#endif 
    667685 
    668686    if (!ssl_method) { 
  • pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_dtls.c

    r5621 r5623  
    2828 * Include OpenSSL headers 
    2929 */ 
     30#include <openssl/bn.h> 
     31#include <openssl/err.h> 
     32#include <openssl/rsa.h> 
    3033#include <openssl/ssl.h> 
    31 #include <openssl/err.h> 
    32  
     34 
     35#if OPENSSL_VERSION_NUMBER >= 0x10100000L 
     36#  define X509_get_notBefore(x)     X509_getm_notBefore(x) 
     37#  define X509_get_notAfter(x)      X509_getm_notAfter(x) 
     38#endif 
    3339 
    3440/* Set to 1 to enable DTLS-SRTP debugging */ 
     
    370376         
    371377    /* Create DTLS context */ 
    372     ctx = SSL_CTX_new(DTLSv1_method()); 
     378    ctx = SSL_CTX_new(DTLS_method()); 
    373379    if (ctx == NULL) { 
    374380        return GET_SSL_STATUS(ds); 
     
    10321038{ 
    10331039    dtls_srtp *ds = (dtls_srtp *)tp; 
    1034     pjmedia_sdp_media *m_rem, *m_loc; 
     1040    pjmedia_sdp_media *m_loc; 
    10351041    pjmedia_sdp_attr *a; 
    10361042    pj_bool_t use_ice = PJ_FALSE; 
     
    10431049    PJ_UNUSED_ARG(sdp_pool); 
    10441050 
    1045     m_rem = sdp_remote ? sdp_remote->media[media_index] : NULL; 
    10461051    m_loc = sdp_local->media[media_index]; 
    10471052    if (ds->srtp->offerer_side) { 
     
    11861191{ 
    11871192    dtls_srtp *ds = (dtls_srtp *)tp; 
    1188     pjmedia_sdp_media *m_rem, *m_loc; 
    11891193    pj_ice_strans_state ice_state; 
    11901194    pj_status_t status = PJ_SUCCESS; 
     
    11951199 
    11961200    PJ_UNUSED_ARG(tmp_pool); 
    1197  
    1198     m_rem = sdp_remote->media[media_index]; 
    1199     m_loc = sdp_local->media[media_index]; 
     1201    PJ_UNUSED_ARG(sdp_local); 
    12001202 
    12011203    if (ds->srtp->offerer_side) { 
Note: See TracChangeset for help on using the changeset viewer.