Compare commits

..

2 Commits

Author SHA1 Message Date
fc2031eb7c Support TLSA records
Closes: #4
2021-06-19 15:49:54 +01:00
17ff01d066 Handle SSHFP records
Closes #2
2021-06-19 15:42:11 +01:00

View File

@ -40,9 +40,9 @@ my %supported_types = (
MX => "yes", MX => "yes",
NS => "yes", NS => "yes",
PTR => "yes", PTR => "yes",
SSHFP => "not yet implemented", SSHFP => "yes",
SRV => "yes", SRV => "yes",
TLSA => "not yet implemented", TLSA => "yes",
TXT => "yes", TXT => "yes",
); );
sub is_unsupported($) { sub is_unsupported($) {
@ -136,6 +136,17 @@ sub format_record($$$$) {
$record->{caa_property} = $property; $record->{caa_property} = $property;
$record->{caa_tag} = $property; $record->{caa_tag} = $property;
$record->{data} = $data; $record->{data} = $data;
} elsif ($type eq 'SSHFP') {
my ($algo, $keytype, $data) = split(/\s+/, $value);
$record->{sshfp_type} = $keytype;
$record->{sshfp_algorithm} = $algo;
$record->{data} = $data;
} elsif ($type eq 'TLSA') {
my ($usage, $selector, $matching, $data) = split(/\s+/, $value);
$record->{tlsa_usage} = $usage;
$record->{tlsa_selector} = $selector;
$record->{tlsa_matching} = $matching;
$record->{data} = $data;
} }
return $record; return $record;
@ -158,6 +169,19 @@ sub reformat_data($$) {
$data->{caa_property} || $data->{caa_tag}, $data->{caa_property} || $data->{caa_tag},
$data->{data} $data->{data}
); );
} elsif($type eq 'SSHFP') {
return sprintf('%d %d %s',
$data->{sshfp_algorithm},
$data->{sshfp_type},
$data->{data},
);
} elsif($type eq 'TLSA') {
return sprintf('%d %d %d %s',
$data->{tlsa_usage},
$data->{tlsa_selector},
$data->{tlsa_matching},
$data->{data},
);
} }
return $data->{data}; return $data->{data};