More NSEC3 stuff
This commit is contained in:
parent
e0fb2abe85
commit
77562dcfed
2
Makefile
2
Makefile
|
@ -15,11 +15,11 @@ GOFILES=\
|
|||
dnssec.go\
|
||||
keygen.go\
|
||||
string.go\
|
||||
nsec3.go\
|
||||
resolver.go\
|
||||
config.go\
|
||||
server.go \
|
||||
# y.go\
|
||||
# nsec3.go \
|
||||
|
||||
include $(GOROOT)/src/Make.pkg
|
||||
|
||||
|
|
3
TODO
3
TODO
|
@ -3,7 +3,8 @@ Todo:
|
|||
* Tsig generation for replies (request MAC)
|
||||
* Parsing from strings, going with goyacc and .cz lexer
|
||||
* encoding NSEC3/NSEC bitmaps, DEcoding works
|
||||
* Failed Xfr triggers nil error
|
||||
nsec3 hashing of owner names
|
||||
* Failed Xfr triggers nil error?
|
||||
|
||||
Issues:
|
||||
* Check the network order, it works now, but this is on Intel??
|
||||
|
|
17
nsec3.go
17
nsec3.go
|
@ -1,5 +1,22 @@
|
|||
package dns
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
)
|
||||
|
||||
// NSEC3 related functions
|
||||
|
||||
// Hash a string/label according to RFC5155
|
||||
func Nsec3Hash(label string, hash int, i iterations, salt string) {
|
||||
nsec3 := ""
|
||||
switch hash {
|
||||
case HashSHA1:
|
||||
s := sha1.New()
|
||||
// i times
|
||||
// add salt, binary???
|
||||
io.WriteString(s, string(label))
|
||||
ds.Digest = hex.EncodeToString(
|
||||
}
|
||||
|
||||
return nsec3
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue