Skip to content

Commit

Permalink
wipwip
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jul 12, 2023
1 parent 12156a4 commit fbbb988
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 deletions.
44 changes: 23 additions & 21 deletions pkg/dnssec/integration_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build integration
// +build integration

package dnssec

import (
Expand Down Expand Up @@ -63,27 +60,32 @@ func Test_validator_fetchAndValidateZone(t *testing.T) {
errWrapped error
errMessage string
}{
"valid DNSSEC": {
zone: "qqq.ninja.",
// "valid DNSSEC": {
// zone: "qqq.ninja.",
// dnsType: dns.TypeA,
// rrset: getRRSetWithoutValidation(t, "qqq.ninja.", dns.TypeA, dns.ClassINET),
// exchange: testExchange(),
// },
"www.iana.org.": {
zone: "vip.icann.org.",
dnsType: dns.TypeA,
rrset: getRRSetWithoutValidation(t, "qqq.ninja.", dns.TypeA, dns.ClassINET),
exchange: testExchange(),
},
"no DNSSEC": {
zone: "github.com.",
dnsType: dns.TypeA,
rrset: getRRSetWithoutValidation(t, "github.com.", dns.TypeA, dns.ClassINET),
exchange: testExchange(),
},
"bad DNSSEC already failed by upstream": {
zone: "dnssec-failed.org.",
dnsType: dns.TypeA,
exchange: testExchange(),
errWrapped: ErrValidationFailedUpstream,
errMessage: "cannot fetch desired RRSet and RRSig: " +
"for dnssec-failed.org. IN A: " +
"DNSSEC validation might had failed upstream",
},
// "no DNSSEC": {
// zone: "github.com.",
// dnsType: dns.TypeA,
// rrset: getRRSetWithoutValidation(t, "github.com.", dns.TypeA, dns.ClassINET),
// exchange: testExchange(),
// },
// "bad DNSSEC already failed by upstream": {
// zone: "dnssec-failed.org.",
// dnsType: dns.TypeA,
// exchange: testExchange(),
// errWrapped: ErrValidationFailedUpstream,
// errMessage: "cannot fetch desired RRSet and RRSig: " +
// "for dnssec-failed.org. IN A: " +
// "DNSSEC validation might had failed upstream",
// },
}
for name, testCase := range testCases {
testCase := testCase
Expand Down
3 changes: 3 additions & 0 deletions pkg/dnssec/signedzone.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ type signedZone struct {
func dnsKeyRRSetToMap(rrset []dns.RR) (keyTagToDNSKey map[uint16]*dns.DNSKEY) {
keyTagToDNSKey = make(map[uint16]*dns.DNSKEY, len(rrset))
for _, rr := range rrset {
if rr.Header().Rrtype != dns.TypeDNSKEY {
continue
}
dnsKey := rr.(*dns.DNSKEY)
keyTagToDNSKey[dnsKey.KeyTag()] = dnsKey
}
Expand Down

0 comments on commit fbbb988

Please sign in to comment.