]> 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:46 +0000 (20:32 +0000)
commit0c272429e60d825481300dc25e232d3d9bafc85a
tree6405cdb364da3c38c138b257161824d5a4442508
parent0bfbabee41fb7a0f00cfee767a040e3388e7af2d
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