summaryrefslogtreecommitdiff
path: root/vendor/github.com/miekg
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/miekg')
-rw-r--r--vendor/github.com/miekg/dns/README.md1
-rw-r--r--vendor/github.com/miekg/dns/msg.go26
-rw-r--r--vendor/github.com/miekg/dns/reverse.go5
-rw-r--r--vendor/github.com/miekg/dns/scan.go7
-rw-r--r--vendor/github.com/miekg/dns/types.go67
-rw-r--r--vendor/github.com/miekg/dns/version.go2
-rw-r--r--vendor/github.com/miekg/dns/xfr.go7
7 files changed, 72 insertions, 43 deletions
diff --git a/vendor/github.com/miekg/dns/README.md b/vendor/github.com/miekg/dns/README.md
index 0e42858ae..54471f5c2 100644
--- a/vendor/github.com/miekg/dns/README.md
+++ b/vendor/github.com/miekg/dns/README.md
@@ -185,6 +185,7 @@ Example programs can be found in the `github.com/miekg/exdns` repository.
* 7871 - EDNS0 Client Subnet
* 7873 - Domain Name System (DNS) Cookies
* 8080 - EdDSA for DNSSEC
+* 8490 - DNS Stateful Operations
* 8499 - DNS Terminology
* 8659 - DNS Certification Authority Authorization (CAA) Resource Record
* 8777 - DNS Reverse IP Automatic Multicast Tunneling (AMT) Discovery
diff --git a/vendor/github.com/miekg/dns/msg.go b/vendor/github.com/miekg/dns/msg.go
index 5fa7f9e83..d87b5323b 100644
--- a/vendor/github.com/miekg/dns/msg.go
+++ b/vendor/github.com/miekg/dns/msg.go
@@ -136,18 +136,19 @@ var OpcodeToString = map[int]string{
// RcodeToString maps Rcodes to strings.
var RcodeToString = map[int]string{
- RcodeSuccess: "NOERROR",
- RcodeFormatError: "FORMERR",
- RcodeServerFailure: "SERVFAIL",
- RcodeNameError: "NXDOMAIN",
- RcodeNotImplemented: "NOTIMP",
- RcodeRefused: "REFUSED",
- RcodeYXDomain: "YXDOMAIN", // See RFC 2136
- RcodeYXRrset: "YXRRSET",
- RcodeNXRrset: "NXRRSET",
- RcodeNotAuth: "NOTAUTH",
- RcodeNotZone: "NOTZONE",
- RcodeBadSig: "BADSIG", // Also known as RcodeBadVers, see RFC 6891
+ RcodeSuccess: "NOERROR",
+ RcodeFormatError: "FORMERR",
+ RcodeServerFailure: "SERVFAIL",
+ RcodeNameError: "NXDOMAIN",
+ RcodeNotImplemented: "NOTIMP",
+ RcodeRefused: "REFUSED",
+ RcodeYXDomain: "YXDOMAIN", // See RFC 2136
+ RcodeYXRrset: "YXRRSET",
+ RcodeNXRrset: "NXRRSET",
+ RcodeNotAuth: "NOTAUTH",
+ RcodeNotZone: "NOTZONE",
+ RcodeStatefulTypeNotImplemented: "DSOTYPENI",
+ RcodeBadSig: "BADSIG", // Also known as RcodeBadVers, see RFC 6891
// RcodeBadVers: "BADVERS",
RcodeBadKey: "BADKEY",
RcodeBadTime: "BADTIME",
@@ -874,7 +875,6 @@ func (dns *Msg) unpack(dh Header, msg []byte, off int) (err error) {
// // println("dns: extra bytes in dns packet", off, "<", len(msg))
// }
return err
-
}
// Unpack unpacks a binary message to a Msg structure.
diff --git a/vendor/github.com/miekg/dns/reverse.go b/vendor/github.com/miekg/dns/reverse.go
index 28151af83..6f5b3ea70 100644
--- a/vendor/github.com/miekg/dns/reverse.go
+++ b/vendor/github.com/miekg/dns/reverse.go
@@ -23,9 +23,12 @@ var StringToAlgorithm = reverseInt8(AlgorithmToString)
// StringToHash is a map of names to hash IDs.
var StringToHash = reverseInt8(HashToString)
-// StringToCertType is the reverseof CertTypeToString.
+// StringToCertType is the reverse of CertTypeToString.
var StringToCertType = reverseInt16(CertTypeToString)
+// StringToStatefulType is the reverse of StatefulTypeToString.
+var StringToStatefulType = reverseInt16(StatefulTypeToString)
+
// Reverse a map
func reverseInt8(m map[uint8]string) map[string]uint8 {
n := make(map[string]uint8, len(m))
diff --git a/vendor/github.com/miekg/dns/scan.go b/vendor/github.com/miekg/dns/scan.go
index fa8a332ed..31957b2ea 100644
--- a/vendor/github.com/miekg/dns/scan.go
+++ b/vendor/github.com/miekg/dns/scan.go
@@ -1318,6 +1318,13 @@ func toAbsoluteName(name, origin string) (absolute string, ok bool) {
return origin, true
}
+ // this can happen when we have a comment after a RR that has a domain, '... MX 20 ; this is wrong'.
+ // technically a newline can be in a domain name, but this is clearly an error and the newline only shows
+ // because of the scanning and the comment.
+ if name == "\n" {
+ return "", false
+ }
+
// require a valid domain name
_, ok = IsDomainName(name)
if !ok || name == "" {
diff --git a/vendor/github.com/miekg/dns/types.go b/vendor/github.com/miekg/dns/types.go
index e39cf2fec..f5067cd43 100644
--- a/vendor/github.com/miekg/dns/types.go
+++ b/vendor/github.com/miekg/dns/types.go
@@ -126,33 +126,35 @@ const (
ClassANY = 255
// Message Response Codes, see https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml
- RcodeSuccess = 0 // NoError - No Error [DNS]
- RcodeFormatError = 1 // FormErr - Format Error [DNS]
- RcodeServerFailure = 2 // ServFail - Server Failure [DNS]
- RcodeNameError = 3 // NXDomain - Non-Existent Domain [DNS]
- RcodeNotImplemented = 4 // NotImp - Not Implemented [DNS]
- RcodeRefused = 5 // Refused - Query Refused [DNS]
- RcodeYXDomain = 6 // YXDomain - Name Exists when it should not [DNS Update]
- RcodeYXRrset = 7 // YXRRSet - RR Set Exists when it should not [DNS Update]
- RcodeNXRrset = 8 // NXRRSet - RR Set that should exist does not [DNS Update]
- RcodeNotAuth = 9 // NotAuth - Server Not Authoritative for zone [DNS Update]
- RcodeNotZone = 10 // NotZone - Name not contained in zone [DNS Update/TSIG]
- RcodeBadSig = 16 // BADSIG - TSIG Signature Failure [TSIG] https://www.rfc-editor.org/rfc/rfc6895.html#section-2.3
- RcodeBadVers = 16 // BADVERS - Bad OPT Version [EDNS0] https://www.rfc-editor.org/rfc/rfc6895.html#section-2.3
- RcodeBadKey = 17 // BADKEY - Key not recognized [TSIG]
- RcodeBadTime = 18 // BADTIME - Signature out of time window [TSIG]
- RcodeBadMode = 19 // BADMODE - Bad TKEY Mode [TKEY]
- RcodeBadName = 20 // BADNAME - Duplicate key name [TKEY]
- RcodeBadAlg = 21 // BADALG - Algorithm not supported [TKEY]
- RcodeBadTrunc = 22 // BADTRUNC - Bad Truncation [TSIG]
- RcodeBadCookie = 23 // BADCOOKIE - Bad/missing Server Cookie [DNS Cookies]
+ RcodeSuccess = 0 // NoError - No Error [DNS]
+ RcodeFormatError = 1 // FormErr - Format Error [DNS]
+ RcodeServerFailure = 2 // ServFail - Server Failure [DNS]
+ RcodeNameError = 3 // NXDomain - Non-Existent Domain [DNS]
+ RcodeNotImplemented = 4 // NotImp - Not Implemented [DNS]
+ RcodeRefused = 5 // Refused - Query Refused [DNS]
+ RcodeYXDomain = 6 // YXDomain - Name Exists when it should not [DNS Update]
+ RcodeYXRrset = 7 // YXRRSet - RR Set Exists when it should not [DNS Update]
+ RcodeNXRrset = 8 // NXRRSet - RR Set that should exist does not [DNS Update]
+ RcodeNotAuth = 9 // NotAuth - Server Not Authoritative for zone [DNS Update]
+ RcodeNotZone = 10 // NotZone - Name not contained in zone [DNS Update/TSIG]
+ RcodeStatefulTypeNotImplemented = 11 // DSOTypeNI - DSO-TYPE not implemented [DNS Stateful Operations] https://www.rfc-editor.org/rfc/rfc8490.html#section-10.2
+ RcodeBadSig = 16 // BADSIG - TSIG Signature Failure [TSIG] https://www.rfc-editor.org/rfc/rfc6895.html#section-2.3
+ RcodeBadVers = 16 // BADVERS - Bad OPT Version [EDNS0] https://www.rfc-editor.org/rfc/rfc6895.html#section-2.3
+ RcodeBadKey = 17 // BADKEY - Key not recognized [TSIG]
+ RcodeBadTime = 18 // BADTIME - Signature out of time window [TSIG]
+ RcodeBadMode = 19 // BADMODE - Bad TKEY Mode [TKEY]
+ RcodeBadName = 20 // BADNAME - Duplicate key name [TKEY]
+ RcodeBadAlg = 21 // BADALG - Algorithm not supported [TKEY]
+ RcodeBadTrunc = 22 // BADTRUNC - Bad Truncation [TSIG]
+ RcodeBadCookie = 23 // BADCOOKIE - Bad/missing Server Cookie [DNS Cookies]
// Message Opcodes. There is no 3.
- OpcodeQuery = 0
- OpcodeIQuery = 1
- OpcodeStatus = 2
- OpcodeNotify = 4
- OpcodeUpdate = 5
+ OpcodeQuery = 0
+ OpcodeIQuery = 1
+ OpcodeStatus = 2
+ OpcodeNotify = 4
+ OpcodeUpdate = 5
+ OpcodeStateful = 6
)
// Used in ZONEMD https://tools.ietf.org/html/rfc8976
@@ -179,6 +181,19 @@ const (
AMTRELAYHost = IPSECGatewayHost
)
+// Stateful types as defined in RFC 8490.
+const (
+ StatefulTypeKeepAlive uint16 = iota + 1
+ StatefulTypeRetryDelay
+ StatefulTypeEncryptionPadding
+)
+
+var StatefulTypeToString = map[uint16]string{
+ StatefulTypeKeepAlive: "KeepAlive",
+ StatefulTypeRetryDelay: "RetryDelay",
+ StatefulTypeEncryptionPadding: "EncryptionPadding",
+}
+
// Header is the wire format for the DNS packet header.
type Header struct {
Id uint16
@@ -886,7 +901,7 @@ func (rr *LOC) String() string {
lon = lon % LOC_HOURS
s += fmt.Sprintf("%02d %02d %0.3f %s ", h, m, float64(lon)/1000, ew)
- var alt = float64(rr.Altitude) / 100
+ alt := float64(rr.Altitude) / 100
alt -= LOC_ALTITUDEBASE
if rr.Altitude%100 != 0 {
s += fmt.Sprintf("%.2fm ", alt)
diff --git a/vendor/github.com/miekg/dns/version.go b/vendor/github.com/miekg/dns/version.go
index 73e34edc3..936dc2124 100644
--- a/vendor/github.com/miekg/dns/version.go
+++ b/vendor/github.com/miekg/dns/version.go
@@ -3,7 +3,7 @@ package dns
import "fmt"
// Version is current version of this library.
-var Version = v{1, 1, 65}
+var Version = v{1, 1, 66}
// v holds the version of this library.
type v struct {
diff --git a/vendor/github.com/miekg/dns/xfr.go b/vendor/github.com/miekg/dns/xfr.go
index 5cfbb516a..97a642471 100644
--- a/vendor/github.com/miekg/dns/xfr.go
+++ b/vendor/github.com/miekg/dns/xfr.go
@@ -251,10 +251,13 @@ func (t *Transfer) ReadMsg() (*Msg, error) {
if err := m.Unpack(p); err != nil {
return nil, err
}
- if ts, tp := m.IsTsig(), t.tsigProvider(); ts != nil && tp != nil {
+
+ if tp := t.tsigProvider(); tp != nil {
// Need to work on the original message p, as that was used to calculate the tsig.
err = TsigVerifyWithProvider(p, tp, t.tsigRequestMAC, t.tsigTimersOnly)
- t.tsigRequestMAC = ts.MAC
+ if ts := m.IsTsig(); ts != nil {
+ t.tsigRequestMAC = ts.MAC
+ }
}
return m, err
}