From: Terry Wilson Date: Fri, 6 Jan 2012 23:17:24 +0000 (+0000) Subject: Don't leak CID in From header when presentation=unavailable X-Git-Tag: 1.8.10.0-rc1~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96770386a7d39225fcf0f45af5879bb7439bb474;p=thirdparty%2Fasterisk.git Don't leak CID in From header when presentation=unavailable When someone does Set(CALLERPRES()=unavailable) (or Set(CALLERID(pres)=unavailable)) when sendrpid=no, the From header shows "Anonymous" . When sendrpid=yes/pai, the From header will still display the callerid info, even though we supply an rpid header with the anonymous info. It seems like we shouldn't leak that info in any case. Skimming http://tools.ietf.org/html/draft-ietf-sip-privacy-04 seems to indicate that one shouldn't send identifying info in the From in this case. This patch anonymizes the From header as well even when sendrpid=yes/pai. (closes issue ASTERISK-16538) Review: https://reviewboard.asterisk.org/r/1649/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@349968 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index c424d2eecc..162db37cb1 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -11818,8 +11818,9 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho if ((ast_party_id_presentation(&p->owner->connected.id) & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED) { l = p->owner->connected.id.number.valid ? p->owner->connected.id.number.str : NULL; n = p->owner->connected.id.name.valid ? p->owner->connected.id.name.str : NULL; - } else if (!ast_test_flag(&p->flags[0], SIP_SENDRPID)) { - /* if we are not sending RPID and user wants his callerid restricted */ + } else { + /* Even if we are using RPID, we shouldn't leak information in the From if the user wants + * their callerid restricted */ l = CALLERID_UNKNOWN; n = l; d = FROMDOMAIN_INVALID;