mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
IPSECKEY: require non-zero length public keys
This commit is contained in:
@@ -230,18 +230,21 @@ fromwire_ipseckey(ARGS_FROMWIRE) {
|
||||
|
||||
switch (region.base[1]) {
|
||||
case 0:
|
||||
if (region.length < 4) {
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
}
|
||||
isc_buffer_forward(source, region.length);
|
||||
return (mem_tobuffer(target, region.base, region.length));
|
||||
|
||||
case 1:
|
||||
if (region.length < 7) {
|
||||
if (region.length < 8) {
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
}
|
||||
isc_buffer_forward(source, region.length);
|
||||
return (mem_tobuffer(target, region.base, region.length));
|
||||
|
||||
case 2:
|
||||
if (region.length < 19) {
|
||||
if (region.length < 20) {
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
}
|
||||
isc_buffer_forward(source, region.length);
|
||||
@@ -253,6 +256,9 @@ fromwire_ipseckey(ARGS_FROMWIRE) {
|
||||
RETERR(dns_name_fromwire(&name, source, dctx, options, target));
|
||||
isc_buffer_activeregion(source, ®ion);
|
||||
isc_buffer_forward(source, region.length);
|
||||
if (region.length < 1) {
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
}
|
||||
return (mem_tobuffer(target, region.base, region.length));
|
||||
|
||||
default:
|
||||
|
Reference in New Issue
Block a user