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

Function session_crypto_encode

modules/session/mod_session_crypto.c:483–505  ·  view source on GitHub ↗

* Crypto encoding 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

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

Callers

nothing calls this directly

Calls 2

ap_get_module_configFunction · 0.85
encrypt_stringFunction · 0.85

Tested by

no test coverage detected