* Crypto encoding for the session. * * @param r The request pointer. * @param z A pointer to where the session will be written. */
| 481 | * @param z A pointer to where the session will be written. |
| 482 | */ |
| 483 | static apr_status_t session_crypto_encode(request_rec * r, session_rec * z) |
| 484 | { |
| 485 | |
| 486 | char *encoded = NULL; |
| 487 | apr_status_t res; |
| 488 | const apr_crypto_t *f = NULL; |
| 489 | session_crypto_dir_conf *dconf = ap_get_module_config(r->per_dir_config, |
| 490 | &session_crypto_module); |
| 491 | |
| 492 | if (dconf->passphrases_set && z->encoded && *z->encoded) { |
| 493 | apr_pool_userdata_get((void **)&f, CRYPTO_KEY, r->server->process->pconf); |
| 494 | res = encrypt_string(r, f, dconf, z->encoded, &encoded); |
| 495 | if (res != OK) { |
| 496 | ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r, APLOGNO(01841) |
| 497 | "encrypt session failed"); |
| 498 | return res; |
| 499 | } |
| 500 | z->encoded = encoded; |
| 501 | } |
| 502 | |
| 503 | return OK; |
| 504 | |
| 505 | } |
| 506 | |
| 507 | /** |
| 508 | * Crypto decoding for the session. |
nothing calls this directly
no test coverage detected