Handle SSHFP records

Closes #2
This commit is contained in:
Matthew Slowe 2021-06-19 15:42:11 +01:00
parent 7a3e5e472a
commit 17ff01d066

View File

@ -40,7 +40,7 @@ my %supported_types = (
MX => "yes",
NS => "yes",
PTR => "yes",
SSHFP => "not yet implemented",
SSHFP => "yes",
SRV => "yes",
TLSA => "not yet implemented",
TXT => "yes",
@ -136,6 +136,11 @@ sub format_record($$$$) {
$record->{caa_property} = $property;
$record->{caa_tag} = $property;
$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;
}
return $record;
@ -158,6 +163,12 @@ sub reformat_data($$) {
$data->{caa_property} || $data->{caa_tag},
$data->{data}
);
} elsif($type eq 'SSHFP') {
return sprintf('%d %d %s',
$data->{sshfp_algorithm},
$data->{sshfp_type},
$data->{data},
);
}
return $data->{data};