Skip to content

Commit

Permalink
Reset expiry timers when reloading CRLs on SIGHUP
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Mauchle committed Mar 24, 2017
1 parent 4f223d3 commit 05b832e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tlscommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,16 +338,25 @@ SSL_CTX *tlsgetctx(uint8_t type, struct tls *t) {
void tlsreloadcrls() {
struct tls *conf;
struct hash_entry *entry;
struct timeval now;

gettimeofday(&now, NULL);

for(entry = hash_first(tlsconfs); entry; entry = hash_next(entry)) {
for (entry = hash_first(tlsconfs); entry; entry = hash_next(entry)) {
conf = (struct tls *)entry->data;
#ifdef RADPROT_TLS
if(conf->tlsctx)
if (conf->tlsctx) {
if (conf->tlsexpiry)
conf->tlsexpiry = now.tv_sec + conf->cacheexpiry;
tlsaddcacrl(conf->tlsctx, conf);
}
#endif
#ifdef RADPROT_DTLS
if(conf->dtlsctx)
if (conf->dtlsctx) {
if (conf->dtlsexpiry)
conf->dtlsexpiry = now.tv_sec + conf->cacheexpiry;
tlsaddcacrl(conf->dtlsctx, conf);
}
#endif
}
}
Expand Down

0 comments on commit 05b832e

Please sign in to comment.