Skip to content
Snippets Groups Projects
Commit cd995e75 authored by Libor Peltan's avatar Libor Peltan
Browse files

dnssec: avoid overflow in RRSIG expire by capping

parent ace46283
No related branches found
No related tags found
1 merge request!1281dnssec: avoid overflow in RRSIG expire by capping
Pipeline #79122 passed
......@@ -272,12 +272,13 @@ int knot_sign_rrset(knot_rrset_t *rrsigs, const knot_rrset_t *covered,
}
uint32_t sig_incept = dnssec_ctx->now - RRSIG_INCEPT_IN_PAST;
uint32_t sig_expire = dnssec_ctx->now + dnssec_ctx->policy->rrsig_lifetime;
uint64_t sig_expire = dnssec_ctx->now + dnssec_ctx->policy->rrsig_lifetime;
sig_expire = MIN(sig_expire, UINT32_MAX);
dnssec_sign_flags_t sign_flags = dnssec_ctx->policy->reproducible_sign ?
DNSSEC_SIGN_REPRODUCIBLE : DNSSEC_SIGN_NORMAL;
int ret = rrsigs_create_rdata(rrsigs, sign_ctx, covered, key, sig_incept,
sig_expire, sign_flags, mm);
(uint32_t)sig_expire, sign_flags, mm);
if (ret == KNOT_EOK && expires != NULL) {
*expires = knot_time_min(*expires, sig_expire);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment