sip / digest calculation

sip / digest calculation

  • Written by
    Walter Doekes
  • Published on

Every one in a while, I see an unexpected 403 response to a SIP client’s REGISTER request. Thusfar the digest response calculation has never been wrong, but it feels good to get that check out of the way and move on to other possible causes.

For your enjoyment and mine, a Bourne-shell compatible shell script that calculates (qop-less) Digest authentication responses.

Download: (view)

$ hahacalc
Or: METHOD < autorization_headers
Example: 123456789 REGISTER \
           4f7406a80000c2f214774a48d11cc5b 9e533caff7a05904c MYPASSWORD \
Or:      echo 'Authorization:...' | REGISTER
$ hahacalc 123456789 REGISTER 4f7406a80000c2f214774a48d11cc5b9e533caff7a05904c MYPASSWORD f5787ba2624dfdbcf874f46425d65b53
A1   =
HA1  = 7f3c958e155df4070204c2aa5293437f
A2   =
HA2  = 2d13f8e4f7343dbd44be6ddabf8c2c1d
RESP = f5787ba2624dfdbcf874f46425d65b53

Update 2013-06-19

Updated hahacalc to be able to parse Authorization: headers too. In that mode of operation, you pass only METHOD as argument, you enter the password on the console, and you input the SIP body through stdin.

Back to overview Newer post: safe_asterisk / init.d Older post: python virtualenv / global site-packages