mirror of
https://github.com/miekg/dns.git
synced 2025-08-16 06:26:58 +02:00
Fix crash
This commit is contained in:
parent
872dc4fc6b
commit
930694cd05
14
kscan.go
14
kscan.go
@ -41,9 +41,10 @@ func (k *RR_DNSKEY) ReadPrivateKey(q io.Reader, file string) (PrivateKey, error)
|
|||||||
case "7 (RSASHA1NSEC3SHA1)":
|
case "7 (RSASHA1NSEC3SHA1)":
|
||||||
p, e := readPrivateKeyRSA(m)
|
p, e := readPrivateKeyRSA(m)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
if !k.setPublicKeyInPrivate(p) {
|
return nil, e
|
||||||
return nil, ErrPrivKey
|
}
|
||||||
}
|
if !k.setPublicKeyInPrivate(p) {
|
||||||
|
return nil, ErrPrivKey
|
||||||
}
|
}
|
||||||
return p, e
|
return p, e
|
||||||
case "13 (ECDSAP256SHA256)":
|
case "13 (ECDSAP256SHA256)":
|
||||||
@ -51,9 +52,10 @@ func (k *RR_DNSKEY) ReadPrivateKey(q io.Reader, file string) (PrivateKey, error)
|
|||||||
case "14 (ECDSAP384SHA384)":
|
case "14 (ECDSAP384SHA384)":
|
||||||
p, e := readPrivateKeyECDSA(m)
|
p, e := readPrivateKeyECDSA(m)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
if !k.setPublicKeyInPrivate(p) {
|
return nil, e
|
||||||
return nil, ErrPrivKey
|
}
|
||||||
}
|
if !k.setPublicKeyInPrivate(p) {
|
||||||
|
return nil, ErrPrivKey
|
||||||
}
|
}
|
||||||
return p, e
|
return p, e
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user