Skip to content

Commit

Permalink
Scheme 1 allows CDS and CSYNC
Browse files Browse the repository at this point in the history
and not CDNSKEY which was a mistake
  • Loading branch information
wtoorop committed Jan 3, 2025
1 parent 90ec6fa commit 580e8ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/generic/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -2210,7 +2210,7 @@ static int32_t check_dsync_rr(
memcpy(&dsync_type, o, sizeof(dsync_type));
dsync_type = be16toh(dsync_type);
if (dsync_scheme == 1 && dsync_type != ZONE_TYPE_CDS
&& dsync_type != ZONE_TYPE_CDNSKEY)
&& dsync_type != ZONE_TYPE_CSYNC)
SEMANTIC_ERROR(parser, "Wrong type for scheme 1 in %s", NAME(type));

if (c > n)
Expand Down Expand Up @@ -2248,7 +2248,7 @@ static int32_t parse_dsync_rdata(
memcpy(&dsync_type, parser->rdata->octets, sizeof(dsync_type));
dsync_type = be16toh(dsync_type);
if (dsync_scheme == 1 && dsync_type != ZONE_TYPE_CDS
&& dsync_type != ZONE_TYPE_CDNSKEY)
&& dsync_type != ZONE_TYPE_CSYNC)
SEMANTIC_ERROR(parser, "Wrong type for scheme 1 in %s", NAME(type));

return accept_rr(parser, type, rdata);
Expand Down
14 changes: 7 additions & 7 deletions tests/semantics.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,22 @@ void dsync_scheme_types(void **state)
// Schema 0: Reserved
{ "CDS" , ZONE_TYPE_CDS , 0, ZONE_SUCCESS },
{ "TYPE59" , 59 /* CDS */ , 0, ZONE_SUCCESS },
{ "CDNSKEY", ZONE_TYPE_CDNSKEY, 0, ZONE_SUCCESS },
{ "TYPE60" , 60 /* CDNSKEY */ , 0, ZONE_SUCCESS },
{ "CSYNC" , ZONE_TYPE_CSYNC , 0, ZONE_SUCCESS },
{ "TYPE62" , 62 /* CSYNC */ , 0, ZONE_SUCCESS },
{ "TXT" , ZONE_TYPE_TXT , 0, ZONE_SUCCESS },
{ "TYPE16" , 16 /* TXT */ , 0, ZONE_SUCCESS },
// Scheme 1: only CDS and CDNSKEY
// Scheme 1: only CDS and CSYNC
{ "CDS" , ZONE_TYPE_CDS , 1, ZONE_SUCCESS },
{ "TYPE59" , 59 /* CDS */ , 1, ZONE_SUCCESS },
{ "CDNSKEY", ZONE_TYPE_CDNSKEY, 1, ZONE_SUCCESS },
{ "TYPE60" , 60 /* CDNSKEY */ , 1, ZONE_SUCCESS },
{ "CSYNC" , ZONE_TYPE_CSYNC , 1, ZONE_SUCCESS },
{ "TYPE62" , 62 /* CSYNC */ , 1, ZONE_SUCCESS },
{ "TXT" , ZONE_TYPE_TXT , 1, ZONE_SEMANTIC_ERROR },
{ "TYPE16" , 16 /* TXT */ , 1, ZONE_SEMANTIC_ERROR },
// Other schemes, anything goes
{ "CDS" , ZONE_TYPE_CDS , 2, ZONE_SUCCESS },
{ "TYPE59" , 59 /* CDS */ , 2, ZONE_SUCCESS },
{ "CDNSKEY", ZONE_TYPE_CDNSKEY, 2, ZONE_SUCCESS },
{ "TYPE60" , 60 /* CDNSKEY */ , 2, ZONE_SUCCESS },
{ "CSYNC" , ZONE_TYPE_CSYNC , 2, ZONE_SUCCESS },
{ "TYPE62" , 62 /* CSYNC */ , 2, ZONE_SUCCESS },
{ "TXT" , ZONE_TYPE_TXT , 2, ZONE_SUCCESS },
{ "TYPE16" , 16 /* TXT */ , 2, ZONE_SUCCESS }
};
Expand Down

0 comments on commit 580e8ef

Please sign in to comment.