]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_authenticator_digest: Fix issue with missing auth and DONT_OPTIMIZE
authorGeorge Joseph <gjoseph@sangoma.com>
Fri, 17 Jan 2025 16:20:16 +0000 (09:20 -0700)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 23 Jan 2025 18:42:29 +0000 (18:42 +0000)
commit791d8fbbc065294635f0e7ac9f838ec0eb6101fc
treefd50f5cf717cd990542104d9ddb53e10137f09bd
parent9ffdda5936e07fd9697337a485b75d252192171e
res_pjsip_authenticator_digest: Fix issue with missing auth and DONT_OPTIMIZE

The return code fom digest_check_auth wasn't explicitly being initialized.
The return code also wasn't explicitly set to CHALLENGE when challenges
were sent.  When optimization was turned off (DONT_OPTIMIZE), the compiler
was setting it to "0"(CHALLENGE) which worked fine.  However, with
optimization turned on, it was setting it to "1" (SUCCESS) so if there was
no incoming Authorization header, the function was returning SUCCESS to the
distributor allowing the request to incorrectly succeed.

The return code is now initialized correctly and is now explicitly set
to CHALLENGE when we send challenges.

(cherry picked from commit fb533fcc73aa045063d2bf29940dcb6308a25946)
res/res_pjsip_authenticator_digest.c