]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_authenticator_digest: Don't use source port in nonce verification 72/2772/2
authorKevin Harwell <kharwell@digium.com>
Thu, 5 May 2016 16:37:37 +0000 (11:37 -0500)
committerKevin Harwell <kharwell@digium.com>
Mon, 9 May 2016 19:17:32 +0000 (14:17 -0500)
commit4fc2c98369b0f4ffa3931d08cd91681caf548eed
treeafb8cbe9f52d4ccc7d6ca0facc01d09f578817c4
parent4e7791d4835030890cc4e6335a8c89eb67e3cf5d
res_pjsip_authenticator_digest: Don't use source port in nonce verification

From the issue reporter:
"res_pjsip_outbound_authenticator_digest builds a nonce that is a hash of
the timestamp, the source address, the source port, a server UUID that is
calculated at startup, and the authentication realm.

Rather than caching nonces that we create, we instead attempt to re-calculate
the nonce when receiving an incoming request with authentication. We then
compare the re-calculated nonce to the incoming nonce, and if they don't match,
then authentication has failed early.

The problem is that it is possible, especially when using TCP, to receive two
requests from the same endpoint but have differing source ports for those
requests. Asterisk itself commonly will use different source ports for
outbound TCP requests."

This patch removes the source port dependency when building the nonce.

ASTERISK-25978 #close

Change-Id: I871b5f4adce102df1c4988066283095ec509dffe
res/res_pjsip_authenticator_digest.c