diff options
author | Mark Spencer <markster@digium.com> | 2004-07-22 23:16:40 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2004-07-22 23:16:40 +0000 |
commit | 7ab67c9fba003b55c15115fe71934e4e436015e2 (patch) | |
tree | 78519f2bde424188a027d8ab50a9fe619efbf8d4 /channels | |
parent | 0afbb8bcbfc95e975b597024b852189ade25dfde (diff) |
Remove quotes from MD5 (bug #2116)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_sip.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index db1ecce79..987538f53 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -6179,9 +6179,9 @@ static int build_reply_digest(struct sip_pvt *p, char* orig_header, char* digest md5_hash(resp_hash,resp); /* XXX We hard code our qop to "auth" for now. XXX */ if (!ast_strlen_zero(p->qop)) - snprintf(digest,digest_len,"Digest username=\"%s\", realm=\"%s\", algorithm=\"MD5\", uri=\"%s\", nonce=\"%s\", response=\"%s\", opaque=\"%s\", qop=\"%s\", cnonce=\"%s\", nc=%s",p->authname,p->realm,uri,p->nonce,resp_hash, p->opaque, "auth", cnonce, "00000001"); + snprintf(digest,digest_len,"Digest username=\"%s\", realm=\"%s\", algorithm=MD5, uri=\"%s\", nonce=\"%s\", response=\"%s\", opaque=\"%s\", qop=\"%s\", cnonce=\"%s\", nc=%s",p->authname,p->realm,uri,p->nonce,resp_hash, p->opaque, "auth", cnonce, "00000001"); else - snprintf(digest,digest_len,"Digest username=\"%s\", realm=\"%s\", algorithm=\"MD5\", uri=\"%s\", nonce=\"%s\", response=\"%s\", opaque=\"%s\"",p->authname,p->realm,uri,p->nonce,resp_hash, p->opaque); + snprintf(digest,digest_len,"Digest username=\"%s\", realm=\"%s\", algorithm=MD5, uri=\"%s\", nonce=\"%s\", response=\"%s\", opaque=\"%s\"",p->authname,p->realm,uri,p->nonce,resp_hash, p->opaque); return 0; } @@ -6864,12 +6864,13 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc if (strcasecmp(cmd, "SIP/2.0")) { /* Request coming in */ - if (p->icseq && (p->icseq < seqno)) { - ast_log(LOG_DEBUG, "Ignoring out of order packet %d (expecting %d)\n", seqno, p->icseq); + if (p->icseq && (p->icseq > seqno)) { + ast_log(LOG_DEBUG, "Ignoring too old packet packet %d (expecting >= %d)\n", seqno, p->icseq); return -1; - } else if (p->icseq && (p->icseq != seqno)) { + } else if (p->icseq && (p->icseq == seqno)) { /* ignore means "don't do anything with it" but still have to - respond appropriately */ + respond appropriately. We do this if we receive a repeat of + the last sequence number */ ignore=1; } if (ast_strlen_zero(p->theirtag)) { @@ -6901,8 +6902,10 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc } if (strcmp(cmd, "SIP/2.0") && (seqno >= p->icseq)) - /* Next should follow monotonically increasing */ - p->icseq = seqno + 1; + /* Next should follow monotonically (but not necessarily + incrementally -- thanks again to the genius authors of SIP -- + increasing */ + p->icseq = seqno; /* Initialize the context if it hasn't been already */ if (!strcasecmp(cmd, "OPTIONS")) { |