Changeset 5781


Ignore:
Timestamp:
Apr 17, 2018 10:52:33 AM (13 months ago)
Author:
nanang
Message:

Re #2096:

  • Fixed DTLS-SRTP issues with AEAD_AES_256_GCM crypto, e.g: material buffer length too short, silly mistake of missing comma in PJSIP-OpenSSL crypto map.
  • Fixed SRTP error PJMEDIA_SRTP_ESDPREQCRYPTO when crypto count is set to zero and SRTP is in mandatory mode.
  • Fixed SRTP transport attach where stream RTP/RTCP reception callbacks may be overriden by DTLS-SRTP.
Location:
pjproject/trunk/pjmedia/src/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c

    r5773 r5781  
    682682    PJ_ASSERT_RETURN(endpt && tp && p_tp, PJ_EINVAL); 
    683683 
    684     /* Check crypto availability */ 
    685     if (opt && opt->crypto_count == 0 && 
    686         opt->use == PJMEDIA_SRTP_MANDATORY) 
    687         return PJMEDIA_SRTP_ESDPREQCRYPTO; 
    688  
    689684    /* Check crypto */ 
    690685    if (opt && opt->use != PJMEDIA_SRTP_DISABLED) { 
     
    740735     * i.e: all available crypto but 'NULL'. 
    741736     */ 
    742     if (srtp->setting.crypto_count == 0) { 
     737    if (srtp->setting.crypto_count == 0 && opt->use != PJMEDIA_SRTP_DISABLED) 
     738    { 
    743739        srtp->setting.crypto_count = PJMEDIA_SRTP_MAX_CRYPTOS; 
    744740        pjmedia_srtp_enum_crypto(&srtp->setting.crypto_count, 
     
    11151111    /* Save the callbacks */ 
    11161112    pj_lock_acquire(srtp->mutex); 
    1117     srtp->rtp_cb = param->rtp_cb; 
    1118     srtp->rtp_cb2 = param->rtp_cb2; 
    1119     srtp->rtcp_cb = param->rtcp_cb; 
    1120     srtp->user_data = param->user_data; 
     1113    if (param->rtp_cb || param->rtp_cb2) { 
     1114        /* Do not update rtp_cb if not set, as attach() is called by 
     1115         * keying method. 
     1116         */ 
     1117        srtp->rtp_cb = param->rtp_cb; 
     1118        srtp->rtp_cb2 = param->rtp_cb2; 
     1119        srtp->rtcp_cb = param->rtcp_cb; 
     1120        srtp->user_data = param->user_data; 
     1121    } 
    11211122    pj_lock_release(srtp->mutex); 
    11221123 
  • pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_dtls.c

    r5780 r5781  
    357357     "SRTP_AES128_CM_SHA1_80", 
    358358     "SRTP_AES128_CM_SHA1_32", 
    359      "SRTP_AEAD_AES_256_GCM" 
    360      "SRTP_AEAD_AES_128_GCM", 
     359     "SRTP_AEAD_AES_256_GCM", 
     360     "SRTP_AEAD_AES_128_GCM" 
    361361}; 
    362362static char* pj_profiles[] = 
     
    364364    "AES_CM_128_HMAC_SHA1_80", 
    365365    "AES_CM_128_HMAC_SHA1_32", 
    366     "AEAD_AES_256_GCM" 
    367     "AEAD_AES_128_GCM", 
     366    "AEAD_AES_256_GCM", 
     367    "AEAD_AES_128_GCM" 
    368368}; 
    369369 
     
    473473static pj_status_t ssl_get_srtp_material(dtls_srtp *ds) 
    474474{ 
    475     unsigned char material[SRTP_MAX_KEY_LEN]; 
     475    unsigned char material[SRTP_MAX_KEY_LEN * 2]; 
    476476    SRTP_PROTECTION_PROFILE *profile; 
    477477    int rc, i, crypto_idx = -1; 
Note: See TracChangeset for help on using the changeset viewer.