Lines Matching defs:resp
870 static int get_digest_rec(request_rec *r, digest_header_rec *resp)
882 resp->auth_hdr_sts = NO_HEADER;
886 resp->scheme = ap_getword_white(r->pool, &auth_line);
887 if (strcasecmp(resp->scheme, "Digest")) {
888 resp->auth_hdr_sts = NOT_DIGEST;
952 resp->username = apr_pstrdup(r->pool, value);
954 resp->realm = apr_pstrdup(r->pool, value);
956 resp->nonce = apr_pstrdup(r->pool, value);
958 resp->uri = apr_pstrdup(r->pool, value);
960 resp->digest = apr_pstrdup(r->pool, value);
962 resp->algorithm = apr_pstrdup(r->pool, value);
964 resp->cnonce = apr_pstrdup(r->pool, value);
966 resp->opaque = apr_pstrdup(r->pool, value);
968 resp->message_qop = apr_pstrdup(r->pool, value);
970 resp->nonce_count = apr_pstrdup(r->pool, value);
973 if (!resp->username || !resp->realm || !resp->nonce || !resp->uri
974 || !resp->digest
975 || (resp->message_qop && (!resp->cnonce || !resp->nonce_count))) {
976 resp->auth_hdr_sts = INVALID;
980 if (resp->opaque) {
981 resp->opaque_num = (unsigned long) strtol(resp->opaque, NULL, 16);
984 resp->auth_hdr_sts = VALID;
1002 digest_header_rec *resp;
1009 resp = apr_pcalloc(r->pool, sizeof(digest_header_rec));
1010 resp->raw_request_uri = r->unparsed_uri;
1011 resp->psd_request_uri = &r->parsed_uri;
1012 resp->needed_auth = 0;
1013 resp->method = r->method;
1014 ap_set_module_config(r->request_config, &auth_digest_module, resp);
1016 res = get_digest_rec(r, resp);
1017 resp->client = get_client(resp->opaque_num, r);
1018 if (res == OK && resp->client) {
1019 resp->client->nonce_count++;
1134 digest_header_rec *resp, int stale)
1154 if (resp->opaque == NULL) {
1157 && (resp->client = gen_client(r)) != NULL) {
1158 opaque = ltox(r->pool, resp->client->key);
1164 else if (resp->client == NULL) {
1166 resp->client = gen_client(r);
1167 if (resp->client != NULL) {
1168 opaque = ltox(r->pool, resp->client->key);
1177 opaque = resp->opaque;
1179 resp->client->nonce_count = 0;
1192 if (resp->client && conf->nonce_lifetime == 0) {
1193 memcpy(resp->client->last_nonce, nonce, NONCE_LEN+1);
1228 digest_header_rec *resp;
1243 resp = (digest_header_rec *) ap_get_module_config(mainreq->request_config,
1245 resp->needed_auth = 1;
1253 note_digest_auth_failure(r, conf, resp, 0);
1322 static int check_nc(const request_rec *r, const digest_header_rec *resp,
1326 const char *snc = resp->nonce_count;
1360 if (!resp->client) {
1364 if (nc != resp->client->nonce_count) {
1368 resp->client->nonce_count);
1375 static int check_nonce(request_rec *r, digest_header_rec *resp,
1382 if (strlen(resp->nonce) != NONCE_LEN) {
1385 resp->nonce, NONCE_LEN);
1386 note_digest_auth_failure(r, conf, resp, 1);
1390 tmp = resp->nonce[NONCE_TIME_LEN];
1391 resp->nonce[NONCE_TIME_LEN] = '\0';
1392 apr_base64_decode_binary(nonce_time.arr, resp->nonce);
1393 gen_nonce_hash(hash, resp->nonce, resp->opaque, r->server, conf);
1394 resp->nonce[NONCE_TIME_LEN] = tmp;
1395 resp->nonce_time = nonce_time.time;
1397 if (strcmp(hash, resp->nonce+NONCE_TIME_LEN)) {
1400 resp->nonce, hash);
1401 note_digest_auth_failure(r, conf, resp, 1);
1409 "time travel", resp->nonce);
1410 note_digest_auth_failure(r, conf, resp, 1);
1421 note_digest_auth_failure(r, conf, resp, 1);
1425 else if (conf->nonce_lifetime == 0 && resp->client) {
1426 if (memcmp(resp->client->last_nonce, resp->nonce, NONCE_LEN)) {
1430 note_digest_auth_failure(r, conf, resp, 1);
1443 const digest_header_rec *resp, const char *ha1)
1447 ha2 = ap_md5(r->pool, (unsigned char *)apr_pstrcat(r->pool, resp->method, ":",
1448 resp->uri, NULL));
1450 (unsigned char *)apr_pstrcat(r->pool, ha1, ":", resp->nonce,
1456 digest_header_rec *resp,
1463 a2 = apr_pstrcat(r->pool, resp->method, ":", resp->uri, NULL);
1467 (unsigned char *)apr_pstrcat(r->pool, ha1, ":", resp->nonce,
1468 ":", resp->nonce_count, ":",
1469 resp->cnonce, ":",
1470 resp->message_qop, ":", ha2,
1535 digest_header_rec *resp;
1563 resp = (digest_header_rec *) ap_get_module_config(mainreq->request_config,
1565 resp->needed_auth = 1;
1576 if (resp->auth_hdr_sts != VALID) {
1577 if (resp->auth_hdr_sts == NOT_DIGEST) {
1580 resp->scheme, r->uri);
1582 else if (resp->auth_hdr_sts == INVALID) {
1588 /* else (resp->auth_hdr_sts == NO_HEADER) */
1589 note_digest_auth_failure(r, conf, resp, 0);
1593 r->user = (char *) resp->username;
1598 if (strcmp(resp->uri, resp->raw_request_uri)) {
1604 copy_uri_components(&r_uri, resp->psd_request_uri, r);
1605 if (apr_uri_parse(r->pool, resp->uri, &d_uri) != APR_SUCCESS) {
1608 resp->uri);
1643 "to uri <%s>", resp->raw_request_uri);
1650 if (!r_uri.hostinfo || strcmp(resp->uri, r_uri.hostinfo)) {
1653 "request-uri <%s>", resp->uri, r_uri.hostinfo);
1672 && !(d_uri.path && !r_uri.path && resp->psd_request_uri->hostname
1681 "request-uri <%s>", resp->uri, resp->raw_request_uri);
1686 if (resp->opaque && resp->opaque_num == 0) {
1689 resp->opaque);
1690 note_digest_auth_failure(r, conf, resp, 0);
1697 resp->realm);
1698 note_digest_auth_failure(r, conf, resp, 0);
1702 if (!resp->realm || strcmp(resp->realm, conf->realm)) {
1705 resp->realm, conf->realm);
1706 note_digest_auth_failure(r, conf, resp, 0);
1710 if (resp->algorithm != NULL
1711 && strcasecmp(resp->algorithm, "MD5")) {
1714 resp->algorithm, r->uri);
1715 note_digest_auth_failure(r, conf, resp, 0);
1725 note_digest_auth_failure(r, conf, resp, 0);
1736 note_digest_auth_failure(r, conf, resp, 0);
1750 if (resp->message_qop == NULL) {
1752 if (strcmp(resp->digest, old_digest(r, resp, conf->ha1))) {
1756 note_digest_auth_failure(r, conf, resp, 0);
1765 if (!strcasecmp(*tmp, resp->message_qop)) {
1774 && !strcasecmp(resp->message_qop, "auth"))) {
1777 resp->message_qop, r->uri);
1778 note_digest_auth_failure(r, conf, resp, 0);
1782 exp_digest = new_digest(r, resp, conf);
1787 if (strcmp(resp->digest, exp_digest)) {
1791 note_digest_auth_failure(r, conf, resp, 0);
1796 if (check_nc(r, resp, conf) != OK) {
1797 note_digest_auth_failure(r, conf, resp, 0);
1803 if ((res = check_nonce(r, resp, conf))) {
1819 digest_header_rec *resp =
1824 if (resp == NULL || !resp->needed_auth || conf == NULL) {
1835 if ((r->request_time - resp->nonce_time) > (conf->nonce_lifetime-NEXTNONCE_DELTA)) {
1838 resp->opaque, r->server, conf),
1840 if (resp->client)
1841 resp->client->nonce_count = 0;
1844 else if (conf->nonce_lifetime == 0 && resp->client) {
1845 const char *nonce = gen_nonce(r->pool, 0, resp->opaque, r->server,
1848 memcpy(resp->client->last_nonce, nonce, NONCE_LEN+1);
1857 && resp->message_qop == NULL) {
1868 a2 = apr_pstrcat(r->pool, ":", resp->uri, NULL);
1873 resp->nonce, ":",
1874 resp->nonce_count, ":",
1875 resp->cnonce, ":",
1876 resp->message_qop ?
1877 resp->message_qop : "",
1885 resp->cnonce ? ", cnonce=\"" : "",
1886 resp->cnonce
1887 ? ap_escape_quotes(r->pool, resp->cnonce)
1889 resp->cnonce ? "\"" : "",
1890 resp->nonce_count ? ", nc=" : "",
1891 resp->nonce_count ? resp->nonce_count : "",
1892 resp->message_qop ? ", qop=" : "",
1893 resp->message_qop ? resp->message_qop : "",