diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-03-12 11:25:11 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-03-12 11:25:11 +0000 |
commit | ba9d8ca28eb209571c0bd6a080a8bb03d0fa2d33 (patch) | |
tree | 6f32a52e5bb80196bdffa66de1292ea5bda050c4 /tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py | |
parent | 42ee8666dff7f9689ea1ff50409d5170a8417838 (diff) |
Initial fixes for ticket #747: bugs in parsing SIP torture messages (RFC 4475):
- SIP version components may be separated by whitespaces (e.g. "SIP / 2.0")
- parsing of mangled header when for unknown/generic header
- Via parameters were parsed with paramchar rather than token
- handling NULL character inside quoted string
Some torture messages have been added in the Python test.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2505 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py')
-rw-r--r-- | tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py b/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py new file mode 100644 index 00000000..88fd249b --- /dev/null +++ b/tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_2.py @@ -0,0 +1,25 @@ +# $Id$ +import inc_sip as sip +import inc_sdp as sdp + +# Torture message from RFC 4475 +# 3.1.1. Valid Messages +# 3.1.1.2. Wide Range of Valid Characters +complete_msg = \ +"""!interesting-Method0123456789_*+`.%indeed'~ sip:1_unusual.URI~(to-be!sure)&isn't+it$/crazy?,/;;*:&it+has=1,weird!*pas$wo~d_too.(doesn't-it)@example.com SIP/2.0 +Via: SIP/2.0/UDP host1.example.com;rport;branch=z9hG4bK-.!%66*_+`'~ +To: "BEL:\\\x07 NUL:\\\x00 DEL:\\\x7F" <sip:1_unusual.URI~(to-be!sure)&isn't+it$/crazy?,/;;*@example.com> +From: token1~` token2'+_ token3*%!.- <sip:mundane@example.com> ;fromParam''~+*_!.-%="\xD1\x80\xD0\xB0\xD0\xB1\xD0\xBE\xD1\x82\xD0\xB0\xD1\x8E\xD1\x89\xD0\xB8\xD0\xB9";tag=_token~1'+`*%!-. +Call-ID: intmeth.word%ZK-!.*_+'@word`~)(><:\\/"][?}{ +CSeq: 139122385 !interesting-Method0123456789_*+`.%indeed'~ +Max-Forwards: 255 +extensionHeader-!.%*+_`'~: \xEF\xBB\xBF\xE5\xA4\xA7\xE5\x81\x9C\xE9\x9B\xBB +Content-Length: 0 + +""" + + +sendto_cfg = sip.SendtoCfg( "RFC 4475 3.1.1.2", + "--null-audio --auto-answer 200", + "", 405, complete_msg=complete_msg) + |