Add the new hashes

This commit is contained in:
Miek Gieben 2011-07-07 10:00:42 +02:00
parent 5a5c8e7a58
commit df10cc187e
2 changed files with 9 additions and 3 deletions

View File

@ -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:

View File

@ -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: