mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-10 23:00:00 -04:00
Return ISC_R_NOTIMPLEMENTED rather than ISC_R_UNEXPECTEDEND
If the keydata rdata is shorter that 16 octets it is not out private keydata type and we have not implemented a tostruct method for it.
This commit is contained in:
parent
48039fa25e
commit
26f817f574
3 changed files with 13 additions and 8 deletions
|
|
@ -524,7 +524,6 @@ dns_rdata_tostruct(const dns_rdata_t *rdata, void *target, isc_mem_t *mctx);
|
|||
* Result:
|
||||
*\li Success
|
||||
*\li Not Implemented
|
||||
*\li Unexpected end of input
|
||||
*/
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -341,42 +341,48 @@ tostruct_keydata(ARGS_TOSTRUCT) {
|
|||
|
||||
/* Refresh timer */
|
||||
if (sr.length < 4) {
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
/* Not KEYDATA */
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
}
|
||||
keydata->refresh = uint32_fromregion(&sr);
|
||||
isc_region_consume(&sr, 4);
|
||||
|
||||
/* Add hold-down */
|
||||
if (sr.length < 4) {
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
/* Not KEYDATA */
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
}
|
||||
keydata->addhd = uint32_fromregion(&sr);
|
||||
isc_region_consume(&sr, 4);
|
||||
|
||||
/* Remove hold-down */
|
||||
if (sr.length < 4) {
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
/* Not KEYDATA */
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
}
|
||||
keydata->removehd = uint32_fromregion(&sr);
|
||||
isc_region_consume(&sr, 4);
|
||||
|
||||
/* Flags */
|
||||
if (sr.length < 2) {
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
/* Not KEYDATA */
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
}
|
||||
keydata->flags = uint16_fromregion(&sr);
|
||||
isc_region_consume(&sr, 2);
|
||||
|
||||
/* Protocol */
|
||||
if (sr.length < 1) {
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
/* Not KEYDATA */
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
}
|
||||
keydata->protocol = uint8_fromregion(&sr);
|
||||
isc_region_consume(&sr, 1);
|
||||
|
||||
/* Algorithm */
|
||||
if (sr.length < 1) {
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
/* Not KEYDATA */
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
}
|
||||
keydata->algorithm = uint8_fromregion(&sr);
|
||||
isc_region_consume(&sr, 1);
|
||||
|
|
|
|||
|
|
@ -4362,7 +4362,7 @@ load_secroots(dns_zone_t *zone, dns_name_t *name, dns_rdataset_t *rdataset) {
|
|||
|
||||
/* Convert rdata to keydata. */
|
||||
result = dns_rdata_tostruct(&rdata, &keydata, NULL);
|
||||
if (result == ISC_R_UNEXPECTEDEND) {
|
||||
if (result == ISC_R_NOTIMPLEMENTED) {
|
||||
continue;
|
||||
}
|
||||
RUNTIME_CHECK(result == ISC_R_SUCCESS);
|
||||
|
|
|
|||
Loading…
Reference in a new issue