diff options
author | Terry Wilson <twilson@digium.com> | 2011-11-02 23:08:46 +0000 |
---|---|---|
committer | Terry Wilson <twilson@digium.com> | 2011-11-02 23:08:46 +0000 |
commit | 7f883ef495b57ae9182e47213d01d5e8009dbf3f (patch) | |
tree | fea1e82631edc075f9ca3e8ffb19561a37d3e18c /channels/chan_sip.c | |
parent | f7bdc835a423fb7e969f69983cd615b2c4ff5e0c (diff) |
Remove registertrying option in chan_sip
This option is not only useless, but has been broken since inception since
the flag was never copied from the peer where it is set to the pvt where
it was checked. RFC 3261 specificially states that you should not send a
provisional response to a non-INVITE request, and if we did fix the code
so that it worked, it would cause the same kind of user enumeration
vulnerability that we've discussed with the nat= setting. This patch
removes registertrying option and any code that would have sent a 100
response to a register.
Review: https://reviewboard.asterisk.org/r/1562/
........
Merged revisions 343220 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 343221 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 025a5a803..e7b678b9c 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -14759,8 +14759,6 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct ast_sock res = AUTH_PEER_NOT_DYNAMIC; } else { ast_copy_flags(&p->flags[0], &peer->flags[0], SIP_NAT_FORCE_RPORT); - if (ast_test_flag(&p->flags[1], SIP_PAGE2_REGISTERTRYING)) - transmit_response(p, "100 Trying", req); if (!(res = check_auth(p, req, peer->name, peer->secret, peer->md5secret, SIP_REGISTER, uri2, XMIT_UNRELIABLE, req->ignore))) { if (sip_cancel_destroy(p)) ast_log(LOG_WARNING, "Unable to cancel SIP destruction. Expect bad things.\n"); @@ -14841,14 +14839,6 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct ast_sock ao2_unlock(peer); } } - if (!peer && sip_cfg.alwaysauthreject) { - /* If we found a peer, we transmit a 100 Trying. Therefore, if we're - * trying to avoid leaking information, we MUST also transmit the same - * response when we DON'T find a peer. */ - transmit_response(p, "100 Trying", req); - /* Insert a fake delay between the 100 and the subsequent failure. */ - sched_yield(); - } if (!res) { sip_send_mwi_to_peer(peer, 0); ast_devstate_changed(AST_DEVICE_UNKNOWN, "SIP/%s", peer->name); @@ -17584,7 +17574,6 @@ static char *_sip_show_peer(int type, int fd, struct mansession *s, const struct ast_cli(fd, ")\n"); ast_cli(fd, " Auto-Framing : %s \n", AST_CLI_YESNO(peer->autoframing)); - ast_cli(fd, " 100 on REG : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[1], SIP_PAGE2_REGISTERTRYING))); ast_cli(fd, " Status : "); peer_status(peer, status, sizeof(status)); ast_cli(fd, "%s\n", status); @@ -27795,8 +27784,6 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str } } else if (!strcasecmp(v->name, "preferred_codec_only")) { ast_set2_flag(&peer->flags[1], ast_true(v->value), SIP_PAGE2_PREFERRED_CODEC); - } else if (!strcasecmp(v->name, "registertrying")) { - ast_set2_flag(&peer->flags[1], ast_true(v->value), SIP_PAGE2_REGISTERTRYING); } else if (!strcasecmp(v->name, "autoframing")) { peer->autoframing = ast_true(v->value); } else if (!strcasecmp(v->name, "rtptimeout")) { |