diff options
author | Mattias Päivärinta <mattias.paivarinta@iis.se> | 2022-03-11 01:58:09 +0100 |
---|---|---|
committer | Mattias Päivärinta <mattias.paivarinta@iis.se> | 2022-03-16 18:58:16 +0100 |
commit | 0b45f9d0f4062581191f309ab87f29b0768d9d81 (patch) | |
tree | 2a8a69177452170e2a8357b2fe0373c13f6c077c /t | |
parent | a433e72f69c3a2d1aa3da179dab7fc5b9de0a2ff (diff) |
Make answer() filter out DNSKEY with incalculable key size
Diffstat (limited to 't')
-rw-r--r-- | t/rr.t | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -111,13 +111,16 @@ subtest 'DNSKEY' => sub { my $data = decode_base64( "BleFgAABAAEAAAAADW5sYWdyaWN1bHR1cmUCbmwAAAEAAcAMADAAAQAAAAAABAEBAwg="); my $p = Zonemaster::LDNS::Packet->new_from_wireformat( $data ); - my ( $rr, @extra ) = $p->answer; + my ( $rr, @extra ) = $p->answer_unfiltered; eq_or_diff \@extra, [], "no extra RRs found"; if ( !defined $rr ) { BAIL_OUT( "no RR found" ); } is $rr->keydata, "", "we're able to extract the public key field even when it's empty"; is $rr->keysize, -1, "insufficient data to calculate key size is reported as -1"; + + my ( @rrs ) = $p->answer; + eq_or_diff \@rrs, [], "DNSKEY record with empty public key is filtered out by answer()"; }; subtest 'RRSIG' => sub { |