[OpenSIPS-Devel] Patch: BNF-compliant {s.escape.param} and {s.escape.user}

Rick van Rein rick at openfortress.nl
Mon Sep 17 13:01:41 CEST 2012


Hello,

When packing a SIP URI into a parameter, I noticed that the contained
@ was not escaped by {s.escape.param}.  Chasing this to strcommon.c I
found that it deviates from the -unreserved specifications in the BNF
of RFC 3261.  Attached is a patch relative to 1.8.0 that corrects the
user and parameter escapes to the RFC-prescribed BNF-based escapes.

Note well:
 - The & in parameters was escaped, which this patch removes.
 - The / in user parts was escaped, which this patch removes.
If these were added for pragmatic reasons (dealing with devices that
do not adhere to the RFC) then please overrule that part of my patch!

Other than this, changes to become RFC3621-compliant are:
 - Additional parameter escaping for # % < > @ \ ^ ` { | }
 - Additional user part escaping was not needed


I hope this is useful.  Just consider it a thank you for all the
wonderful work that the OpenSIPS developers are doing.


Best wishes,

Rick van Rein
OpenFortress
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opensips-1.8.0-escape.patch
Type: text/x-diff
Size: 1202 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/devel/attachments/20120917/c0eef2dd/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 274 bytes
Desc: Digital signature
URL: <http://lists.opensips.org/pipermail/devel/attachments/20120917/c0eef2dd/attachment.pgp>


More information about the Devel mailing list