MCPcopy Create free account
hub / github.com/apache/httpd / session_crypto_decode

Function session_crypto_decode

modules/session/mod_session_crypto.c:513–537  ·  view source on GitHub ↗

* Crypto decoding for the session. * * @param r The request pointer. * @param z A pointer to where the session will be written. */

Source from the content-addressed store, hash-verified

511 * @param z A pointer to where the session will be written.
512 */
513static 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.

Callers

nothing calls this directly

Calls 2

ap_get_module_configFunction · 0.85
decrypt_stringFunction · 0.85

Tested by

no test coverage detected