Ignore:
Timestamp:
Apr 17, 2018 10:52:33 AM (15 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.
File:
1 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 
Note: See TracChangeset for help on using the changeset viewer.