aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-23 19:19:06 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-23 19:19:06 +0000
commit91e89a27ce4c09efa2abbc86679eb8a33166b934 (patch)
tree8f186b73fd9b9d34f9fe4fad1bc330c544472c8c
parentd1605d9ca0629b8fc11916dcd062e1425187bccc (diff)
Updates to AST-2009-001
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@170580 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_iax2.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index a46cec0f5..c7fe21d8c 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -5482,8 +5482,11 @@ static int register_verify(int callno, struct sockaddr_in *sin, struct iax_ies *
return -1;
}
} else if (!ast_strlen_zero(p->secret) || !ast_strlen_zero(p->inkeys)) {
- if (authdebug)
+ if (authdebug &&
+ ((!ast_strlen_zero(p->secret) && (p->authmethods & IAX_AUTH_MD5) && !ast_strlen_zero(iaxs[callno]->challenge)) ||
+ (!ast_strlen_zero(p->inkeys) && (p->authmethods & IAX_AUTH_RSA) && !ast_strlen_zero(iaxs[callno]->challenge)))) {
ast_log(LOG_NOTICE, "Inappropriate authentication received for '%s'\n", p->name);
+ }
if (ast_test_flag(p, IAX_TEMPONLY))
destroy_peer(p);
return -1;
@@ -6092,7 +6095,7 @@ static int registry_authrequest(char *name, int callno)
struct iax2_peer *p;
int authmethods;
- if (!iaxs[callno]) {
+ if (!callno || !iaxs[callno]) {
return 0;
}
@@ -6110,7 +6113,7 @@ static int registry_authrequest(char *name, int callno)
}
memset(&ied, 0, sizeof(ied));
- iax_ie_append_short(&ied, IAX_IE_AUTHMETHODS, p->authmethods);
+ iax_ie_append_short(&ied, IAX_IE_AUTHMETHODS, authmethods);
if (authmethods & (IAX_AUTH_RSA | IAX_AUTH_MD5)) {
/* Build the challenge */
snprintf(iaxs[callno]->challenge, sizeof(iaxs[callno]->challenge), "%d", rand());