More stuff added, first stab at using hashing functions
This commit is contained in:
parent
65caf6f891
commit
70552b49ca
5
Makefile
5
Makefile
|
@ -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
|
||||
|
||||
|
|
24
dnssec.go
24
dnssec.go
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue