Skip to content

Commit 24ba63a

Browse files
authored
Merge pull request #3060 from purecloudlabs/hotfix/fix-qop-value-for-md5-hashing
uac_auth: fix qop-value for MD5 hashing
2 parents 3f60fda + eee7b96 commit 24ba63a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/uac_auth/auth.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ int do_uac_auth(str *msg_body, str *method, str *uri, struct uac_credential *crd
240240
const struct digest_auth_calc *digest_calc;
241241
str_const cnonce;
242242
str_const nc;
243+
str_const qop;
243244

244245
digest_calc = get_digest_calc(auth->algorithm);
245246
if (digest_calc == NULL) {
@@ -285,8 +286,13 @@ int do_uac_auth(str *msg_body, str *method, str *uri, struct uac_credential *crd
285286
!(auth->flags&QOP_AUTH), &ha2) != 0)
286287
return (-1);
287288

289+
if (auth->flags & QOP_AUTH) {
290+
qop = str_const_init(QOP_AUTH_STR);
291+
} else {
292+
qop = str_const_init(QOP_AUTHINT_STR);
293+
}
288294
if (digest_calc->response(&ha1, &ha2, str2const(&auth->nonce),
289-
str2const(&auth->qop), &nc, &cnonce, response) != 0)
295+
&qop, &nc, &cnonce, response) != 0)
290296
return (-1);
291297
auth_nc_cnonce->nc = nc;
292298
auth_nc_cnonce->cnonce = cnonce;

0 commit comments

Comments
 (0)