From df10cc187edba822d04c628a803dc1000f334148 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Thu, 7 Jul 2011 10:00:42 +0200 Subject: [PATCH] Add the new hashes --- README.markdown | 1 + dnssec.go | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.markdown b/README.markdown index 82fcca9f..93bff32d 100644 --- a/README.markdown +++ b/README.markdown @@ -49,6 +49,7 @@ Miek Gieben - 2010, 2011 - miek@miek.nl * 4635 - HMAC SHA TSIG * 5001 - NSID * 5155 - NSEC +* 5933 - GOST * 5936 - AXFR ## Loosely based upon: diff --git a/dnssec.go b/dnssec.go index 928fc002..e380a4ad 100644 --- a/dnssec.go +++ b/dnssec.go @@ -33,9 +33,10 @@ const ( // DNSSEC hashing codes. const ( _ = iota - HashSHA1 - HashSHA256 - HashGOST94 + HashSHA1 // RFC 4034 + HashSHA256 // RFC 4509 + HashGOST94 // RFC 5933 + HashSHA384 // Experimental ) // DNSKEY flags values. @@ -146,6 +147,10 @@ func (k *RR_DNSKEY) ToDS(h int) *RR_DS { s := sha256.New() io.WriteString(s, string(digest)) ds.Digest = hex.EncodeToString(s.Sum()) + case HashSHA384: + s := sha512.New384() + io.WriteString(s, string(digest)) + ds.Digest = hex.EncodeToString(s.Sum()) case HashGOST94: /* I have no clue */ default: