char filename[256];
unsigned char *p;
struct stat st;
- VALUE_PAIR *vp;
+ VALUE_PAIR *vps = NULL;
/* read in the cached VPs from the .vps file */
snprintf(filename, sizeof(filename), "%s%c%s.vps",
conf->session_cache_path, FR_DIR_SEP, buffer);
- rv = pairlist_read(NULL, filename, &pairlist, 1);
+ rv = pairlist_read(talloc_ctx, filename, &pairlist, 1);
if (rv < 0) {
/* not safe to un-persist a session w/o VPs */
RWDEBUG("Failed loading persisted VPs for session %s", buffer);
goto err;
}
- /* cache the VPs into the session */
- vp = paircopy(talloc_ctx, pairlist->reply);
- SSL_SESSION_set_ex_data(sess, fr_tls_ex_index_vps, vp);
+ /* move the cached VPs into the session */
+ pairfilter(talloc_ctx, &vps, &pairlist->reply, 0, 0, TAG_ANY);
+ SSL_SESSION_set_ex_data(sess, fr_tls_ex_index_vps, vps);
RWDEBUG("Successfully restored session %s", buffer);
}
err: