fake the basic authentication header if configured to do so */
| 857 | |
| 858 | /* fake the basic authentication header if configured to do so */ |
| 859 | static void fake_basic_authentication(request_rec *r, auth_form_config_rec *conf, |
| 860 | const char *user, const char *pw) |
| 861 | { |
| 862 | if (conf->fakebasicauth) { |
| 863 | char *basic = apr_pstrcat(r->pool, user, ":", pw, NULL); |
| 864 | apr_size_t size = (apr_size_t) strlen(basic); |
| 865 | char *base64 = apr_palloc(r->pool, |
| 866 | apr_base64_encode_len(size + 1) * sizeof(char)); |
| 867 | apr_base64_encode(base64, basic, size); |
| 868 | apr_table_setn(r->headers_in, "Authorization", |
| 869 | apr_pstrcat(r->pool, "Basic ", base64, NULL)); |
| 870 | } |
| 871 | } |
| 872 | |
| 873 | /** |
| 874 | * Must we use form authentication? If so, extract the cookie and run |
no outgoing calls
no test coverage detected