id = SSL_SESSION_get_session_id(session);
idlen = SSL_SESSION_get_session_id_length(session);
- timeout += modssl_session_get_time(session);
-
- rc = ssl_scache_store(s, id, idlen, timeout, session, conn->pool);
+ rc = ssl_scache_store(s, id, idlen,
+ apr_time_from_sec(modssl_session_get_time(session)
+ + timeout),
+ session, conn->pool);
ssl_session_log(s, "SET", id, idlen,
rc == TRUE ? "OK" : "BAD",
void ssl_scache_status_register(apr_pool_t *p);
void ssl_scache_kill(server_rec *);
BOOL ssl_scache_store(server_rec *, UCHAR *, int,
- time_t, SSL_SESSION *, apr_pool_t *);
+ apr_time_t, SSL_SESSION *, apr_pool_t *);
SSL_SESSION *ssl_scache_retrieve(server_rec *, UCHAR *, int, apr_pool_t *);
void ssl_scache_remove(server_rec *, UCHAR *, int,
apr_pool_t *);
}
BOOL ssl_scache_store(server_rec *s, UCHAR *id, int idlen,
- time_t expiry, SSL_SESSION *sess,
+ apr_time_t expiry, SSL_SESSION *sess,
apr_pool_t *p)
{
SSLModConfigRec *mc = myModConfig(s);
unsigned char *p;
int resp_derlen;
BOOL rv;
- time_t timeout;
+ apr_time_t expiry;
resp_derlen = i2d_OCSP_RESPONSE(rsp, NULL) + 1;
return FALSE;
}
-
p = resp_der;
+ /* TODO: potential optimization; _timeout members as apr_interval_time_t */
if (ok == TRUE) {
*p++ = 1;
- timeout = mctx->stapling_cache_timeout;
+ expiry = apr_time_from_sec(mctx->stapling_cache_timeout);
}
else {
*p++ = 0;
- timeout = mctx->stapling_errcache_timeout;
+ expiry = apr_time_from_sec(mctx->stapling_errcache_timeout);
}
- timeout += apr_time_sec(apr_time_now());
+ expiry += apr_time_now();
i2d_OCSP_RESPONSE(rsp, &p);
rv = mc->stapling_cache->store(mc->stapling_cache_context, s,
cinf->idx, sizeof(cinf->idx),
- timeout, resp_der, resp_derlen, pool);
+ expiry, resp_der, resp_derlen, pool);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
"stapling_cache_response: OCSP response session store error!");