Skip to content

Commit 04fc7f0

Browse files
committed
* modules/aaa/mod_auth_digest.c (set_algorithm): Note that
conf->algorithm is a constant ("MD5") so there is no point in overriding it at runtime. Simplify error case.
1 parent 1c634ec commit 04fc7f0

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

modules/aaa/mod_auth_digest.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ typedef struct digest_config_struct {
8686
authn_provider_list *providers;
8787
apr_time_t nonce_lifetime;
8888
int check_nc;
89-
const char *algorithm;
89+
const char *algorithm; /* currently a constant (MD5). */
9090
char *uri_list;
9191
} digest_config_rec;
9292

@@ -556,15 +556,11 @@ static const char *set_nc_check(cmd_parms *cmd, void *config, int flag)
556556

557557
static const char *set_algorithm(cmd_parms *cmd, void *config, const char *alg)
558558
{
559-
if (!ap_cstr_casecmp(alg, "MD5-sess")) {
560-
return "AuthDigestAlgorithm: ERROR: algorithm `MD5-sess' "
561-
"is not implemented";
562-
}
563-
else if (ap_cstr_casecmp(alg, "MD5")) {
564-
return apr_pstrcat(cmd->pool, "Invalid algorithm in AuthDigestAlgorithm: ", alg, NULL);
559+
if (ap_cstr_casecmp(alg, "MD5")) {
560+
return apr_pstrcat(cmd->pool, "Unsupported algorithm in AuthDigestAlgorithm: ", alg, NULL);
565561
}
566562

567-
((digest_config_rec *) config)->algorithm = alg;
563+
/* conf->algorithm remains the constant, "MD5". */
568564
return NULL;
569565
}
570566

0 commit comments

Comments
 (0)