More stuff added, first stab at using hashing functions

This commit is contained in:
Miek Gieben 2010-12-25 11:43:12 +01:00
parent 65caf6f891
commit 70552b49ca
3 changed files with 31 additions and 5 deletions

View File

@ -10,8 +10,9 @@ GOFILES=\
resolver.go \
types.go\
dnssec.go\
edns.go \
strconv.go \
edns.go\
server.go\
strconv.go\
include $(GOROOT)/src/Make.pkg

View File

@ -1,8 +1,9 @@
package dns
import "time"
// All DNSSEC verification
import (
"crypto/sha1"
"time"
)
const (
year68 = 2 << (32 - 1)
@ -24,3 +25,20 @@ func validSignaturePeriod(start, end uint32) bool {
utc := time.UTC().Seconds() // maybe as parameter?? TODO MG
return int64(start) <= utc && utc <= int64(end)
}
// Convert an DNSKEY record to a DS record.
func KeyToDS(k *RR_DNSKEY, hash int) *RR_DS {
switch hash {
case HashSHA1:
var _ = sha1.New()
case HashSHA256:
}
return nil
}
// Calculate the keytag of the DNSKEY
func KeyTag(k *RR_DNSKEY) int {
return 0
}

7
server.go Normal file
View File

@ -0,0 +1,7 @@
// Server side. An receiver listen for incoming packets.
// If the packet is wellformed it is passed on to the channel.
// Otherwise a FORMERR is returned directly.
//
package dns
// TODO MG