* Crypto decoding for the session. * * @param r The request pointer. * @param z A pointer to where the session will be written. */
| 511 | * @param z A pointer to where the session will be written. |
| 512 | */ |
| 513 | static apr_status_t session_crypto_decode(request_rec * r, |
| 514 | session_rec * z) |
| 515 | { |
| 516 | |
| 517 | char *encoded = NULL; |
| 518 | apr_status_t res; |
| 519 | const apr_crypto_t *f = NULL; |
| 520 | session_crypto_dir_conf *dconf = ap_get_module_config(r->per_dir_config, |
| 521 | &session_crypto_module); |
| 522 | |
| 523 | if ((dconf->passphrases_set) && z->encoded && *z->encoded) { |
| 524 | apr_pool_userdata_get((void **)&f, CRYPTO_KEY, |
| 525 | r->server->process->pconf); |
| 526 | res = decrypt_string(r, f, dconf, z->encoded, &encoded); |
| 527 | if (res != APR_SUCCESS) { |
| 528 | ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, APLOGNO(01842) |
| 529 | "decrypt session failed, wrong passphrase?"); |
| 530 | return res; |
| 531 | } |
| 532 | z->encoded = encoded; |
| 533 | } |
| 534 | |
| 535 | return OK; |
| 536 | |
| 537 | } |
| 538 | |
| 539 | /** |
| 540 | * Initialise the SSL in the post_config hook. |
nothing calls this directly
no test coverage detected