Skip to content
Snippets Groups Projects
Commit 00dd38bc authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

knot_rrset_sign: add memory context

parent 8111b702
No related branches found
No related tags found
1 merge request!398Online DNSSEC Signing
......@@ -334,7 +334,7 @@ static int add_missing_rrsigs(const knot_rrset_t *covered,
to_add = create_empty_rrsigs_for(covered);
}
result = knot_sign_rrset(&to_add, covered, key->key, key->ctx, dnssec_ctx);
result = knot_sign_rrset(&to_add, covered, key->key, key->ctx, dnssec_ctx, NULL);
if (result != KNOT_EOK) {
break;
}
......
......@@ -230,7 +230,8 @@ static int sign_ctx_add_data(dnssec_sign_ctx_t *ctx,
static int rrsigs_create_rdata(knot_rrset_t *rrsigs, dnssec_sign_ctx_t *ctx,
const knot_rrset_t *covered,
const dnssec_key_t *key,
uint32_t sig_incepted, uint32_t sig_expires)
uint32_t sig_incepted, uint32_t sig_expires,
mm_ctx_t *mm)
{
assert(rrsigs);
assert(rrsigs->type == KNOT_RRTYPE_RRSIG);
......@@ -278,13 +279,13 @@ static int rrsigs_create_rdata(knot_rrset_t *rrsigs, dnssec_sign_ctx_t *ctx,
dnssec_binary_free(&signature);
return knot_rrset_add_rdata(rrsigs, rrsig, rrsig_size,
knot_rdata_ttl(covered_data), NULL);
knot_rdata_ttl(covered_data), mm);
}
_public_
int knot_sign_rrset(knot_rrset_t *rrsigs, const knot_rrset_t *covered,
const dnssec_key_t *key, dnssec_sign_ctx_t *sign_ctx,
const kdnssec_ctx_t *dnssec_ctx)
const dnssec_key_t *key, dnssec_sign_ctx_t *sign_ctx,
const kdnssec_ctx_t *dnssec_ctx, mm_ctx_t *mm)
{
if (knot_rrset_empty(covered) || !key || !sign_ctx || !dnssec_ctx ||
rrsigs->type != KNOT_RRTYPE_RRSIG ||
......@@ -297,7 +298,7 @@ int knot_sign_rrset(knot_rrset_t *rrsigs, const knot_rrset_t *covered,
uint32_t sig_expire = sig_incept + dnssec_ctx->policy->rrsig_lifetime;
return rrsigs_create_rdata(rrsigs, sign_ctx, covered, key, sig_incept,
sig_expire);
sig_expire, mm);
}
_public_
......
......@@ -43,6 +43,7 @@
* \param key Signing key.
* \param sign_ctx Signing context.
* \param dnssec_ctx DNSSEC context.
* \param mm Memory context.
*
* \return Error code, KNOT_EOK if successful.
*/
......@@ -50,7 +51,8 @@ int knot_sign_rrset(knot_rrset_t *rrsigs,
const knot_rrset_t *covered,
const dnssec_key_t *key,
dnssec_sign_ctx_t *sign_ctx,
const kdnssec_ctx_t *dnssec_ctx);
const kdnssec_ctx_t *dnssec_ctx,
mm_ctx_t *mm);
/*!
* \brief Creates new RRS using \a rrsig_rrs as a source. Only those RRs that
......
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