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

Function md_reg_should_warn

modules/md/md_reg.c:734–765  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

732}
733
734int md_reg_should_warn(md_reg_t *reg, const md_t *md, apr_pool_t *p)
735{
736 const md_pubcert_t *pub;
737 const md_cert_t *cert;
738 md_timeperiod_t certlife, warn;
739 int i;
740 apr_status_t rv;
741
742 if (md->state == MD_S_INCOMPLETE) return 0;
743 for (i = 0; i < md_cert_count(md); ++i) {
744 rv = md_reg_get_pubcert(&pub, reg, md, i, p);
745 if (APR_STATUS_IS_ENOENT(rv)) return 0;
746 if (APR_SUCCESS == rv) {
747 cert = APR_ARRAY_IDX(pub->certs, 0, const md_cert_t*);
748 certlife.start = md_cert_get_not_before(cert);
749 certlife.end = md_cert_get_not_after(cert);
750
751 warn = md_timeperiod_slice_before_end(&certlife, md->warn_window);
752 if (md_log_is_level(p, MD_LOG_TRACE1)) {
753 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE2, 0, p,
754 "md[%s]: certificate(%d) life[%s] warn[%s]",
755 md->name, i,
756 md_timeperiod_print(p, &certlife),
757 md_timeperiod_print(p, &warn));
758 }
759 if (md_timeperiod_has_started(&warn, apr_time_now())) {
760 return 1;
761 }
762 }
763 }
764 return 0;
765}
766
767/**************************************************************************************************/
768/* syncing */

Callers 1

process_drive_jobFunction · 0.85

Calls 9

md_cert_countFunction · 0.85
md_reg_get_pubcertFunction · 0.85
md_cert_get_not_beforeFunction · 0.85
md_cert_get_not_afterFunction · 0.85
md_log_is_levelFunction · 0.85
md_log_perrorFunction · 0.85
md_timeperiod_printFunction · 0.85

Tested by

no test coverage detected