Commit 33a7f3ca authored by Jan Včelák's avatar Jan Včelák 🚀

NSEC proofs: cleanup, move function

parent 5b604663
......@@ -115,6 +115,31 @@ static knot_dname_t *get_next_closer(const knot_dname_t *closest_encloser,
return knot_dname_copy(name, NULL);
}
/*!
* \brief Create a wildcard child of a name.
*
* \param name Parent of the wildcard.
*
* \return Wildcard child name, NULL on error.
*/
static knot_dname_t *wildcard_child_name(const knot_dname_t *name)
{
assert(name != NULL);
knot_dname_t *wildcard = knot_dname_from_str_alloc("*");
if (wildcard == NULL) {
return NULL;
}
wildcard = knot_dname_cat(wildcard, name);
if (wildcard == NULL) {
return NULL;
}
return wildcard;
}
/*!
* \brief Put NSEC/NSEC3 record with corresponding RRSIG into the response.
*/
......@@ -277,30 +302,6 @@ static int put_closest_encloser_proof(const knot_dname_t *qname,
return put_nsec3_next_closer(cpe, qname, zone, qdata, resp);
}
/*!
* \brief Creates a name of a wildcard child of \a name.
*
* \param name Domain name to get the wildcard child name of.
*
* \return Wildcard child name or NULL if an error occurred.
*/
static knot_dname_t *wildcard_child_name(const knot_dname_t *name)
{
assert(name != NULL);
knot_dname_t *wildcard = knot_dname_from_str_alloc("*");
if (wildcard == NULL) {
return NULL;
}
wildcard = knot_dname_cat(wildcard, name);
if (wildcard == NULL) {
return NULL;
}
return wildcard;
}
/*!
* \brief Put NSEC for wildcard answer into the response.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment