[asterisk-dev] [Code Review]: Corrected crypto tag in SDP ANSWER for SRTP. (again)

David Lee reviewboard at asterisk.org
Mon Jan 28 11:36:37 CST 2013



> On Jan. 28, 2013, 11:25 a.m., Matt Jordan wrote:
> > /branches/1.8/channels/sip/sdp_crypto.c, line 51
> > <https://reviewboard.asterisk.org/r/2295/diff/1/?file=33115#file33115line51>
> >
> >     Since the tag is miniscule (or should be), we could probably make this a char[] of fixed size, similar to everything else in here.
> >     
> >     Alternatively, we *could* just make the whole thing string fields.

The other fields have well-defined max lengths, based on the protocol. Since 'should be minuscule' doesn't always translate to 'is minuscule', I'm just going to leave this as-is.


> On Jan. 28, 2013, 11:25 a.m., Matt Jordan wrote:
> > /branches/1.8/channels/sip/sdp_crypto.c, lines 283-285
> > <https://reviewboard.asterisk.org/r/2295/diff/1/?file=33115#file33115line283>
> >
> >     We probably don't need to free p->tag if its already NULL, which you're guaranteed since we create p in this function.

Ha! Good point. will fix.


> On Jan. 28, 2013, 11:25 a.m., Matt Jordan wrote:
> > /branches/1.8/channels/sip/sdp_crypto.c, lines 290-292
> > <https://reviewboard.asterisk.org/r/2295/diff/1/?file=33115#file33115line290>
> >
> >     I am a little concerned about removing this. Prior to this code change, you were guaranteed that p had the crypto attribute constructed when it came out of this method; now you're guaranteed that it has the pieces and parts to do so.
> >     
> >     This may be okay, but we might want to do another look over to verify.

I think it's okay, but for completeness I can call sdp_crypto_offer() on return here.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2295/#review7750
-----------------------------------------------------------


On Jan. 28, 2013, 9:48 a.m., David Lee wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2295/
> -----------------------------------------------------------
> 
> (Updated Jan. 28, 2013, 9:48 a.m.)
> 
> 
> Review request for Asterisk Developers and Matt Jordan.
> 
> 
> Summary
> -------
> 
> The original fix (r380043) for getting Asterisk to respond with the correct
> tag overlooked some corner cases, and the fact that the same code is in 1.8.
> 
> This patch moves the building of the crypto line out of
> sdp_crypto_process(). Instead, it merely copies the accepted tag. The call to
> sdp_crypto_offer() will build the crypto line in all cases now, using a tag of
> "1" in the case of sending offers.
> 
> 
> This addresses bug ASTERISK-20849.
>     https://issues.asterisk.org/jira/browse/ASTERISK-20849
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/channels/sip/sdp_crypto.c 380244 
> 
> Diff: https://reviewboard.asterisk.org/r/2295/diff
> 
> 
> Testing
> -------
> 
> Mades some calls using SRTP using a snom 820.
> 
> 
> Thanks,
> 
> David
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130128/fe4b8c8b/attachment-0001.htm>


More information about the asterisk-dev mailing list