Module: kamailio
Branch: master
Commit: 6e6a2f442e06a23aa180f07c2a954068dfc58843
URL:
https://github.com/kamailio/kamailio/commit/6e6a2f442e06a23aa180f07c2a95406…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-10-26T09:21:57+02:00
uac: test if qop field has a list of values for remote auth challenge
- GH #1684
---
Modified: src/modules/uac/auth_alg.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6e6a2f442e06a23aa180f07c2a95406…
Patch:
https://github.com/kamailio/kamailio/commit/6e6a2f442e06a23aa180f07c2a95406…
---
diff --git a/src/modules/uac/auth_alg.c b/src/modules/uac/auth_alg.c
index 9d236e9d20..0425561fe2 100644
--- a/src/modules/uac/auth_alg.c
+++ b/src/modules/uac/auth_alg.c
@@ -135,6 +135,7 @@ void uac_calc_response( HASHHEX ha1, HASHHEX ha2,
{
MD5_CTX Md5Ctx;
HASH RespHash;
+ char *p;
MD5Init(&Md5Ctx);
MD5Update(&Md5Ctx, ha1, HASHHEXLEN);
@@ -148,7 +149,12 @@ void uac_calc_response( HASHHEX ha1, HASHHEX ha2,
MD5Update(&Md5Ctx, ":", 1);
MD5Update(&Md5Ctx, cnonce->s, cnonce->len);
MD5Update(&Md5Ctx, ":", 1);
- MD5Update(&Md5Ctx, auth->qop.s, auth->qop.len);
+ p = memchr(auth->qop.s, ',', auth->qop.len);
+ if(p) {
+ MD5Update(&Md5Ctx, auth->qop.s, (size_t)(p - auth->qop.s));
+ } else {
+ MD5Update(&Md5Ctx, auth->qop.s, auth->qop.len);
+ }
MD5Update(&Md5Ctx, ":", 1);
};
MD5Update(&Md5Ctx, ha2, HASHHEXLEN);