From 7be62f9931c869a79d9ba4fc5d46f5f3a423e2b5 Mon Sep 17 00:00:00 2001 From: "David M. Lee" Date: Thu, 24 Jan 2013 16:39:33 +0000 Subject: [PATCH] Corrected crypto tag in SDP ANSWER for SRTP. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When Asterisk responds with an SDP ANSWER for SRTP, it had the code to correctly fill in the crypto data, which was overwritten by a call to sdp_crypto_offer. Corrected the situation by changing sdp_crypto_offer to not replacing crypto data if it already exists. (closes issue ASTERISK-20849) Reported by: José Luis Millán Tested by: Iñaki Baz Castillo Patches: fix_sdp_crypto_tags.diff uploaded by Pedro Kiefer (license 6407) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@380043 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/sip/sdp_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/sip/sdp_crypto.c b/channels/sip/sdp_crypto.c index 85ddfe2f49..ba21316d9f 100644 --- a/channels/sip/sdp_crypto.c +++ b/channels/sip/sdp_crypto.c @@ -291,7 +291,7 @@ int sdp_crypto_offer(struct sdp_crypto *p, int taglen) char crypto_buf[128]; if (p->a_crypto) { - ast_free(p->a_crypto); + return 0; } if (snprintf(crypto_buf, sizeof(crypto_buf), "a=crypto:1 AES_CM_128_HMAC_SHA1_%i inline:%s\r\n", -- 2.47.2