[chore]: Bump github.com/miekg/dns from 1.1.58 to 1.1.59 (#2861)

This commit is contained in:
dependabot[bot] 2024-04-22 09:11:53 +00:00 committed by GitHub
parent 12a7eba01f
commit a57dd15a8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 69 additions and 29 deletions

2
go.mod
View File

@ -41,7 +41,7 @@ require (
github.com/h2non/filetype v1.1.3 github.com/h2non/filetype v1.1.3
github.com/jackc/pgx/v5 v5.5.5 github.com/jackc/pgx/v5 v5.5.5
github.com/microcosm-cc/bluemonday v1.0.26 github.com/microcosm-cc/bluemonday v1.0.26
github.com/miekg/dns v1.1.58 github.com/miekg/dns v1.1.59
github.com/minio/minio-go/v7 v7.0.69 github.com/minio/minio-go/v7 v7.0.69
github.com/mitchellh/mapstructure v1.5.0 github.com/mitchellh/mapstructure v1.5.0
github.com/oklog/ulid v1.3.1 github.com/oklog/ulid v1.3.1

4
go.sum
View File

@ -485,8 +485,8 @@ github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvls
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k=
github.com/microcosm-cc/bluemonday v1.0.26 h1:xbqSvqzQMeEHCqMi64VAs4d8uy6Mequs3rQ0k/Khz58= github.com/microcosm-cc/bluemonday v1.0.26 h1:xbqSvqzQMeEHCqMi64VAs4d8uy6Mequs3rQ0k/Khz58=
github.com/microcosm-cc/bluemonday v1.0.26/go.mod h1:JyzOCs9gkyQyjs+6h10UEVSe02CGwkhd72Xdqh78TWs= github.com/microcosm-cc/bluemonday v1.0.26/go.mod h1:JyzOCs9gkyQyjs+6h10UEVSe02CGwkhd72Xdqh78TWs=
github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= github.com/miekg/dns v1.1.59 h1:C9EXc/UToRwKLhK5wKU/I4QVsBUc8kE6MkHBkeypWZs=
github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY= github.com/miekg/dns v1.1.59/go.mod h1:nZpewl5p6IvctfgrckopVx2OlSEHPRO/U4SYkRklrEk=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
github.com/minio/minio-go/v7 v7.0.69 h1:l8AnsQFyY1xiwa/DaQskY4NXSLA2yrGsW5iD9nRPVS0= github.com/minio/minio-go/v7 v7.0.69 h1:l8AnsQFyY1xiwa/DaQskY4NXSLA2yrGsW5iD9nRPVS0=

View File

@ -83,6 +83,8 @@ A not-so-up-to-date-list-that-may-be-actually-current:
* https://github.com/egbakou/domainverifier * https://github.com/egbakou/domainverifier
* https://github.com/semihalev/sdns * https://github.com/semihalev/sdns
* https://github.com/wintbiit/NineDNS * https://github.com/wintbiit/NineDNS
* https://linuxcontainers.org/incus/
* https://ifconfig.es
Send pull request if you want to be listed here. Send pull request if you want to be listed here.

View File

@ -198,10 +198,12 @@ func IsDomainName(s string) (labels int, ok bool) {
off int off int
begin int begin int
wasDot bool wasDot bool
escape bool
) )
for i := 0; i < len(s); i++ { for i := 0; i < len(s); i++ {
switch s[i] { switch s[i] {
case '\\': case '\\':
escape = !escape
if off+1 > lenmsg { if off+1 > lenmsg {
return labels, false return labels, false
} }
@ -217,6 +219,7 @@ func IsDomainName(s string) (labels int, ok bool) {
wasDot = false wasDot = false
case '.': case '.':
escape = false
if i == 0 && len(s) > 1 { if i == 0 && len(s) > 1 {
// leading dots are not legal except for the root zone // leading dots are not legal except for the root zone
return labels, false return labels, false
@ -243,10 +246,13 @@ func IsDomainName(s string) (labels int, ok bool) {
labels++ labels++
begin = i + 1 begin = i + 1
default: default:
escape = false
wasDot = false wasDot = false
} }
} }
if escape {
return labels, false
}
return labels, true return labels, true
} }

2
vendor/github.com/miekg/dns/msg.go generated vendored
View File

@ -714,7 +714,7 @@ func (h *MsgHdr) String() string {
return s return s
} }
// Pack packs a Msg: it is converted to to wire format. // Pack packs a Msg: it is converted to wire format.
// If the dns.Compress is true the message will be in compressed wire format. // If the dns.Compress is true the message will be in compressed wire format.
func (dns *Msg) Pack() (msg []byte, err error) { func (dns *Msg) Pack() (msg []byte, err error) {
return dns.PackBuffer(nil) return dns.PackBuffer(nil)

11
vendor/github.com/miekg/dns/scan.go generated vendored
View File

@ -101,12 +101,13 @@ type ttlState struct {
isByDirective bool // isByDirective indicates whether ttl was set by a $TTL directive isByDirective bool // isByDirective indicates whether ttl was set by a $TTL directive
} }
// NewRR reads the RR contained in the string s. Only the first RR is returned. // NewRR reads a string s and returns the first RR.
// If s contains no records, NewRR will return nil with no error. // If s contains no records, NewRR will return nil with no error.
// //
// The class defaults to IN and TTL defaults to 3600. The full zone file syntax // The class defaults to IN, TTL defaults to 3600, and
// like $TTL, $ORIGIN, etc. is supported. All fields of the returned RR are // origin for resolving relative domain names defaults to the DNS root (.).
// set, except RR.Header().Rdlength which is set to 0. // Full zone file syntax is supported, including directives like $TTL and $ORIGIN.
// All fields of the returned RR are set from the read data, except RR.Header().Rdlength which is set to 0.
func NewRR(s string) (RR, error) { func NewRR(s string) (RR, error) {
if len(s) > 0 && s[len(s)-1] != '\n' { // We need a closing newline if len(s) > 0 && s[len(s)-1] != '\n' { // We need a closing newline
return ReadRR(strings.NewReader(s+"\n"), "") return ReadRR(strings.NewReader(s+"\n"), "")
@ -1282,7 +1283,7 @@ func stringToCm(token string) (e, m uint8, ok bool) {
cmeters *= 10 cmeters *= 10
} }
} }
// This slighly ugly condition will allow omitting the 'meter' part, like .01 (meaning 0.01m = 1cm). // This slightly ugly condition will allow omitting the 'meter' part, like .01 (meaning 0.01m = 1cm).
if !hasCM || mStr != "" { if !hasCM || mStr != "" {
meters, err = strconv.Atoi(mStr) meters, err = strconv.Atoi(mStr)
// RFC1876 states the max value is 90000000.00. The latter two conditions enforce it. // RFC1876 states the max value is 90000000.00. The latter two conditions enforce it.

View File

@ -51,25 +51,21 @@ func endingToTxtSlice(c *zlexer, errstr string) ([]string, *ParseError) {
switch l.value { switch l.value {
case zString: case zString:
empty = false empty = false
if len(l.token) > 255 {
// split up tokens that are larger than 255 into 255-chunks // split up tokens that are larger than 255 into 255-chunks
sx := []string{} sx := []string{}
p, i := 0, 255 p := 0
for { for {
if i <= len(l.token) { i := escapedStringOffset(l.token[p:], 255)
sx = append(sx, l.token[p:i]) if i != -1 && p+i != len(l.token) {
sx = append(sx, l.token[p:p+i])
} else { } else {
sx = append(sx, l.token[p:]) sx = append(sx, l.token[p:])
break break
} }
p, i = p+255, i+255 p += i
} }
s = append(s, sx...) s = append(s, sx...)
break
}
s = append(s, l.token)
case zBlank: case zBlank:
if quote { if quote {
// zBlank can only be seen in between txt parts. // zBlank can only be seen in between txt parts.
@ -1920,3 +1916,32 @@ func (rr *APL) parse(c *zlexer, o string) *ParseError {
rr.Prefixes = prefixes rr.Prefixes = prefixes
return nil return nil
} }
// escapedStringOffset finds the offset within a string (which may contain escape
// sequences) that corresponds to a certain byte offset. If the input offset is
// out of bounds, -1 is returned.
func escapedStringOffset(s string, byteOffset int) int {
if byteOffset == 0 {
return 0
}
offset := 0
for i := 0; i < len(s); i++ {
offset += 1
// Skip escape sequences
if s[i] != '\\' {
// Not an escape sequence; nothing to do.
} else if isDDD(s[i+1:]) {
i += 3
} else {
i++
}
if offset >= byteOffset {
return i + 1
}
}
return -1
}

8
vendor/github.com/miekg/dns/xfr.go generated vendored
View File

@ -1,6 +1,7 @@
package dns package dns
import ( import (
"crypto/tls"
"fmt" "fmt"
"time" "time"
) )
@ -20,6 +21,7 @@ type Transfer struct {
TsigProvider TsigProvider // An implementation of the TsigProvider interface. If defined it replaces TsigSecret and is used for all TSIG operations. TsigProvider TsigProvider // An implementation of the TsigProvider interface. If defined it replaces TsigSecret and is used for all TSIG operations.
TsigSecret map[string]string // Secret(s) for Tsig map[<zonename>]<base64 secret>, zonename must be in canonical form (lowercase, fqdn, see RFC 4034 Section 6.2) TsigSecret map[string]string // Secret(s) for Tsig map[<zonename>]<base64 secret>, zonename must be in canonical form (lowercase, fqdn, see RFC 4034 Section 6.2)
tsigTimersOnly bool tsigTimersOnly bool
TLS *tls.Config // TLS config. If Xfr over TLS will be attempted
} }
func (t *Transfer) tsigProvider() TsigProvider { func (t *Transfer) tsigProvider() TsigProvider {
@ -57,7 +59,11 @@ func (t *Transfer) In(q *Msg, a string) (env chan *Envelope, err error) {
} }
if t.Conn == nil { if t.Conn == nil {
if t.TLS != nil {
t.Conn, err = DialTimeoutWithTLS("tcp-tls", a, t.TLS, timeout)
} else {
t.Conn, err = DialTimeout("tcp", a, timeout) t.Conn, err = DialTimeout("tcp", a, timeout)
}
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -182,7 +188,7 @@ func (t *Transfer) inIxfr(q *Msg, c chan *Envelope) {
if v, ok := rr.(*SOA); ok { if v, ok := rr.(*SOA); ok {
if v.Serial == serial { if v.Serial == serial {
n++ n++
// quit if it's a full axfr or the the servers' SOA is repeated the third time // quit if it's a full axfr or the servers' SOA is repeated the third time
if axfr && n == 2 || n == 3 { if axfr && n == 2 || n == 3 {
c <- &Envelope{in.Answer, nil} c <- &Envelope{in.Answer, nil}
return return

2
vendor/modules.txt vendored
View File

@ -476,7 +476,7 @@ github.com/matttproud/golang_protobuf_extensions/v2/pbutil
## explicit; go 1.21 ## explicit; go 1.21
github.com/microcosm-cc/bluemonday github.com/microcosm-cc/bluemonday
github.com/microcosm-cc/bluemonday/css github.com/microcosm-cc/bluemonday/css
# github.com/miekg/dns v1.1.58 # github.com/miekg/dns v1.1.59
## explicit; go 1.19 ## explicit; go 1.19
github.com/miekg/dns github.com/miekg/dns
# github.com/minio/md5-simd v1.1.2 # github.com/minio/md5-simd v1.1.2