From 3b74b5dfdac7856efc283d07e5579b3a485c32ed Mon Sep 17 00:00:00 2001 From: joe Date: Thu, 14 Apr 2016 15:22:21 -0400 Subject: Show in DNSKEY presentation format. --- kiki.hs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/kiki.hs b/kiki.hs index 316da90..6afcbed 100644 --- a/kiki.hs +++ b/kiki.hs @@ -309,9 +309,19 @@ dnsPresentationFromPacket k = do dnskey = DNS.RSA n e bin = runPut (DNS.putRSA dnskey) qq = Base64.encode (L.unpack bin) - return $ - writePEM "FIXME PUBLIC KEY" qq -- ("TODO "++show keyspec) - + ttl = 24*60*60 -- 24 hours in seconds + flags = 256 -- (ZONE-key = bit7) TODO: is this a zone key or a key-signing key? + algo = 8 -- RSASHA256 -- TODO: support other algorithm + return $ unwords + ["." + ,show ttl + ,"IN" + ,"DNSKEY" + ,show flags + ,"3" -- protocol MUST be 3 (RFC 4034) + ,show algo + ,qq + ] show_ssh keyspec wkgrip db = either warn putStrLn $ show_ssh' keyspec wkgrip db @@ -512,7 +522,7 @@ kiki_usage bExport bImport bSecret cmd = putStr $ ," is input on stdin in ssh-rsa format." ,"" ," --dns SPEC" - ," Outputs the DNSKEY presentation format (RFC3110) of the public key" + ," Outputs the DNSKEY presentation format (RFC4034) of the public key" ," corresponding to SPEC." ," (See 'kiki help spec' for more information.)" ,"" -- cgit v1.2.3