summaryrefslogtreecommitdiffstats
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/acceptfunc.go1
-rw-r--r--vendor/github.com/miekg/dns/dnssec.go6
-rw-r--r--vendor/github.com/miekg/dns/edns.go39
-rw-r--r--vendor/github.com/miekg/dns/msg_helpers.go31
-rw-r--r--vendor/github.com/miekg/dns/privaterr.go2
-rw-r--r--vendor/github.com/miekg/dns/scan_rr.go6
-rw-r--r--vendor/github.com/miekg/dns/svcb.go1
-rw-r--r--vendor/github.com/miekg/dns/types.go29
-rw-r--r--vendor/github.com/miekg/dns/version.go2
9 files changed, 62 insertions, 55 deletions
diff --git a/vendor/github.com/miekg/dns/acceptfunc.go b/vendor/github.com/miekg/dns/acceptfunc.go
index 825617fe21..3f29a48c48 100644
--- a/vendor/github.com/miekg/dns/acceptfunc.go
+++ b/vendor/github.com/miekg/dns/acceptfunc.go
@@ -25,6 +25,7 @@ var DefaultMsgAcceptFunc MsgAcceptFunc = defaultMsgAcceptFunc
// MsgAcceptAction represents the action to be taken.
type MsgAcceptAction int
+// Allowed returned values from a MsgAcceptFunc.
const (
MsgAccept MsgAcceptAction = iota // Accept the message
MsgReject // Reject the message with a RcodeFormatError
diff --git a/vendor/github.com/miekg/dns/dnssec.go b/vendor/github.com/miekg/dns/dnssec.go
index 7880d7a826..8539aae6c7 100644
--- a/vendor/github.com/miekg/dns/dnssec.go
+++ b/vendor/github.com/miekg/dns/dnssec.go
@@ -8,9 +8,9 @@ import (
"crypto/elliptic"
"crypto/rand"
"crypto/rsa"
- _ "crypto/sha1"
- _ "crypto/sha256"
- _ "crypto/sha512"
+ _ "crypto/sha1" // need its init function
+ _ "crypto/sha256" // need its init function
+ _ "crypto/sha512" // need its init function
"encoding/asn1"
"encoding/binary"
"encoding/hex"
diff --git a/vendor/github.com/miekg/dns/edns.go b/vendor/github.com/miekg/dns/edns.go
index 844cf92b8c..c9181783de 100644
--- a/vendor/github.com/miekg/dns/edns.go
+++ b/vendor/github.com/miekg/dns/edns.go
@@ -28,6 +28,41 @@ const (
_DO = 1 << 15 // DNSSEC OK
)
+// makeDataOpt is used to unpack the EDNS0 option(s) from a message.
+func makeDataOpt(code uint16) EDNS0 {
+ // All the EDNS0.* constants above need to be in this switch.
+ switch code {
+ case EDNS0LLQ:
+ return new(EDNS0_LLQ)
+ case EDNS0UL:
+ return new(EDNS0_UL)
+ case EDNS0NSID:
+ return new(EDNS0_NSID)
+ case EDNS0DAU:
+ return new(EDNS0_DAU)
+ case EDNS0DHU:
+ return new(EDNS0_DHU)
+ case EDNS0N3U:
+ return new(EDNS0_N3U)
+ case EDNS0SUBNET:
+ return new(EDNS0_SUBNET)
+ case EDNS0EXPIRE:
+ return new(EDNS0_EXPIRE)
+ case EDNS0COOKIE:
+ return new(EDNS0_COOKIE)
+ case EDNS0TCPKEEPALIVE:
+ return new(EDNS0_TCP_KEEPALIVE)
+ case EDNS0PADDING:
+ return new(EDNS0_PADDING)
+ case EDNS0EDE:
+ return new(EDNS0_EDE)
+ default:
+ e := new(EDNS0_LOCAL)
+ e.Code = code
+ return e
+ }
+}
+
// OPT is the EDNS0 RR appended to messages to convey extra (meta) information.
// See RFC 6891.
type OPT struct {
@@ -95,7 +130,7 @@ func (*OPT) parse(c *zlexer, origin string) *ParseError {
return &ParseError{err: "OPT records do not have a presentation format"}
}
-func (r1 *OPT) isDuplicate(r2 RR) bool { return false }
+func (rr *OPT) isDuplicate(r2 RR) bool { return false }
// return the old value -> delete SetVersion?
@@ -465,7 +500,7 @@ func (e *EDNS0_LLQ) copy() EDNS0 {
return &EDNS0_LLQ{e.Code, e.Version, e.Opcode, e.Error, e.Id, e.LeaseLife}
}
-// EDNS0_DUA implements the EDNS0 "DNSSEC Algorithm Understood" option. See RFC 6975.
+// EDNS0_DAU implements the EDNS0 "DNSSEC Algorithm Understood" option. See RFC 6975.
type EDNS0_DAU struct {
Code uint16 // Always EDNS0DAU
AlgCode []uint8
diff --git a/vendor/github.com/miekg/dns/msg_helpers.go b/vendor/github.com/miekg/dns/msg_helpers.go
index 472ada5d19..5904927ca8 100644
--- a/vendor/github.com/miekg/dns/msg_helpers.go
+++ b/vendor/github.com/miekg/dns/msg_helpers.go
@@ -438,37 +438,6 @@ Option:
return edns, off, nil
}
-func makeDataOpt(code uint16) EDNS0 {
- switch code {
- case EDNS0NSID:
- return new(EDNS0_NSID)
- case EDNS0SUBNET:
- return new(EDNS0_SUBNET)
- case EDNS0COOKIE:
- return new(EDNS0_COOKIE)
- case EDNS0EXPIRE:
- return new(EDNS0_EXPIRE)
- case EDNS0UL:
- return new(EDNS0_UL)
- case EDNS0LLQ:
- return new(EDNS0_LLQ)
- case EDNS0DAU:
- return new(EDNS0_DAU)
- case EDNS0DHU:
- return new(EDNS0_DHU)
- case EDNS0N3U:
- return new(EDNS0_N3U)
- case EDNS0PADDING:
- return new(EDNS0_PADDING)
- case EDNS0EDE:
- return new(EDNS0_EDE)
- default:
- e := new(EDNS0_LOCAL)
- e.Code = code
- return e
- }
-}
-
func packDataOpt(options []EDNS0, msg []byte, off int) (int, error) {
for _, el := range options {
b, err := el.pack()
diff --git a/vendor/github.com/miekg/dns/privaterr.go b/vendor/github.com/miekg/dns/privaterr.go
index 45c7f26d85..d256b652ea 100644
--- a/vendor/github.com/miekg/dns/privaterr.go
+++ b/vendor/github.com/miekg/dns/privaterr.go
@@ -90,7 +90,7 @@ Fetch:
return nil
}
-func (r1 *PrivateRR) isDuplicate(r2 RR) bool { return false }
+func (r *PrivateRR) isDuplicate(r2 RR) bool { return false }
// PrivateHandle registers a private resource record type. It requires
// string and numeric representation of private RR type and generator function as argument.
diff --git a/vendor/github.com/miekg/dns/scan_rr.go b/vendor/github.com/miekg/dns/scan_rr.go
index 05765aed87..e398484da9 100644
--- a/vendor/github.com/miekg/dns/scan_rr.go
+++ b/vendor/github.com/miekg/dns/scan_rr.go
@@ -734,7 +734,11 @@ func (rr *HIP) parse(c *zlexer, o string) *ParseError {
return &ParseError{"", "bad HIP PublicKey", l}
}
rr.PublicKey = l.token // This cannot contain spaces
- rr.PublicKeyLength = uint16(base64.StdEncoding.DecodedLen(len(rr.PublicKey)))
+ decodedPK, decodedPKerr := base64.StdEncoding.DecodeString(rr.PublicKey)
+ if decodedPKerr != nil {
+ return &ParseError{"", "bad HIP PublicKey", l}
+ }
+ rr.PublicKeyLength = uint16(len(decodedPK))
// RendezvousServers (if any)
l, _ = c.Next()
diff --git a/vendor/github.com/miekg/dns/svcb.go b/vendor/github.com/miekg/dns/svcb.go
index 64800daa6d..3344253c2b 100644
--- a/vendor/github.com/miekg/dns/svcb.go
+++ b/vendor/github.com/miekg/dns/svcb.go
@@ -10,6 +10,7 @@ import (
"strings"
)
+// SVCBKey is the type of the keys used in the SVCB RR.
type SVCBKey uint16
// Keys defined in draft-ietf-dnsop-svcb-https-01 Section 12.3.2.
diff --git a/vendor/github.com/miekg/dns/types.go b/vendor/github.com/miekg/dns/types.go
index 99dd315bf1..d9becb67cd 100644
--- a/vendor/github.com/miekg/dns/types.go
+++ b/vendor/github.com/miekg/dns/types.go
@@ -152,12 +152,9 @@ const (
)
// Used in ZONEMD https://tools.ietf.org/html/rfc8976
-
const (
- // ZoneMD Accepted Schemes
ZoneMDSchemeSimple = 1
- // ZoneMD Hash Algorithms
ZoneMDHashAlgSHA384 = 1
ZoneMDHashAlgSHA512 = 2
)
@@ -1416,13 +1413,13 @@ func (rr *APL) String() string {
}
// str returns presentation form of the APL prefix.
-func (p *APLPrefix) str() string {
+func (a *APLPrefix) str() string {
var sb strings.Builder
- if p.Negation {
+ if a.Negation {
sb.WriteByte('!')
}
- switch len(p.Network.IP) {
+ switch len(a.Network.IP) {
case net.IPv4len:
sb.WriteByte('1')
case net.IPv6len:
@@ -1431,20 +1428,20 @@ func (p *APLPrefix) str() string {
sb.WriteByte(':')
- switch len(p.Network.IP) {
+ switch len(a.Network.IP) {
case net.IPv4len:
- sb.WriteString(p.Network.IP.String())
+ sb.WriteString(a.Network.IP.String())
case net.IPv6len:
// add prefix for IPv4-mapped IPv6
- if v4 := p.Network.IP.To4(); v4 != nil {
+ if v4 := a.Network.IP.To4(); v4 != nil {
sb.WriteString("::ffff:")
}
- sb.WriteString(p.Network.IP.String())
+ sb.WriteString(a.Network.IP.String())
}
sb.WriteByte('/')
- prefix, _ := p.Network.Mask.Size()
+ prefix, _ := a.Network.Mask.Size()
sb.WriteString(strconv.Itoa(prefix))
return sb.String()
@@ -1458,17 +1455,17 @@ func (a *APLPrefix) equals(b *APLPrefix) bool {
}
// copy returns a copy of the APL prefix.
-func (p *APLPrefix) copy() APLPrefix {
+func (a *APLPrefix) copy() APLPrefix {
return APLPrefix{
- Negation: p.Negation,
- Network: copyNet(p.Network),
+ Negation: a.Negation,
+ Network: copyNet(a.Network),
}
}
// len returns size of the prefix in wire format.
-func (p *APLPrefix) len() int {
+func (a *APLPrefix) len() int {
// 4-byte header and the network address prefix (see Section 4 of RFC 3123)
- prefix, _ := p.Network.Mask.Size()
+ prefix, _ := a.Network.Mask.Size()
return 4 + (prefix+7)/8
}
diff --git a/vendor/github.com/miekg/dns/version.go b/vendor/github.com/miekg/dns/version.go
index 695d1e8b48..622c69a1b8 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, 42}
+var Version = v{1, 1, 43}
// v holds the version of this library.
type v struct {