Compare commits

...

10 Commits

Author SHA1 Message Date
Tilghman Lesher
66b809dc76 Additional fixes for AST-2009-001
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.0.3.1@170643 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-23 19:54:36 +00:00
Tilghman Lesher
3d3122c6f0 Build tag for 1.6.0.3.1 release
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.0.3.1@170641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-23 19:46:52 +00:00
Tilghman Lesher
3f71325491 Add security fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.0.3@167315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-06 21:46:02 +00:00
Tilghman Lesher
0c37075208 Make tag for 1.6.0.3
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.0.3@167311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-06 21:41:13 +00:00
Tilghman Lesher
ec89e27387 Use autotagged externals
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.0.3-rc1@160486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 14:18:58 +00:00
Tilghman Lesher
5de6d0c8dc Importing files for 1.6.0.3-rc1 release
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.0.3-rc1@160485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 14:18:30 +00:00
Tilghman Lesher
d7c25fd040 Creating tag for the release of asterisk-1.6.0.3-rc1
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.0.3-rc1@160484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 14:16:48 +00:00
Tilghman Lesher
1424045dd2 Use autotagged externals
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.0.3-rc1@160396 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 23:32:57 +00:00
Tilghman Lesher
78bdc0dbc1 Importing files for 1.6.0.3-rc1 release
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.0.3-rc1@160395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 23:32:24 +00:00
Tilghman Lesher
bc2d9661fe Creating tag for the release of asterisk-1.6.0.3-rc1
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.6.0.3-rc1@160394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 23:30:08 +00:00
4 changed files with 48400 additions and 19 deletions

1
.lastclean Normal file
View File

@@ -0,0 +1 @@
36

1
.version Normal file
View File

@@ -0,0 +1 @@
1.6.0.3

48365
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -161,6 +161,7 @@ static int trunkmaxsize = MAX_TRUNKDATA;
static int authdebug = 1;
static int autokill = 0;
static int iaxcompat = 0;
static int last_authmethod = 0;
static int iaxdefaultdpcache=10 * 60; /* Cache dialplan entries for 10 minutes by default */
@@ -6253,6 +6254,10 @@ static int register_verify(int callno, struct sockaddr_in *sin, struct iax_ies *
p = find_peer(peer, 1);
ast_mutex_lock(&iaxsl[callno]);
if (!p || !iaxs[callno]) {
if (iaxs[callno]) {
/* Anything, as long as it's non-blank */
ast_string_field_set(iaxs[callno], secret, "badsecret");
}
if (authdebug && !p)
ast_log(LOG_NOTICE, "No registration for peer '%s' (from %s)\n", peer, ast_inet_ntoa(sin->sin_addr));
goto return_unref;
@@ -6332,21 +6337,24 @@ static int register_verify(int callno, struct sockaddr_in *sin, struct iax_ies *
goto return_unref;
} else
ast_set_flag(&iaxs[callno]->state, IAX_STATE_AUTHENTICATED);
} else if (!ast_strlen_zero(md5secret) || !ast_strlen_zero(secret)) {
if (authdebug)
ast_log(LOG_NOTICE, "Inappropriate authentication received\n");
} else if (!ast_strlen_zero(p->secret) || !ast_strlen_zero(p->inkeys)) {
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);
}
goto return_unref;
}
ast_devstate_changed(AST_DEVICE_UNKNOWN, "IAX2/%s", p->name); /* Activate notification */
return_unref:
ast_string_field_set(iaxs[callno], peer, peer);
/* Choose lowest expiry number */
if (expire && (expire < iaxs[callno]->expiry))
iaxs[callno]->expiry = expire;
ast_device_state_changed("IAX2/%s", p->name); /* Activate notification */
res = 0;
return_unref:
if (p)
peer_unref(p);
@@ -7077,24 +7085,30 @@ static int registry_authrequest(int callno)
struct iax2_peer *p;
char challenge[10];
const char *peer_name;
int res = -1;
int sentauthmethod;
peer_name = ast_strdupa(iaxs[callno]->peer);
/* SLD: third call to find_peer in registration */
ast_mutex_unlock(&iaxsl[callno]);
p = find_peer(peer_name, 1);
if ((p = find_peer(peer_name, 1))) {
last_authmethod = p->authmethods;
}
ast_mutex_lock(&iaxsl[callno]);
if (!iaxs[callno])
goto return_unref;
if (!p) {
ast_log(LOG_WARNING, "No such peer '%s'\n", peer_name);
goto return_unref;
}
memset(&ied, 0, sizeof(ied));
iax_ie_append_short(&ied, IAX_IE_AUTHMETHODS, p->authmethods);
if (p->authmethods & (IAX_AUTH_RSA | IAX_AUTH_MD5)) {
/* The selection of which delayed reject is sent may leak information,
* if it sets a static response. For example, if a host is known to only
* use MD5 authentication, then an RSA response would indicate that the
* peer does not exist, and vice-versa.
* Therefore, we use whatever the last peer used (which may vary over the
* course of a server, which should leak minimal information). */
sentauthmethod = p ? p->authmethods : last_authmethod ? last_authmethod : (IAX_AUTH_MD5 | IAX_AUTH_PLAINTEXT);
iax_ie_append_short(&ied, IAX_IE_AUTHMETHODS, sentauthmethod);
if (sentauthmethod & (IAX_AUTH_RSA | IAX_AUTH_MD5)) {
/* Build the challenge */
snprintf(challenge, sizeof(challenge), "%d", (int)ast_random());
ast_string_field_set(iaxs[callno], challenge, challenge);
@@ -7102,12 +7116,12 @@ static int registry_authrequest(int callno)
}
iax_ie_append_str(&ied, IAX_IE_USERNAME, peer_name);
res = 0;
return_unref:
peer_unref(p);
if (p) {
peer_unref(p);
}
return res ? res : send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_REGAUTH, 0, ied.buf, ied.pos, -1);;
return iaxs[callno] ? send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_REGAUTH, 0, ied.buf, ied.pos, -1) : -1;
}
static int registry_rerequest(struct iax_ies *ies, int callno, struct sockaddr_in *sin)