diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-09-25 19:13:54 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-09-25 19:13:54 +0000 |
commit | e401b86474d31652cdac8903f16b9d4539215e02 (patch) | |
tree | eb3a0c9f453de73681a5787c4e61c15b2a60fc12 /channels/chan_iax2.c | |
parent | f60b31e0ec2db9cd52002e2d4b8710d6191e2ee2 (diff) |
Handle authenticating *to* realtime peers (bug #5269)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6648 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rwxr-xr-x | channels/chan_iax2.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index b540c4f86..fd02cb749 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); |