|
51 | 51 | * The only problem is that it allows replay attacks when somebody |
52 | 52 | * captures a packet sent to one server and sends it to another |
53 | 53 | * one. Should we add "AuthDigestNcCheck Strict"? |
54 | | - * - expired nonces give amaya fits. |
| 54 | + * - expired nonces give amaya fits. |
55 | 55 | */ |
56 | 56 |
|
57 | 57 | #include "apr_sha1.h" |
|
80 | 80 |
|
81 | 81 | #include "mod_auth.h" |
82 | 82 |
|
83 | | -/* Disable shmem until pools/init gets sorted out |
84 | | - * remove following two lines when fixed |
| 83 | +/* Disable shmem until pools/init gets sorted out |
| 84 | + * remove following two lines when fixed |
85 | 85 | */ |
86 | 86 | #undef APR_HAS_SHARED_MEMORY |
87 | 87 | #define APR_HAS_SHARED_MEMORY 0 |
@@ -200,7 +200,7 @@ module AP_MODULE_DECLARE_DATA auth_digest_module; |
200 | 200 |
|
201 | 201 | static apr_status_t cleanup_tables(void *not_used) |
202 | 202 | { |
203 | | - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, |
| 203 | + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, |
204 | 204 | "Digest: cleaning up shared memory"); |
205 | 205 | fflush(stderr); |
206 | 206 |
|
@@ -238,7 +238,7 @@ static apr_status_t initialize_secret(server_rec *s) |
238 | 238 | if (status != APR_SUCCESS) { |
239 | 239 | char buf[120]; |
240 | 240 | ap_log_error(APLOG_MARK, APLOG_CRIT, status, s, |
241 | | - "Digest: error generating secret: %s", |
| 241 | + "Digest: error generating secret: %s", |
242 | 242 | apr_strerror(status, buf, sizeof(buf))); |
243 | 243 | return status; |
244 | 244 | } |
@@ -447,13 +447,13 @@ static const char *add_authn_provider(cmd_parms *cmd, void *config, |
447 | 447 | digest_config_rec *conf = (digest_config_rec*)config; |
448 | 448 | authn_provider_list *newp; |
449 | 449 | const char *provider_name; |
450 | | - |
| 450 | + |
451 | 451 | if (strcasecmp(arg, "on") == 0) { |
452 | 452 | provider_name = AUTHN_DEFAULT_PROVIDER; |
453 | 453 | } |
454 | 454 | else if (strcasecmp(arg, "off") == 0) { |
455 | 455 | /* Clear all configured providers and return. */ |
456 | | - conf->providers = NULL; |
| 456 | + conf->providers = NULL; |
457 | 457 | return NULL; |
458 | 458 | } |
459 | 459 | else { |
@@ -540,7 +540,7 @@ static const char *set_nonce_lifetime(cmd_parms *cmd, void *config, |
540 | 540 | char *endptr; |
541 | 541 | long lifetime; |
542 | 542 |
|
543 | | - lifetime = strtol(t, &endptr, 10); |
| 543 | + lifetime = strtol(t, &endptr, 10); |
544 | 544 | if (endptr < (t+strlen(t)) && !apr_isspace(*endptr)) { |
545 | 545 | return apr_pstrcat(cmd->pool, |
546 | 546 | "Invalid time in AuthDigestNonceLifetime: ", |
@@ -608,7 +608,7 @@ static const char *set_shmem_size(cmd_parms *cmd, void *config, |
608 | 608 | char *endptr; |
609 | 609 | long size, min; |
610 | 610 |
|
611 | | - size = strtol(size_str, &endptr, 10); |
| 611 | + size = strtol(size_str, &endptr, 10); |
612 | 612 | while (apr_isspace(*endptr)) endptr++; |
613 | 613 | if (*endptr == '\0' || *endptr == 'b' || *endptr == 'B') { |
614 | 614 | ; |
@@ -645,23 +645,23 @@ static const char *set_shmem_size(cmd_parms *cmd, void *config, |
645 | 645 |
|
646 | 646 | static const command_rec digest_cmds[] = |
647 | 647 | { |
648 | | - AP_INIT_TAKE1("AuthName", set_realm, NULL, OR_AUTHCFG, |
| 648 | + AP_INIT_TAKE1("AuthName", set_realm, NULL, OR_AUTHCFG, |
649 | 649 | "The authentication realm (e.g. \"Members Only\")"), |
650 | 650 | AP_INIT_ITERATE("AuthDigestProvider", add_authn_provider, NULL, OR_AUTHCFG, |
651 | 651 | "specify the auth providers for a directory or location"), |
652 | | - AP_INIT_ITERATE("AuthDigestQop", set_qop, NULL, OR_AUTHCFG, |
| 652 | + AP_INIT_ITERATE("AuthDigestQop", set_qop, NULL, OR_AUTHCFG, |
653 | 653 | "A list of quality-of-protection options"), |
654 | | - AP_INIT_TAKE1("AuthDigestNonceLifetime", set_nonce_lifetime, NULL, OR_AUTHCFG, |
| 654 | + AP_INIT_TAKE1("AuthDigestNonceLifetime", set_nonce_lifetime, NULL, OR_AUTHCFG, |
655 | 655 | "Maximum lifetime of the server nonce (seconds)"), |
656 | | - AP_INIT_TAKE1("AuthDigestNonceFormat", set_nonce_format, NULL, OR_AUTHCFG, |
| 656 | + AP_INIT_TAKE1("AuthDigestNonceFormat", set_nonce_format, NULL, OR_AUTHCFG, |
657 | 657 | "The format to use when generating the server nonce"), |
658 | | - AP_INIT_FLAG("AuthDigestNcCheck", set_nc_check, NULL, OR_AUTHCFG, |
| 658 | + AP_INIT_FLAG("AuthDigestNcCheck", set_nc_check, NULL, OR_AUTHCFG, |
659 | 659 | "Whether or not to check the nonce-count sent by the client"), |
660 | | - AP_INIT_TAKE1("AuthDigestAlgorithm", set_algorithm, NULL, OR_AUTHCFG, |
| 660 | + AP_INIT_TAKE1("AuthDigestAlgorithm", set_algorithm, NULL, OR_AUTHCFG, |
661 | 661 | "The algorithm used for the hash calculation"), |
662 | | - AP_INIT_ITERATE("AuthDigestDomain", set_uri_list, NULL, OR_AUTHCFG, |
| 662 | + AP_INIT_ITERATE("AuthDigestDomain", set_uri_list, NULL, OR_AUTHCFG, |
663 | 663 | "A list of URI's which belong to the same protection space as the current URI"), |
664 | | - AP_INIT_TAKE1("AuthDigestShmemSize", set_shmem_size, NULL, RSRC_CONF, |
| 664 | + AP_INIT_TAKE1("AuthDigestShmemSize", set_shmem_size, NULL, RSRC_CONF, |
665 | 665 | "The amount of shared memory to allocate for keeping track of clients"), |
666 | 666 | {NULL} |
667 | 667 | }; |
@@ -1300,13 +1300,13 @@ static void note_digest_auth_failure(request_rec *r, |
1300 | 1300 | * unneccessarily (it's usually > 200 bytes!). |
1301 | 1301 | */ |
1302 | 1302 |
|
1303 | | - |
| 1303 | + |
1304 | 1304 | /* don't send domain |
1305 | 1305 | * - for proxy requests |
1306 | 1306 | * - if it's no specified |
1307 | 1307 | */ |
1308 | 1308 | if (r->proxyreq || !conf->uri_list) { |
1309 | | - domain = NULL; |
| 1309 | + domain = NULL; |
1310 | 1310 | } |
1311 | 1311 | else { |
1312 | 1312 | domain = conf->uri_list; |
@@ -1464,7 +1464,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp, |
1464 | 1464 | if (dt > conf->nonce_lifetime) { |
1465 | 1465 | ap_log_rerror(APLOG_MARK, APLOG_INFO, 0,r, |
1466 | 1466 | "Digest: user %s: nonce expired (%.2f seconds old " |
1467 | | - "- max lifetime %.2f) - sending new nonce", |
| 1467 | + "- max lifetime %.2f) - sending new nonce", |
1468 | 1468 | r->user, (double)apr_time_sec(dt), |
1469 | 1469 | (double)apr_time_sec(conf->nonce_lifetime)); |
1470 | 1470 | note_digest_auth_failure(r, conf, resp, 1); |
@@ -1536,7 +1536,7 @@ static const char *new_digest(const request_rec *r, |
1536 | 1536 | } |
1537 | 1537 |
|
1538 | 1538 |
|
1539 | | -static void copy_uri_components(apr_uri_t *dst, |
| 1539 | +static void copy_uri_components(apr_uri_t *dst, |
1540 | 1540 | apr_uri_t *src, request_rec *r) { |
1541 | 1541 | if (src->scheme && src->scheme[0] != '\0') { |
1542 | 1542 | dst->scheme = src->scheme; |
@@ -1684,30 +1684,30 @@ static int authenticate_digest_user(request_rec *r) |
1684 | 1684 | ap_unescape_url(d_uri.query); |
1685 | 1685 | } |
1686 | 1686 | else if (r_uri.query) { |
1687 | | - /* MSIE compatibility hack. MSIE has some RFC issues - doesn't |
| 1687 | + /* MSIE compatibility hack. MSIE has some RFC issues - doesn't |
1688 | 1688 | * include the query string in the uri Authorization component |
1689 | 1689 | * or when computing the response component. the second part |
1690 | 1690 | * works out ok, since we can hash the header and get the same |
1691 | 1691 | * result. however, the uri from the request line won't match |
1692 | | - * the uri Authorization component since the header lacks the |
| 1692 | + * the uri Authorization component since the header lacks the |
1693 | 1693 | * query string, leaving us incompatable with a (broken) MSIE. |
1694 | | - * |
| 1694 | + * |
1695 | 1695 | * the workaround is to fake a query string match if in the proper |
1696 | 1696 | * environment - BrowserMatch MSIE, for example. the cool thing |
1697 | | - * is that if MSIE ever fixes itself the simple match ought to |
| 1697 | + * is that if MSIE ever fixes itself the simple match ought to |
1698 | 1698 | * work and this code won't be reached anyway, even if the |
1699 | 1699 | * environment is set. |
1700 | 1700 | */ |
1701 | 1701 |
|
1702 | | - if (apr_table_get(r->subprocess_env, |
| 1702 | + if (apr_table_get(r->subprocess_env, |
1703 | 1703 | "AuthDigestEnableQueryStringHack")) { |
1704 | | - |
| 1704 | + |
1705 | 1705 | ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, "Digest: " |
1706 | 1706 | "applying AuthDigestEnableQueryStringHack " |
1707 | 1707 | "to uri <%s>", resp->raw_request_uri); |
1708 | 1708 |
|
1709 | 1709 | d_uri.query = r_uri.query; |
1710 | | - } |
| 1710 | + } |
1711 | 1711 | } |
1712 | 1712 |
|
1713 | 1713 | if (r->method_number == M_CONNECT) { |
@@ -1800,7 +1800,7 @@ static int authenticate_digest_user(request_rec *r) |
1800 | 1800 | */ |
1801 | 1801 | return HTTP_INTERNAL_SERVER_ERROR; |
1802 | 1802 | } |
1803 | | - |
| 1803 | + |
1804 | 1804 | if (resp->message_qop == NULL) { |
1805 | 1805 | /* old (rfc-2069) style digest */ |
1806 | 1806 | if (strcmp(resp->digest, old_digest(r, resp, conf->ha1))) { |
|
0 commit comments