bdaebd
--- a/modules/aaa/mod_auth_digest.c	2019/03/12 09:24:19	1855297
bdaebd
+++ b/modules/aaa/mod_auth_digest.c	2019/03/12 09:24:26	1855298
bdaebd
@@ -92,7 +92,6 @@
bdaebd
     int          check_nc;
bdaebd
     const char  *algorithm;
bdaebd
     char        *uri_list;
bdaebd
-    const char  *ha1;
bdaebd
 } digest_config_rec;
bdaebd
 
bdaebd
 
bdaebd
@@ -153,6 +152,7 @@
bdaebd
     apr_time_t            nonce_time;
bdaebd
     enum hdr_sts          auth_hdr_sts;
bdaebd
     int                   needed_auth;
bdaebd
+    const char           *ha1;
bdaebd
     client_entry         *client;
bdaebd
 } digest_header_rec;
bdaebd
 
bdaebd
@@ -1304,7 +1304,7 @@
bdaebd
  */
bdaebd
 
bdaebd
 static authn_status get_hash(request_rec *r, const char *user,
bdaebd
-                             digest_config_rec *conf)
bdaebd
+                             digest_config_rec *conf, const char **rethash)
bdaebd
 {
bdaebd
     authn_status auth_result;
bdaebd
     char *password;
bdaebd
@@ -1356,7 +1356,7 @@
bdaebd
     } while (current_provider);
bdaebd
 
bdaebd
     if (auth_result == AUTH_USER_FOUND) {
bdaebd
-        conf->ha1 = password;
bdaebd
+        *rethash = password;
bdaebd
     }
bdaebd
 
bdaebd
     return auth_result;
bdaebd
@@ -1483,25 +1483,24 @@
bdaebd
 
bdaebd
 /* RFC-2069 */
bdaebd
 static const char *old_digest(const request_rec *r,
bdaebd
-                              const digest_header_rec *resp, const char *ha1)
bdaebd
+                              const digest_header_rec *resp)
bdaebd
 {
bdaebd
     const char *ha2;
bdaebd
 
bdaebd
     ha2 = ap_md5(r->pool, (unsigned char *)apr_pstrcat(r->pool, resp->method, ":",
bdaebd
                                                        resp->uri, NULL));
bdaebd
     return ap_md5(r->pool,
bdaebd
-                  (unsigned char *)apr_pstrcat(r->pool, ha1, ":", resp->nonce,
bdaebd
-                                              ":", ha2, NULL));
bdaebd
+                  (unsigned char *)apr_pstrcat(r->pool, resp->ha1, ":",
bdaebd
+                                               resp->nonce, ":", ha2, NULL));
bdaebd
 }
bdaebd
 
bdaebd
 /* RFC-2617 */
bdaebd
 static const char *new_digest(const request_rec *r,
bdaebd
-                              digest_header_rec *resp,
bdaebd
-                              const digest_config_rec *conf)
bdaebd
+                              digest_header_rec *resp)
bdaebd
 {
bdaebd
     const char *ha1, *ha2, *a2;
bdaebd
 
bdaebd
-    ha1 = conf->ha1;
bdaebd
+    ha1 = resp->ha1;
bdaebd
 
bdaebd
     a2 = apr_pstrcat(r->pool, resp->method, ":", resp->uri, NULL);
bdaebd
     ha2 = ap_md5(r->pool, (const unsigned char *)a2);
bdaebd
@@ -1514,7 +1513,6 @@
bdaebd
                                                NULL));
bdaebd
 }
bdaebd
 
bdaebd
-
bdaebd
 static void copy_uri_components(apr_uri_t *dst,
bdaebd
                                 apr_uri_t *src, request_rec *r) {
bdaebd
     if (src->scheme && src->scheme[0] != '\0') {
bdaebd
@@ -1759,7 +1757,7 @@
bdaebd
         return HTTP_UNAUTHORIZED;
bdaebd
     }
bdaebd
 
bdaebd
-    return_code = get_hash(r, r->user, conf);
bdaebd
+    return_code = get_hash(r, r->user, conf, &resp->ha1);
bdaebd
 
bdaebd
     if (return_code == AUTH_USER_NOT_FOUND) {
bdaebd
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01790)
bdaebd
@@ -1789,7 +1787,7 @@
bdaebd
 
bdaebd
     if (resp->message_qop == NULL) {
bdaebd
         /* old (rfc-2069) style digest */
bdaebd
-        if (strcmp(resp->digest, old_digest(r, resp, conf->ha1))) {
bdaebd
+        if (strcmp(resp->digest, old_digest(r, resp))) {
bdaebd
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01792)
bdaebd
                           "user %s: password mismatch: %s", r->user,
bdaebd
                           r->uri);
bdaebd
@@ -1819,7 +1817,7 @@
bdaebd
             return HTTP_UNAUTHORIZED;
bdaebd
         }
bdaebd
 
bdaebd
-        exp_digest = new_digest(r, resp, conf);
bdaebd
+        exp_digest = new_digest(r, resp);
bdaebd
         if (!exp_digest) {
bdaebd
             /* we failed to allocate a client struct */
bdaebd
             return HTTP_INTERNAL_SERVER_ERROR;
bdaebd
@@ -1903,7 +1901,7 @@
bdaebd
 
bdaebd
         /* calculate rspauth attribute
bdaebd
          */
bdaebd
-        ha1 = conf->ha1;
bdaebd
+        ha1 = resp->ha1;
bdaebd
 
bdaebd
         a2 = apr_pstrcat(r->pool, ":", resp->uri, NULL);
bdaebd
         ha2 = ap_md5(r->pool, (const unsigned char *)a2);