Skip to content

Commit

Permalink
Relax qop validation: according to the RFC8760 if the qop
Browse files Browse the repository at this point in the history
is not provided, the qop=auth should be assumed.

Issue:	#2995
(cherry picked from commit 6f8af86)
  • Loading branch information
sobomax authored and liviuchircu committed Jan 27, 2023
1 parent 11dc11e commit 7261057
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/auth/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ auth_result_t pre_auth(struct sip_msg* _m, str* _realm, hdr_types_t _hftype,
goto stalenonce;
}
qop_type_t qop = dcp->qop.qop_parsed;
if (qop == QOP_UNSPEC_D) {
/*
* RFC8760: If the "qop" parameter is not specified, then
* the default value is "auth".
*/
qop = QOP_AUTH_D;
}

if ((np.qop != qop) &&
(np.qop != QOP_TYPE_BOTH || (qop != QOP_AUTH_D && qop != QOP_AUTHINT_D))) {
LM_DBG("nonce does not match qop\n");
Expand Down

0 comments on commit 7261057

Please sign in to comment.