This commit is contained in:
Miek Gieben 2011-12-16 19:42:30 +01:00
parent a72df87858
commit cac5cf451b
2 changed files with 11 additions and 11 deletions

View File

@ -23,8 +23,8 @@ func ReadPrivateKey(q io.Reader) (PrivateKey, error) {
}
switch m["algorithm"] {
case "1 (RSAMD5)", "5 (RSASHA1)", "8 (RSASHA256)", "10 (RSASHA512)":
fallthrough
case "7 (RSASHA1NSEC3SHA1)":
fallthrough
case "7 (RSASHA1NSEC3SHA1)":
return readPrivateKeyRSA(m)
case "13 (ECDSAP256SHA256)", "14 (ECDSAP384SHA384)":
return readPrivateKeyECDSA(m)
@ -110,7 +110,7 @@ func ParseKey(r io.Reader) (map[string]string, error) {
if k == "" {
return nil, &ParseError{"No key seen", l}
}
//println("Setting", strings.ToLower(k), "to", l.token, "b")
//println("Setting", strings.ToLower(k), "to", l.token, "b")
m[strings.ToLower(k)] = l.token
k = ""
}
@ -134,14 +134,14 @@ func klexer(s scanner.Scanner, c chan lex) {
if commt {
break
}
l.token = str
l.token = str
if key {
l.value = _KEY
c <- l
// Next token is a space, eat it
s.Scan()
// Next token is a space, eat it
s.Scan()
key = false
str = ""
str = ""
} else {
l.value = _VALUE
}
@ -152,8 +152,8 @@ func klexer(s scanner.Scanner, c chan lex) {
// Reset a comment
commt = false
}
l.value = _VALUE
l.token = str
l.value = _VALUE
l.token = str
c <- l
str = ""
commt = false

View File

@ -38,13 +38,13 @@ func HashName(label string, ha, iter int, salt string) string {
// k = 0
name = append(name, wire...)
io.WriteString(s, string(name))
io.WriteString(s, string(name))
nsec3 := s.Sum(nil)
// k > 0
for k := 0; k < iter; k++ {
s.Reset()
nsec3 = append(nsec3, wire...)
io.WriteString(s, string(nsec3))
io.WriteString(s, string(nsec3))
nsec3 = s.Sum(nil)
}
return unpackBase32(nsec3)