~ubuntu-branches/ubuntu/saucy/squid3/saucy-proposed

« back to all changes in this revision

Viewing changes to src/auth/digest/auth_digest.cc

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Ubuntu Merge-o-Matic
  • Date: 2012-01-30 10:24:33 UTC
  • mfrom: (21.2.10 sid)
  • Revision ID: package-import@ubuntu.com-20120130102433-3xusl5y4szkpbp9k
Tags: 3.1.18-1ubuntu1
[ Ubuntu Merge-o-Matic ]
* Merge from Debian testing.  Remaining changes:
  + debian/control:
    - Update maintainer.
  + debian/squid3.upstart, debian/rules, squid3.resolvconf,
    debian/squid3.postinst, debian/squid3.postrm, debian/squid3.preinst,
    debian/squid3.prerm: Convert init script to upstart
  + debian/control, debian/patches/99-ubuntu-ssl-cert-snakeoil: Use
   snakeoil certificates.
  + debian/logrotate: Use sar-reports rather than sarg-maint. (LP: #26616)
  + debian/patches/90-cf.data.ubuntu.dpatch: Add an example refresh pattern
    for debs. (foundations-lucid-local-report spec)
  + Add transitional dummy packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
1134
1134
            vlen = 0;
1135
1135
        }
1136
1136
 
1137
 
        /* parse value. auth-param     = token "=" ( token | quoted-string ) */
1138
1137
        String value;
 
1138
 
1139
1139
        if (vlen > 0) {
1140
 
            if (*p == '"') {
 
1140
            // see RFC 2617 section 3.2.1 and 3.2.2 for details on the BNF
 
1141
 
 
1142
            if ( (nlen == 6 && memcmp(item,"domain",6) == 0) || (nlen == 3 && memcmp(item,"uri",3) == 0) ) {
 
1143
                // domain is Special. Not a quoted-string, must not be de-quoted. But is wrapped in '"'
 
1144
                // BUG 3077: uri= can also be sent to us in a mangled (invalid!) form like domain
 
1145
                if (*p == '"' && *(p + vlen-1) == '"') {
 
1146
                    value.limitInit(p+1, vlen-2);
 
1147
                } else {
 
1148
                    value.limitInit(p, vlen);
 
1149
                }
 
1150
            } else if (nlen == 3 && memcmp(item,"qop",3) == 0) {
 
1151
                // qop is more special.
 
1152
                // On request this must not be quoted-string de-quoted. But is several values wrapped in '"'
 
1153
                // On response this is a single un-quoted token.
 
1154
                if (*p == '"' && *(p + vlen-1) == '"') {
 
1155
                    value.limitInit(p+1, vlen-2);
 
1156
                } else {
 
1157
                    value.limitInit(p, vlen);
 
1158
                }
 
1159
            } else if (*p == '"') {
1141
1160
                if (!httpHeaderParseQuotedString(p, &value)) {
1142
1161
                    debugs(29, 9, "authDigestDecodeAuth: Failed to parse attribute '" << item << "' in '" << temp << "'");
1143
1162
                    continue;