djbdns
[Top] [All Lists]

Another SSHFP record script converter for tinydns

To: dns@list.cr.yp.to
Subject: Another SSHFP record script converter for tinydns
From: "Antonio Dias" <lists@sys.pro.br>
Date: Sat, 17 Feb 2007 19:44:15 -0200
Delivered-to: sp-com-lists@consult.net
Delivered-to: gmail-djbdns@securepoint.com
Delivered-to: sp.com.list@gmail.com
Delivered-to: mailing list dns@list.cr.yp.to
Mailing-list: contact dns-help@list.cr.yp.to; run by ezmlm
Sender: accdias@sys.pro.br
Hello, all.

Here is another script to generate SSHFP resource records in tinydns
format. This one is in gawk and will generate records for all keys
found in the host where it run. I wish it be useful for you:

#!/usr/bin/gawk -f
BEGIN {
  hostname=ENVIRON["HOSTNAME"]
  keygen="ssh-keygen -gr " hostname
  while(keygen | getline) {
     if($8) {
        rr=sprintf(":%s:44:\\%03.3o\\%03.3o", hostname, $6, $7)
        for(i=1; i<length($8); i+=2) {
           rr=sprintf("%s\\%03.3o", rr, strtonum("0x" substr($8, i, 2)))
        }
        print "# " $0
        print rr ":::"
     }
  }
}


--
Antonio Dias

<Prev in Thread] Current Thread [Next in Thread>
  • Another SSHFP record script converter for tinydns, Antonio Dias <=