- Timestamp:
- May 18, 2018 7:12:41 AM (7 years ago)
- Location:
- pjproject/trunk/pjmedia/src/pjmedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c
r5790 r5794 1270 1270 PJ_ASSERT_RETURN(tp, PJ_EINVAL); 1271 1271 1272 /* Close keying */ 1273 for (i=0; i < srtp->keying_cnt; i++) 1274 pjmedia_transport_close(srtp->keying[i]); 1272 /* Close all keying. Note that any keying should not be destroyed before 1273 * SRTP transport is destroyed as re-INVITE may initiate new keying method 1274 * without destroying SRTP transport. 1275 */ 1276 for (i=0; i < srtp->all_keying_cnt; i++) 1277 pjmedia_transport_close(srtp->all_keying[i]); 1275 1278 1276 1279 /* Close member if configured */ … … 1612 1615 !srtp_crypto_empty(&srtp->rx_policy_neg)) 1613 1616 { 1614 /* SRTP nego is done, let's destroy any other keying. */ 1615 unsigned j; 1616 for (j = 0; j < srtp->keying_cnt; ++j) { 1617 if (j != i) 1618 pjmedia_transport_close(srtp->keying[j]); 1619 } 1617 /* SRTP nego is done */ 1620 1618 srtp->keying_cnt = 1; 1621 1619 srtp->keying[0] = srtp->keying[i]; … … 1683 1681 !srtp_crypto_empty(&srtp->rx_policy_neg)) 1684 1682 { 1685 /* SRTP nego is done, let's destroy any other keying. */ 1686 unsigned j; 1687 for (j = 0; j < srtp->keying_cnt; ++j) { 1688 if (j != i) 1689 pjmedia_transport_close(srtp->keying[j]); 1690 } 1683 /* SRTP nego is done */ 1691 1684 srtp->keying_cnt = 1; 1692 1685 srtp->keying[0] = srtp->keying[i]; -
pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_dtls.c
r5788 r5794 1062 1062 switch (ds->srtp->setting.use) { 1063 1063 case PJMEDIA_SRTP_DISABLED: 1064 if (attr_setup) 1065 return PJMEDIA_SRTP_ESDPINTRANSPORT; 1064 if (attr_setup) { 1065 status = PJMEDIA_SRTP_ESDPINTRANSPORT; 1066 goto on_return; 1067 } 1066 1068 break; 1067 1069 case PJMEDIA_SRTP_OPTIONAL: 1068 1070 break; 1069 1071 case PJMEDIA_SRTP_MANDATORY: 1070 if (!attr_setup) 1071 return PJMEDIA_SRTP_ESDPINTRANSPORT; 1072 if (!attr_setup) { 1073 status = PJMEDIA_SRTP_ESDPINTRANSPORT; 1074 goto on_return; 1075 } 1072 1076 break; 1073 1077 } … … 1078 1082 1079 1083 on_return: 1084 #if DTLS_DEBUG 1080 1085 if (status != PJ_SUCCESS) { 1081 1086 pj_perror(4, ds->base.name, status, "dtls_media_create() failed"); 1082 dtls_destroy(tp); 1083 } 1087 } 1088 #endif 1084 1089 return status; 1085 1090 } … … 1256 1261 1257 1262 on_return: 1263 #if DTLS_DEBUG 1258 1264 if (status != PJ_SUCCESS) { 1259 1265 pj_perror(4, ds->base.name, status, "dtls_encode_sdp() failed"); 1260 dtls_destroy(tp); 1261 } 1266 } 1267 #endif 1262 1268 return status; 1263 1269 } … … 1393 1399 1394 1400 on_return: 1401 #if DTLS_DEBUG 1395 1402 if (status != PJ_SUCCESS) { 1396 1403 pj_perror(4, ds->base.name, status, "dtls_media_start() failed"); 1397 dtls_destroy(tp); 1398 } 1404 } 1405 #endif 1399 1406 return status; 1400 1407 }
Note: See TracChangeset
for help on using the changeset viewer.