From 1e111c9571f8c41acecdd8267eab2d485e511b50 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Wed, 2 Feb 2011 09:05:25 +0100 Subject: [PATCH] Make it work with the new Go release --- _examples/rude/rude.go | 1 - dnssec.go | 21 +++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/_examples/rude/rude.go b/_examples/rude/rude.go index abd5df18..80330bb7 100644 --- a/_examples/rude/rude.go +++ b/_examples/rude/rude.go @@ -66,6 +66,5 @@ forever: break forever } } - close(cht) close(ch) } diff --git a/dnssec.go b/dnssec.go index fe3d50ee..773427cb 100644 --- a/dnssec.go +++ b/dnssec.go @@ -1,6 +1,7 @@ package dns import ( + "crypto" "crypto/md5" "crypto/sha1" "crypto/sha256" @@ -225,20 +226,20 @@ func (s *RR_RRSIG) Sign(k PrivateKey, rrset RRset) bool { //pubkey := k.pubKeyRSA() // Get the key, need privkey representation // Setup the hash as defined for this alg. var h hash.Hash - var ch rsa.PKCS1v15Hash + var ch crypto.Hash switch s.Algorithm { case AlgRSAMD5: h = md5.New() - ch = rsa.HashMD5 + ch = crypto.MD5 case AlgRSASHA1: h = sha1.New() - ch = rsa.HashSHA1 + ch = crypto.SHA1 case AlgRSASHA256: h = sha256.New() - ch = rsa.HashSHA256 + ch = crypto.SHA256 case AlgRSASHA512: h = sha512.New() - ch = rsa.HashSHA512 + ch = crypto.SHA512 default: // Illegal Alg return false @@ -355,20 +356,20 @@ func (s *RR_RRSIG) Verify(k *RR_DNSKEY, rrset RRset) bool { pubkey := k.pubKeyRSA() // Get the key // Setup the hash as defined for this alg. var h hash.Hash - var ch rsa.PKCS1v15Hash + var ch crypto.Hash switch s.Algorithm { case AlgRSAMD5: h = md5.New() - ch = rsa.HashMD5 + ch = crypto.MD5 case AlgRSASHA1: h = sha1.New() - ch = rsa.HashSHA1 + ch = crypto.SHA1 case AlgRSASHA256: h = sha256.New() - ch = rsa.HashSHA256 + ch = crypto.SHA256 case AlgRSASHA512: h = sha512.New() - ch = rsa.HashSHA512 + ch = crypto.SHA512 } io.WriteString(h, string(signeddata)) sighash := h.Sum()