]> 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)
committerGeorge Joseph <gjoseph@sangoma.com>
Fri, 17 Jan 2025 20:32:49 +0000 (20:32 +0000)
commitfb533fcc73aa045063d2bf29940dcb6308a25946
tree936b5e9e70352887275a41d54484a18ffdb1873b
parenteca4ec6b5ea29a7ab9a67fb21fbe0b93b214c9f1
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.
res/res_pjsip_authenticator_digest.c