08-31-2012, 07:59 PM
(This post was last modified: 08-31-2012, 08:15 PM by quentusrex.)
This would be an awesome feature. Here is a sample hash:
Authorization: Digest username="ktxrk56yevb52dg4", realm="192.168.100.21", nonce="f9230a7f-77e0-426e-83c4-cf3ffd9315a7", qop=auth, cnonce="prNDNtHQotLf1Vp", nc=00000103, uri="sip:192.168.100.21:5065", response="3b1c269c6e13644538304b6a8e5626ff", algorithm=MD5, password="y7zwayvt94pu4jc8"
which would be:
str1 = MD5("ktxrk56yevb52dg4:192.168.100.21:y7zwayvt94pu4jc8")
str2 = MD5("REGISTERip:192.168.100.21:5065")
final = MD5("$str1:f9230a7f-77e0-426e-83c4-cf3ffd9315a7:$str2")
Actually there are two forms of digest auth for sip. One that includes cnonce and one that doesn't. See the description here:
http://en.wikipedia.org/wiki/Digest_acce...entication
It turns out my example is of the type that does use cnonce.
The perl script to compute the 'qop' version of the sip digest is as follows:
use Digest::MD5 qw(md5_hex);
my $str1 = "ktxrk56yevb52dg4:192.168.100.21:y7zwayvt94pu4jc8";
my $str2 = "REGISTERip:192.168.100.21:5065";
my $nonce = ":f9230a7f-77e0-426e-83c4-cf3ffd9315a7:00000103:prNDNtHQotLf1Vp:auth:";
print md5_hex(md5_hex($str1) . $nonce . md5_hex($str2)) . "\n";
Authorization: Digest username="ktxrk56yevb52dg4", realm="192.168.100.21", nonce="f9230a7f-77e0-426e-83c4-cf3ffd9315a7", qop=auth, cnonce="prNDNtHQotLf1Vp", nc=00000103, uri="sip:192.168.100.21:5065", response="3b1c269c6e13644538304b6a8e5626ff", algorithm=MD5, password="y7zwayvt94pu4jc8"
which would be:
str1 = MD5("ktxrk56yevb52dg4:192.168.100.21:y7zwayvt94pu4jc8")
str2 = MD5("REGISTERip:192.168.100.21:5065")
final = MD5("$str1:f9230a7f-77e0-426e-83c4-cf3ffd9315a7:$str2")
Actually there are two forms of digest auth for sip. One that includes cnonce and one that doesn't. See the description here:
http://en.wikipedia.org/wiki/Digest_acce...entication
It turns out my example is of the type that does use cnonce.
The perl script to compute the 'qop' version of the sip digest is as follows:
use Digest::MD5 qw(md5_hex);
my $str1 = "ktxrk56yevb52dg4:192.168.100.21:y7zwayvt94pu4jc8";
my $str2 = "REGISTERip:192.168.100.21:5065";
my $nonce = ":f9230a7f-77e0-426e-83c4-cf3ffd9315a7:00000103:prNDNtHQotLf1Vp:auth:";
print md5_hex(md5_hex($str1) . $nonce . md5_hex($str2)) . "\n";