Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong qop escaping (v.3.5.0) #191

Closed
artlov opened this issue Feb 17, 2016 · 1 comment
Closed

Wrong qop escaping (v.3.5.0) #191

artlov opened this issue Feb 17, 2016 · 1 comment

Comments

@artlov
Copy link

artlov commented Feb 17, 2016

After upgrade to the version 3.5.0 registration broken with error code:
SIP/2.0 400 Bad header field: authorization
Reason is in the qop wrong escaping. Regarding RFC3261 Instead of qop="auth" it should be qop=auth:

An example of the Authorization header field is:
Authorization: Digest username="bob",
realm="biloxi.com",
nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",
uri="sip:[email protected]",
qop=auth,
nc=00000001,
cnonce="0a4f113b",
response="6629fae49393a05397450978507c4ef1",
opaque="5ccc069c403ebaf9f0171e9517f40e41"

Small patching helped me out:

diff -Nur a/src/auth.cpp b/src/auth.cpp
--- a/src/auth.cpp  2016-02-08 23:58:43.000000000 +0200
+++ b/src/auth.cpp  2016-02-17 12:42:51.000000000 +0200
@@ -372,7 +372,7 @@
     }

     if (cnonce[0] != '\0') {
-        snprintf(tmp, sizeof(tmp), ",cnonce=\"%s\",nc=%s,qop=\"%s\"", cnonce, nc, authtype);
+        snprintf(tmp, sizeof(tmp), ",cnonce=\"%s\",nc=%s,qop=%s", cnonce, nc, authtype);
         strcat(result, tmp);
     }
     snprintf(tmp, sizeof(tmp), ",uri=\"%s\"", sipuri);
@wdoekes
Copy link
Member

wdoekes commented Feb 18, 2016

Thank you for the bug report!

You are absolutely right, and I'm working on a fix.

lemenkov pushed a commit to lemenkov/sipp that referenced this issue Mar 2, 2020
Regression introduced when adding auth-int calculation in 3.5.0 (ff340b8).
Closes SIPp#191.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants