mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-08-17 21:25:50 +02:00
- Fix parse of svcbparam ech, it had incorrect length. Thanks
to Qifan Zhang, Palo Alto Networks for the report.
This commit is contained in:
@@ -279,10 +279,24 @@ b64_test(void)
|
||||
unit_assert(result == -1);
|
||||
}
|
||||
|
||||
/** test SVCB ech svcparam */
|
||||
static void
|
||||
svcb_ech_test(void)
|
||||
{
|
||||
uint8_t rr[LDNS_RR_BUF_SIZE];
|
||||
size_t rr_len = sizeof(rr), dname_len = 0;
|
||||
int e = sldns_str2wire_rr_buf("x. 300 IN HTTPS 1 . ech=0",
|
||||
rr, &rr_len, &dname_len, 300, NULL, 0, NULL, 0);
|
||||
unit_assert(e == LDNS_WIREPARSE_ERR_OK);
|
||||
unit_assert(rr_len == dname_len + 10 /* type,class,ttl,rdatalen */ + 7 /* rdata */);
|
||||
unit_assert(sldns_read_uint16(rr + dname_len + 8 /* rdlen */) == 7);
|
||||
}
|
||||
|
||||
void
|
||||
ldns_test(void)
|
||||
{
|
||||
unit_show_feature("sldns");
|
||||
rr_tests();
|
||||
b64_test();
|
||||
svcb_ech_test();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user