From: Mark Spencer Date: Sun, 25 Sep 2005 19:13:54 +0000 (+0000) Subject: Handle authenticating *to* realtime peers (bug #5269) X-Git-Tag: 1.2.0-beta2~271 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=da7c542e2946c03d79aed228170e2c99025984d1;p=thirdparty%2Fasterisk.git Handle authenticating *to* realtime peers (bug #5269) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6648 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index b540c4f868..fd02cb7498 100755 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -5166,6 +5166,15 @@ static int authenticate_reply(struct chan_iax2_pvt *p, struct sockaddr_in *sin, peer = peer->next; } ast_mutex_unlock(&peerl.lock); + if (!peer) { + /* We checked our list and didn't find one. It's unlikely, but possible, + that we're trying to authenticate *to* a realtime peer */ + if ((peer = realtime_peer(p->peer))) { + res = authenticate(p->challenge, peer->secret,peer->outkey, authmethods, &ied, sin, &p->ecx, &p->dcx); + if (ast_test_flag(peer, IAX_TEMPONLY)) + destroy_peer(peer); + } + } } if (ies->encmethods) ast_set_flag(p, IAX_ENCRYPTED | IAX_KEYPOPULATED);