Because the browser may preemptively send auth info, incrementing the * nonce-count when it does, and because the client does not get notified * if the URI didn't need authentication after all, we need to be sure to * update the nonce-count each time we receive an Authorization header no * matter what the final outcome of the request. Furthermore this is a * convenient place to get the reques
| 1053 | * r->proxyreq is set correctly. |
| 1054 | */ |
| 1055 | static int parse_hdr_and_update_nc(request_rec *r) |
| 1056 | { |
| 1057 | digest_header_rec *resp; |
| 1058 | int res; |
| 1059 | |
| 1060 | if (!ap_is_initial_req(r)) { |
| 1061 | return DECLINED; |
| 1062 | } |
| 1063 | |
| 1064 | resp = apr_pcalloc(r->pool, sizeof(digest_header_rec)); |
| 1065 | resp->raw_request_uri = r->unparsed_uri; |
| 1066 | resp->psd_request_uri = &r->parsed_uri; |
| 1067 | resp->needed_auth = 0; |
| 1068 | resp->method = r->method; |
| 1069 | ap_set_module_config(r->request_config, &auth_digest_module, resp); |
| 1070 | |
| 1071 | res = get_digest_rec(r, resp); |
| 1072 | resp->client = get_client(resp->opaque_num, r); |
| 1073 | if (res == OK && resp->client) { |
| 1074 | resp->client->nonce_count++; |
| 1075 | } |
| 1076 | |
| 1077 | return DECLINED; |
| 1078 | } |
| 1079 | |
| 1080 | |
| 1081 | /* Writes the hash part of the server nonce to hash, which must be of |
nothing calls this directly
no test coverage detected