[chore]: Bump github.com/miekg/dns from 1.1.57 to 1.1.58 (#2606)
This commit is contained in:
parent
d59cba487f
commit
3cc51d5072
2
go.mod
2
go.mod
|
@ -38,7 +38,7 @@ require (
|
||||||
github.com/h2non/filetype v1.1.3
|
github.com/h2non/filetype v1.1.3
|
||||||
github.com/jackc/pgx/v5 v5.5.2
|
github.com/jackc/pgx/v5 v5.5.2
|
||||||
github.com/microcosm-cc/bluemonday v1.0.26
|
github.com/microcosm-cc/bluemonday v1.0.26
|
||||||
github.com/miekg/dns v1.1.57
|
github.com/miekg/dns v1.1.58
|
||||||
github.com/minio/minio-go/v7 v7.0.66
|
github.com/minio/minio-go/v7 v7.0.66
|
||||||
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
4
go.sum
|
@ -379,8 +379,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.57 h1:Jzi7ApEIzwEPLHWRcafCN9LZSBbqQpxjt/wpgvg7wcM=
|
github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4=
|
||||||
github.com/miekg/dns v1.1.57/go.mod h1:uqRjCRUuEAA6qsOiJvDd+CFo/vW+y5WR6SNmHE55hZk=
|
github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY=
|
||||||
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.66 h1:bnTOXOHjOqv/gcMuiVbN9o2ngRItvqE774dG9nq0Dzw=
|
github.com/minio/minio-go/v7 v7.0.66 h1:bnTOXOHjOqv/gcMuiVbN9o2ngRItvqE774dG9nq0Dzw=
|
||||||
|
|
|
@ -82,6 +82,7 @@ A not-so-up-to-date-list-that-may-be-actually-current:
|
||||||
* https://dnscheck.tools/
|
* https://dnscheck.tools/
|
||||||
* 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
|
||||||
|
|
||||||
|
|
||||||
Send pull request if you want to be listed here.
|
Send pull request if you want to be listed here.
|
||||||
|
@ -125,6 +126,7 @@ Example programs can be found in the `github.com/miekg/exdns` repository.
|
||||||
*all of them*
|
*all of them*
|
||||||
|
|
||||||
* 103{4,5} - DNS standard
|
* 103{4,5} - DNS standard
|
||||||
|
* 1183 - ISDN, X25 and other deprecated records
|
||||||
* 1348 - NSAP record (removed the record)
|
* 1348 - NSAP record (removed the record)
|
||||||
* 1982 - Serial Arithmetic
|
* 1982 - Serial Arithmetic
|
||||||
* 1876 - LOC record
|
* 1876 - LOC record
|
||||||
|
|
|
@ -160,7 +160,7 @@ func parseKey(r io.Reader, file string) (map[string]string, error) {
|
||||||
k = l.token
|
k = l.token
|
||||||
case zValue:
|
case zValue:
|
||||||
if k == "" {
|
if k == "" {
|
||||||
return nil, &ParseError{file, "no private key seen", l}
|
return nil, &ParseError{file: file, err: "no private key seen", lex: l}
|
||||||
}
|
}
|
||||||
|
|
||||||
m[strings.ToLower(k)] = l.token
|
m[strings.ToLower(k)] = l.token
|
||||||
|
|
|
@ -116,7 +116,7 @@ func (r *generateReader) parseError(msg string, end int) *ParseError {
|
||||||
l.token = r.s[r.si-1 : end]
|
l.token = r.s[r.si-1 : end]
|
||||||
l.column += r.si // l.column starts one zBLANK before r.s
|
l.column += r.si // l.column starts one zBLANK before r.s
|
||||||
|
|
||||||
return &ParseError{r.file, msg, l}
|
return &ParseError{file: r.file, err: msg, lex: l}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *generateReader) Read(p []byte) (int, error) {
|
func (r *generateReader) Read(p []byte) (int, error) {
|
||||||
|
|
|
@ -84,7 +84,7 @@ Fetch:
|
||||||
|
|
||||||
err := r.Data.Parse(text)
|
err := r.Data.Parse(text)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &ParseError{"", err.Error(), l}
|
return &ParseError{wrappedErr: err, lex: l}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -4,7 +4,9 @@ import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"io/fs"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -66,6 +68,7 @@ const (
|
||||||
type ParseError struct {
|
type ParseError struct {
|
||||||
file string
|
file string
|
||||||
err string
|
err string
|
||||||
|
wrappedErr error
|
||||||
lex lex
|
lex lex
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,11 +76,16 @@ func (e *ParseError) Error() (s string) {
|
||||||
if e.file != "" {
|
if e.file != "" {
|
||||||
s = e.file + ": "
|
s = e.file + ": "
|
||||||
}
|
}
|
||||||
|
if e.err == "" && e.wrappedErr != nil {
|
||||||
|
e.err = e.wrappedErr.Error()
|
||||||
|
}
|
||||||
s += "dns: " + e.err + ": " + strconv.QuoteToASCII(e.lex.token) + " at line: " +
|
s += "dns: " + e.err + ": " + strconv.QuoteToASCII(e.lex.token) + " at line: " +
|
||||||
strconv.Itoa(e.lex.line) + ":" + strconv.Itoa(e.lex.column)
|
strconv.Itoa(e.lex.line) + ":" + strconv.Itoa(e.lex.column)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (e *ParseError) Unwrap() error { return e.wrappedErr }
|
||||||
|
|
||||||
type lex struct {
|
type lex struct {
|
||||||
token string // text of the token
|
token string // text of the token
|
||||||
err bool // when true, token text has lexer error
|
err bool // when true, token text has lexer error
|
||||||
|
@ -169,7 +177,8 @@ type ZoneParser struct {
|
||||||
// Next, by calling subNext, forwards the resulting RRs from this
|
// Next, by calling subNext, forwards the resulting RRs from this
|
||||||
// sub parser to the calling code.
|
// sub parser to the calling code.
|
||||||
sub *ZoneParser
|
sub *ZoneParser
|
||||||
osFile *os.File
|
r io.Reader
|
||||||
|
fsys fs.FS
|
||||||
|
|
||||||
includeDepth uint8
|
includeDepth uint8
|
||||||
|
|
||||||
|
@ -188,7 +197,7 @@ func NewZoneParser(r io.Reader, origin, file string) *ZoneParser {
|
||||||
if origin != "" {
|
if origin != "" {
|
||||||
origin = Fqdn(origin)
|
origin = Fqdn(origin)
|
||||||
if _, ok := IsDomainName(origin); !ok {
|
if _, ok := IsDomainName(origin); !ok {
|
||||||
pe = &ParseError{file, "bad initial origin name", lex{}}
|
pe = &ParseError{file: file, err: "bad initial origin name"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,6 +229,24 @@ func (zp *ZoneParser) SetIncludeAllowed(v bool) {
|
||||||
zp.includeAllowed = v
|
zp.includeAllowed = v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetIncludeFS provides an [fs.FS] to use when looking for the target of
|
||||||
|
// $INCLUDE directives. ($INCLUDE must still be enabled separately by calling
|
||||||
|
// [ZoneParser.SetIncludeAllowed].) If fsys is nil, [os.Open] will be used.
|
||||||
|
//
|
||||||
|
// When fsys is an on-disk FS, the ability of $INCLUDE to reach files from
|
||||||
|
// outside its root directory depends upon the FS implementation. For
|
||||||
|
// instance, [os.DirFS] will refuse to open paths like "../../etc/passwd",
|
||||||
|
// however it will still follow links which may point anywhere on the system.
|
||||||
|
//
|
||||||
|
// FS paths are slash-separated on all systems, even Windows. $INCLUDE paths
|
||||||
|
// containing other characters such as backslash and colon may be accepted as
|
||||||
|
// valid, but those characters will never be interpreted by an FS
|
||||||
|
// implementation as path element separators. See [fs.ValidPath] for more
|
||||||
|
// details.
|
||||||
|
func (zp *ZoneParser) SetIncludeFS(fsys fs.FS) {
|
||||||
|
zp.fsys = fsys
|
||||||
|
}
|
||||||
|
|
||||||
// Err returns the first non-EOF error that was encountered by the
|
// Err returns the first non-EOF error that was encountered by the
|
||||||
// ZoneParser.
|
// ZoneParser.
|
||||||
func (zp *ZoneParser) Err() error {
|
func (zp *ZoneParser) Err() error {
|
||||||
|
@ -237,7 +264,7 @@ func (zp *ZoneParser) Err() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (zp *ZoneParser) setParseError(err string, l lex) (RR, bool) {
|
func (zp *ZoneParser) setParseError(err string, l lex) (RR, bool) {
|
||||||
zp.parseErr = &ParseError{zp.file, err, l}
|
zp.parseErr = &ParseError{file: zp.file, err: err, lex: l}
|
||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,9 +287,11 @@ func (zp *ZoneParser) subNext() (RR, bool) {
|
||||||
return rr, true
|
return rr, true
|
||||||
}
|
}
|
||||||
|
|
||||||
if zp.sub.osFile != nil {
|
if zp.sub.r != nil {
|
||||||
zp.sub.osFile.Close()
|
if c, ok := zp.sub.r.(io.Closer); ok {
|
||||||
zp.sub.osFile = nil
|
c.Close()
|
||||||
|
}
|
||||||
|
zp.sub.r = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if zp.sub.Err() != nil {
|
if zp.sub.Err() != nil {
|
||||||
|
@ -402,24 +431,44 @@ func (zp *ZoneParser) Next() (RR, bool) {
|
||||||
|
|
||||||
// Start with the new file
|
// Start with the new file
|
||||||
includePath := l.token
|
includePath := l.token
|
||||||
|
var r1 io.Reader
|
||||||
|
var e1 error
|
||||||
|
if zp.fsys != nil {
|
||||||
|
// fs.FS always uses / as separator, even on Windows, so use
|
||||||
|
// path instead of filepath here:
|
||||||
|
if !path.IsAbs(includePath) {
|
||||||
|
includePath = path.Join(path.Dir(zp.file), includePath)
|
||||||
|
}
|
||||||
|
|
||||||
|
// os.DirFS, and probably others, expect all paths to be
|
||||||
|
// relative, so clean the path and remove leading / if
|
||||||
|
// present:
|
||||||
|
includePath = strings.TrimLeft(path.Clean(includePath), "/")
|
||||||
|
|
||||||
|
r1, e1 = zp.fsys.Open(includePath)
|
||||||
|
} else {
|
||||||
if !filepath.IsAbs(includePath) {
|
if !filepath.IsAbs(includePath) {
|
||||||
includePath = filepath.Join(filepath.Dir(zp.file), includePath)
|
includePath = filepath.Join(filepath.Dir(zp.file), includePath)
|
||||||
}
|
}
|
||||||
|
r1, e1 = os.Open(includePath)
|
||||||
r1, e1 := os.Open(includePath)
|
}
|
||||||
if e1 != nil {
|
if e1 != nil {
|
||||||
var as string
|
var as string
|
||||||
if !filepath.IsAbs(l.token) {
|
if includePath != l.token {
|
||||||
as = fmt.Sprintf(" as `%s'", includePath)
|
as = fmt.Sprintf(" as `%s'", includePath)
|
||||||
}
|
}
|
||||||
|
zp.parseErr = &ParseError{
|
||||||
msg := fmt.Sprintf("failed to open `%s'%s: %v", l.token, as, e1)
|
file: zp.file,
|
||||||
return zp.setParseError(msg, l)
|
wrappedErr: fmt.Errorf("failed to open `%s'%s: %w", l.token, as, e1),
|
||||||
|
lex: l,
|
||||||
|
}
|
||||||
|
return nil, false
|
||||||
}
|
}
|
||||||
|
|
||||||
zp.sub = NewZoneParser(r1, neworigin, includePath)
|
zp.sub = NewZoneParser(r1, neworigin, includePath)
|
||||||
zp.sub.defttl, zp.sub.includeDepth, zp.sub.osFile = zp.defttl, zp.includeDepth+1, r1
|
zp.sub.defttl, zp.sub.includeDepth, zp.sub.r = zp.defttl, zp.includeDepth+1, r1
|
||||||
zp.sub.SetIncludeAllowed(true)
|
zp.sub.SetIncludeAllowed(true)
|
||||||
|
zp.sub.SetIncludeFS(zp.fsys)
|
||||||
return zp.subNext()
|
return zp.subNext()
|
||||||
case zExpectDirTTLBl:
|
case zExpectDirTTLBl:
|
||||||
if l.value != zBlank {
|
if l.value != zBlank {
|
||||||
|
@ -1326,12 +1375,12 @@ func slurpRemainder(c *zlexer) *ParseError {
|
||||||
case zBlank:
|
case zBlank:
|
||||||
l, _ = c.Next()
|
l, _ = c.Next()
|
||||||
if l.value != zNewline && l.value != zEOF {
|
if l.value != zNewline && l.value != zEOF {
|
||||||
return &ParseError{"", "garbage after rdata", l}
|
return &ParseError{err: "garbage after rdata", lex: l}
|
||||||
}
|
}
|
||||||
case zNewline:
|
case zNewline:
|
||||||
case zEOF:
|
case zEOF:
|
||||||
default:
|
default:
|
||||||
return &ParseError{"", "garbage after rdata", l}
|
return &ParseError{err: "garbage after rdata", lex: l}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -1340,16 +1389,16 @@ func slurpRemainder(c *zlexer) *ParseError {
|
||||||
// Used for NID and L64 record.
|
// Used for NID and L64 record.
|
||||||
func stringToNodeID(l lex) (uint64, *ParseError) {
|
func stringToNodeID(l lex) (uint64, *ParseError) {
|
||||||
if len(l.token) < 19 {
|
if len(l.token) < 19 {
|
||||||
return 0, &ParseError{l.token, "bad NID/L64 NodeID/Locator64", l}
|
return 0, &ParseError{file: l.token, err: "bad NID/L64 NodeID/Locator64", lex: l}
|
||||||
}
|
}
|
||||||
// There must be three colons at fixes positions, if not its a parse error
|
// There must be three colons at fixes positions, if not its a parse error
|
||||||
if l.token[4] != ':' && l.token[9] != ':' && l.token[14] != ':' {
|
if l.token[4] != ':' && l.token[9] != ':' && l.token[14] != ':' {
|
||||||
return 0, &ParseError{l.token, "bad NID/L64 NodeID/Locator64", l}
|
return 0, &ParseError{file: l.token, err: "bad NID/L64 NodeID/Locator64", lex: l}
|
||||||
}
|
}
|
||||||
s := l.token[0:4] + l.token[5:9] + l.token[10:14] + l.token[15:19]
|
s := l.token[0:4] + l.token[5:9] + l.token[10:14] + l.token[15:19]
|
||||||
u, err := strconv.ParseUint(s, 16, 64)
|
u, err := strconv.ParseUint(s, 16, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, &ParseError{l.token, "bad NID/L64 NodeID/Locator64", l}
|
return 0, &ParseError{file: l.token, err: "bad NID/L64 NodeID/Locator64", lex: l}
|
||||||
}
|
}
|
||||||
return u, nil
|
return u, nil
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -85,7 +85,7 @@ func (rr *SVCB) parse(c *zlexer, o string) *ParseError {
|
||||||
l, _ := c.Next()
|
l, _ := c.Next()
|
||||||
i, e := strconv.ParseUint(l.token, 10, 16)
|
i, e := strconv.ParseUint(l.token, 10, 16)
|
||||||
if e != nil || l.err {
|
if e != nil || l.err {
|
||||||
return &ParseError{l.token, "bad SVCB priority", l}
|
return &ParseError{file: l.token, err: "bad SVCB priority", lex: l}
|
||||||
}
|
}
|
||||||
rr.Priority = uint16(i)
|
rr.Priority = uint16(i)
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ func (rr *SVCB) parse(c *zlexer, o string) *ParseError {
|
||||||
|
|
||||||
name, nameOk := toAbsoluteName(l.token, o)
|
name, nameOk := toAbsoluteName(l.token, o)
|
||||||
if l.err || !nameOk {
|
if l.err || !nameOk {
|
||||||
return &ParseError{l.token, "bad SVCB Target", l}
|
return &ParseError{file: l.token, err: "bad SVCB Target", lex: l}
|
||||||
}
|
}
|
||||||
rr.Target = name
|
rr.Target = name
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ func (rr *SVCB) parse(c *zlexer, o string) *ParseError {
|
||||||
if !canHaveNextKey {
|
if !canHaveNextKey {
|
||||||
// The key we can now read was probably meant to be
|
// The key we can now read was probably meant to be
|
||||||
// a part of the last value.
|
// a part of the last value.
|
||||||
return &ParseError{l.token, "bad SVCB value quotation", l}
|
return &ParseError{file: l.token, err: "bad SVCB value quotation", lex: l}
|
||||||
}
|
}
|
||||||
|
|
||||||
// In key=value pairs, value does not have to be quoted unless value
|
// In key=value pairs, value does not have to be quoted unless value
|
||||||
|
@ -124,7 +124,7 @@ func (rr *SVCB) parse(c *zlexer, o string) *ParseError {
|
||||||
// Key with no value and no equality sign
|
// Key with no value and no equality sign
|
||||||
key = l.token
|
key = l.token
|
||||||
} else if idx == 0 {
|
} else if idx == 0 {
|
||||||
return &ParseError{l.token, "bad SVCB key", l}
|
return &ParseError{file: l.token, err: "bad SVCB key", lex: l}
|
||||||
} else {
|
} else {
|
||||||
key, value = l.token[:idx], l.token[idx+1:]
|
key, value = l.token[:idx], l.token[idx+1:]
|
||||||
|
|
||||||
|
@ -144,30 +144,30 @@ func (rr *SVCB) parse(c *zlexer, o string) *ParseError {
|
||||||
value = l.token
|
value = l.token
|
||||||
l, _ = c.Next()
|
l, _ = c.Next()
|
||||||
if l.value != zQuote {
|
if l.value != zQuote {
|
||||||
return &ParseError{l.token, "SVCB unterminated value", l}
|
return &ParseError{file: l.token, err: "SVCB unterminated value", lex: l}
|
||||||
}
|
}
|
||||||
case zQuote:
|
case zQuote:
|
||||||
// There's nothing in double quotes.
|
// There's nothing in double quotes.
|
||||||
default:
|
default:
|
||||||
return &ParseError{l.token, "bad SVCB value", l}
|
return &ParseError{file: l.token, err: "bad SVCB value", lex: l}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
kv := makeSVCBKeyValue(svcbStringToKey(key))
|
kv := makeSVCBKeyValue(svcbStringToKey(key))
|
||||||
if kv == nil {
|
if kv == nil {
|
||||||
return &ParseError{l.token, "bad SVCB key", l}
|
return &ParseError{file: l.token, err: "bad SVCB key", lex: l}
|
||||||
}
|
}
|
||||||
if err := kv.parse(value); err != nil {
|
if err := kv.parse(value); err != nil {
|
||||||
return &ParseError{l.token, err.Error(), l}
|
return &ParseError{file: l.token, wrappedErr: err, lex: l}
|
||||||
}
|
}
|
||||||
xs = append(xs, kv)
|
xs = append(xs, kv)
|
||||||
case zQuote:
|
case zQuote:
|
||||||
return &ParseError{l.token, "SVCB key can't contain double quotes", l}
|
return &ParseError{file: l.token, err: "SVCB key can't contain double quotes", lex: l}
|
||||||
case zBlank:
|
case zBlank:
|
||||||
canHaveNextKey = true
|
canHaveNextKey = true
|
||||||
default:
|
default:
|
||||||
return &ParseError{l.token, "bad SVCB values", l}
|
return &ParseError{file: l.token, err: "bad SVCB values", lex: l}
|
||||||
}
|
}
|
||||||
l, _ = c.Next()
|
l, _ = c.Next()
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,8 +135,8 @@ const (
|
||||||
RcodeNXRrset = 8 // NXRRSet - RR Set that should exist does 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]
|
RcodeNotAuth = 9 // NotAuth - Server Not Authoritative for zone [DNS Update]
|
||||||
RcodeNotZone = 10 // NotZone - Name not contained in zone [DNS Update/TSIG]
|
RcodeNotZone = 10 // NotZone - Name not contained in zone [DNS Update/TSIG]
|
||||||
RcodeBadSig = 16 // BADSIG - TSIG Signature Failure [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]
|
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]
|
RcodeBadKey = 17 // BADKEY - Key not recognized [TSIG]
|
||||||
RcodeBadTime = 18 // BADTIME - Signature out of time window [TSIG]
|
RcodeBadTime = 18 // BADTIME - Signature out of time window [TSIG]
|
||||||
RcodeBadMode = 19 // BADMODE - Bad TKEY Mode [TKEY]
|
RcodeBadMode = 19 // BADMODE - Bad TKEY Mode [TKEY]
|
||||||
|
@ -402,6 +402,17 @@ func (rr *X25) String() string {
|
||||||
return rr.Hdr.String() + rr.PSDNAddress
|
return rr.Hdr.String() + rr.PSDNAddress
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ISDN RR. See RFC 1183, Section 3.2.
|
||||||
|
type ISDN struct {
|
||||||
|
Hdr RR_Header
|
||||||
|
Address string
|
||||||
|
SubAddress string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rr *ISDN) String() string {
|
||||||
|
return rr.Hdr.String() + sprintTxt([]string{rr.Address, rr.SubAddress})
|
||||||
|
}
|
||||||
|
|
||||||
// RT RR. See RFC 1183, Section 3.3.
|
// RT RR. See RFC 1183, Section 3.3.
|
||||||
type RT struct {
|
type RT struct {
|
||||||
Hdr RR_Header
|
Hdr RR_Header
|
||||||
|
@ -786,7 +797,7 @@ func (rr *GPOS) String() string {
|
||||||
return rr.Hdr.String() + rr.Longitude + " " + rr.Latitude + " " + rr.Altitude
|
return rr.Hdr.String() + rr.Longitude + " " + rr.Latitude + " " + rr.Altitude
|
||||||
}
|
}
|
||||||
|
|
||||||
// LOC RR. See RFC RFC 1876.
|
// LOC RR. See RFC 1876.
|
||||||
type LOC struct {
|
type LOC struct {
|
||||||
Hdr RR_Header
|
Hdr RR_Header
|
||||||
Version uint8
|
Version uint8
|
||||||
|
@ -898,6 +909,11 @@ func (rr *RRSIG) String() string {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NXT RR. See RFC 2535.
|
||||||
|
type NXT struct {
|
||||||
|
NSEC
|
||||||
|
}
|
||||||
|
|
||||||
// NSEC RR. See RFC 4034 and RFC 3755.
|
// NSEC RR. See RFC 4034 and RFC 3755.
|
||||||
type NSEC struct {
|
type NSEC struct {
|
||||||
Hdr RR_Header
|
Hdr RR_Header
|
||||||
|
@ -982,7 +998,7 @@ func (rr *TALINK) String() string {
|
||||||
sprintName(rr.PreviousName) + " " + sprintName(rr.NextName)
|
sprintName(rr.PreviousName) + " " + sprintName(rr.NextName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SSHFP RR. See RFC RFC 4255.
|
// SSHFP RR. See RFC 4255.
|
||||||
type SSHFP struct {
|
type SSHFP struct {
|
||||||
Hdr RR_Header
|
Hdr RR_Header
|
||||||
Algorithm uint8
|
Algorithm uint8
|
||||||
|
@ -996,7 +1012,7 @@ func (rr *SSHFP) String() string {
|
||||||
" " + strings.ToUpper(rr.FingerPrint)
|
" " + strings.ToUpper(rr.FingerPrint)
|
||||||
}
|
}
|
||||||
|
|
||||||
// KEY RR. See RFC RFC 2535.
|
// KEY RR. See RFC 2535.
|
||||||
type KEY struct {
|
type KEY struct {
|
||||||
DNSKEY
|
DNSKEY
|
||||||
}
|
}
|
||||||
|
@ -1306,7 +1322,7 @@ type NINFO struct {
|
||||||
|
|
||||||
func (rr *NINFO) String() string { return rr.Hdr.String() + sprintTxt(rr.ZSData) }
|
func (rr *NINFO) String() string { return rr.Hdr.String() + sprintTxt(rr.ZSData) }
|
||||||
|
|
||||||
// NID RR. See RFC RFC 6742.
|
// NID RR. See RFC 6742.
|
||||||
type NID struct {
|
type NID struct {
|
||||||
Hdr RR_Header
|
Hdr RR_Header
|
||||||
Preference uint16
|
Preference uint16
|
||||||
|
|
|
@ -3,7 +3,7 @@ package dns
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
// Version is current version of this library.
|
// Version is current version of this library.
|
||||||
var Version = v{1, 1, 57}
|
var Version = v{1, 1, 58}
|
||||||
|
|
||||||
// v holds the version of this library.
|
// v holds the version of this library.
|
||||||
type v struct {
|
type v struct {
|
||||||
|
|
|
@ -481,6 +481,21 @@ func (r1 *IPSECKEY) isDuplicate(_r2 RR) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r1 *ISDN) isDuplicate(_r2 RR) bool {
|
||||||
|
r2, ok := _r2.(*ISDN)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
_ = r2
|
||||||
|
if r1.Address != r2.Address {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if r1.SubAddress != r2.SubAddress {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func (r1 *KEY) isDuplicate(_r2 RR) bool {
|
func (r1 *KEY) isDuplicate(_r2 RR) bool {
|
||||||
r2, ok := _r2.(*KEY)
|
r2, ok := _r2.(*KEY)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -871,6 +886,26 @@ func (r1 *NULL) isDuplicate(_r2 RR) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r1 *NXT) isDuplicate(_r2 RR) bool {
|
||||||
|
r2, ok := _r2.(*NXT)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
_ = r2
|
||||||
|
if !isDuplicateName(r1.NextDomain, r2.NextDomain) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if len(r1.TypeBitMap) != len(r2.TypeBitMap) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
for i := 0; i < len(r1.TypeBitMap); i++ {
|
||||||
|
if r1.TypeBitMap[i] != r2.TypeBitMap[i] {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func (r1 *OPENPGPKEY) isDuplicate(_r2 RR) bool {
|
func (r1 *OPENPGPKEY) isDuplicate(_r2 RR) bool {
|
||||||
r2, ok := _r2.(*OPENPGPKEY)
|
r2, ok := _r2.(*OPENPGPKEY)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
|
@ -372,6 +372,18 @@ func (rr *IPSECKEY) pack(msg []byte, off int, compression compressionMap, compre
|
||||||
return off, nil
|
return off, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rr *ISDN) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
|
||||||
|
off, err = packString(rr.Address, msg, off)
|
||||||
|
if err != nil {
|
||||||
|
return off, err
|
||||||
|
}
|
||||||
|
off, err = packString(rr.SubAddress, msg, off)
|
||||||
|
if err != nil {
|
||||||
|
return off, err
|
||||||
|
}
|
||||||
|
return off, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (rr *KEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
|
func (rr *KEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
|
||||||
off, err = packUint16(rr.Flags, msg, off)
|
off, err = packUint16(rr.Flags, msg, off)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -694,6 +706,18 @@ func (rr *NULL) pack(msg []byte, off int, compression compressionMap, compress b
|
||||||
return off, nil
|
return off, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rr *NXT) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
|
||||||
|
off, err = packDomainName(rr.NextDomain, msg, off, compression, false)
|
||||||
|
if err != nil {
|
||||||
|
return off, err
|
||||||
|
}
|
||||||
|
off, err = packDataNsec(rr.TypeBitMap, msg, off)
|
||||||
|
if err != nil {
|
||||||
|
return off, err
|
||||||
|
}
|
||||||
|
return off, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (rr *OPENPGPKEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
|
func (rr *OPENPGPKEY) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {
|
||||||
off, err = packStringBase64(rr.PublicKey, msg, off)
|
off, err = packStringBase64(rr.PublicKey, msg, off)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1746,6 +1770,24 @@ func (rr *IPSECKEY) unpack(msg []byte, off int) (off1 int, err error) {
|
||||||
return off, nil
|
return off, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rr *ISDN) unpack(msg []byte, off int) (off1 int, err error) {
|
||||||
|
rdStart := off
|
||||||
|
_ = rdStart
|
||||||
|
|
||||||
|
rr.Address, off, err = unpackString(msg, off)
|
||||||
|
if err != nil {
|
||||||
|
return off, err
|
||||||
|
}
|
||||||
|
if off == len(msg) {
|
||||||
|
return off, nil
|
||||||
|
}
|
||||||
|
rr.SubAddress, off, err = unpackString(msg, off)
|
||||||
|
if err != nil {
|
||||||
|
return off, err
|
||||||
|
}
|
||||||
|
return off, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (rr *KEY) unpack(msg []byte, off int) (off1 int, err error) {
|
func (rr *KEY) unpack(msg []byte, off int) (off1 int, err error) {
|
||||||
rdStart := off
|
rdStart := off
|
||||||
_ = rdStart
|
_ = rdStart
|
||||||
|
@ -2224,6 +2266,24 @@ func (rr *NULL) unpack(msg []byte, off int) (off1 int, err error) {
|
||||||
return off, nil
|
return off, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rr *NXT) unpack(msg []byte, off int) (off1 int, err error) {
|
||||||
|
rdStart := off
|
||||||
|
_ = rdStart
|
||||||
|
|
||||||
|
rr.NextDomain, off, err = UnpackDomainName(msg, off)
|
||||||
|
if err != nil {
|
||||||
|
return off, err
|
||||||
|
}
|
||||||
|
if off == len(msg) {
|
||||||
|
return off, nil
|
||||||
|
}
|
||||||
|
rr.TypeBitMap, off, err = unpackDataNsec(msg, off)
|
||||||
|
if err != nil {
|
||||||
|
return off, err
|
||||||
|
}
|
||||||
|
return off, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (rr *OPENPGPKEY) unpack(msg []byte, off int) (off1 int, err error) {
|
func (rr *OPENPGPKEY) unpack(msg []byte, off int) (off1 int, err error) {
|
||||||
rdStart := off
|
rdStart := off
|
||||||
_ = rdStart
|
_ = rdStart
|
||||||
|
|
|
@ -36,6 +36,7 @@ var TypeToRR = map[uint16]func() RR{
|
||||||
TypeHIP: func() RR { return new(HIP) },
|
TypeHIP: func() RR { return new(HIP) },
|
||||||
TypeHTTPS: func() RR { return new(HTTPS) },
|
TypeHTTPS: func() RR { return new(HTTPS) },
|
||||||
TypeIPSECKEY: func() RR { return new(IPSECKEY) },
|
TypeIPSECKEY: func() RR { return new(IPSECKEY) },
|
||||||
|
TypeISDN: func() RR { return new(ISDN) },
|
||||||
TypeKEY: func() RR { return new(KEY) },
|
TypeKEY: func() RR { return new(KEY) },
|
||||||
TypeKX: func() RR { return new(KX) },
|
TypeKX: func() RR { return new(KX) },
|
||||||
TypeL32: func() RR { return new(L32) },
|
TypeL32: func() RR { return new(L32) },
|
||||||
|
@ -59,6 +60,7 @@ var TypeToRR = map[uint16]func() RR{
|
||||||
TypeNSEC3: func() RR { return new(NSEC3) },
|
TypeNSEC3: func() RR { return new(NSEC3) },
|
||||||
TypeNSEC3PARAM: func() RR { return new(NSEC3PARAM) },
|
TypeNSEC3PARAM: func() RR { return new(NSEC3PARAM) },
|
||||||
TypeNULL: func() RR { return new(NULL) },
|
TypeNULL: func() RR { return new(NULL) },
|
||||||
|
TypeNXT: func() RR { return new(NXT) },
|
||||||
TypeOPENPGPKEY: func() RR { return new(OPENPGPKEY) },
|
TypeOPENPGPKEY: func() RR { return new(OPENPGPKEY) },
|
||||||
TypeOPT: func() RR { return new(OPT) },
|
TypeOPT: func() RR { return new(OPT) },
|
||||||
TypePTR: func() RR { return new(PTR) },
|
TypePTR: func() RR { return new(PTR) },
|
||||||
|
@ -204,6 +206,7 @@ func (rr *HINFO) Header() *RR_Header { return &rr.Hdr }
|
||||||
func (rr *HIP) Header() *RR_Header { return &rr.Hdr }
|
func (rr *HIP) Header() *RR_Header { return &rr.Hdr }
|
||||||
func (rr *HTTPS) Header() *RR_Header { return &rr.Hdr }
|
func (rr *HTTPS) Header() *RR_Header { return &rr.Hdr }
|
||||||
func (rr *IPSECKEY) Header() *RR_Header { return &rr.Hdr }
|
func (rr *IPSECKEY) Header() *RR_Header { return &rr.Hdr }
|
||||||
|
func (rr *ISDN) Header() *RR_Header { return &rr.Hdr }
|
||||||
func (rr *KEY) Header() *RR_Header { return &rr.Hdr }
|
func (rr *KEY) Header() *RR_Header { return &rr.Hdr }
|
||||||
func (rr *KX) Header() *RR_Header { return &rr.Hdr }
|
func (rr *KX) Header() *RR_Header { return &rr.Hdr }
|
||||||
func (rr *L32) Header() *RR_Header { return &rr.Hdr }
|
func (rr *L32) Header() *RR_Header { return &rr.Hdr }
|
||||||
|
@ -227,6 +230,7 @@ func (rr *NSEC) Header() *RR_Header { return &rr.Hdr }
|
||||||
func (rr *NSEC3) Header() *RR_Header { return &rr.Hdr }
|
func (rr *NSEC3) Header() *RR_Header { return &rr.Hdr }
|
||||||
func (rr *NSEC3PARAM) Header() *RR_Header { return &rr.Hdr }
|
func (rr *NSEC3PARAM) Header() *RR_Header { return &rr.Hdr }
|
||||||
func (rr *NULL) Header() *RR_Header { return &rr.Hdr }
|
func (rr *NULL) Header() *RR_Header { return &rr.Hdr }
|
||||||
|
func (rr *NXT) Header() *RR_Header { return &rr.Hdr }
|
||||||
func (rr *OPENPGPKEY) Header() *RR_Header { return &rr.Hdr }
|
func (rr *OPENPGPKEY) Header() *RR_Header { return &rr.Hdr }
|
||||||
func (rr *OPT) Header() *RR_Header { return &rr.Hdr }
|
func (rr *OPT) Header() *RR_Header { return &rr.Hdr }
|
||||||
func (rr *PTR) Header() *RR_Header { return &rr.Hdr }
|
func (rr *PTR) Header() *RR_Header { return &rr.Hdr }
|
||||||
|
@ -437,6 +441,13 @@ func (rr *IPSECKEY) len(off int, compression map[string]struct{}) int {
|
||||||
return l
|
return l
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rr *ISDN) len(off int, compression map[string]struct{}) int {
|
||||||
|
l := rr.Hdr.len(off, compression)
|
||||||
|
l += len(rr.Address) + 1
|
||||||
|
l += len(rr.SubAddress) + 1
|
||||||
|
return l
|
||||||
|
}
|
||||||
|
|
||||||
func (rr *KX) len(off int, compression map[string]struct{}) int {
|
func (rr *KX) len(off int, compression map[string]struct{}) int {
|
||||||
l := rr.Hdr.len(off, compression)
|
l := rr.Hdr.len(off, compression)
|
||||||
l += 2 // Preference
|
l += 2 // Preference
|
||||||
|
@ -966,6 +977,10 @@ func (rr *IPSECKEY) copy() RR {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rr *ISDN) copy() RR {
|
||||||
|
return &ISDN{rr.Hdr, rr.Address, rr.SubAddress}
|
||||||
|
}
|
||||||
|
|
||||||
func (rr *KEY) copy() RR {
|
func (rr *KEY) copy() RR {
|
||||||
return &KEY{*rr.DNSKEY.copy().(*DNSKEY)}
|
return &KEY{*rr.DNSKEY.copy().(*DNSKEY)}
|
||||||
}
|
}
|
||||||
|
@ -1092,6 +1107,10 @@ func (rr *NULL) copy() RR {
|
||||||
return &NULL{rr.Hdr, rr.Data}
|
return &NULL{rr.Hdr, rr.Data}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rr *NXT) copy() RR {
|
||||||
|
return &NXT{*rr.NSEC.copy().(*NSEC)}
|
||||||
|
}
|
||||||
|
|
||||||
func (rr *OPENPGPKEY) copy() RR {
|
func (rr *OPENPGPKEY) copy() RR {
|
||||||
return &OPENPGPKEY{rr.Hdr, rr.PublicKey}
|
return &OPENPGPKEY{rr.Hdr, rr.PublicKey}
|
||||||
}
|
}
|
||||||
|
|
|
@ -378,7 +378,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.57
|
# github.com/miekg/dns v1.1.58
|
||||||
## 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
|
||||||
|
|
Loading…
Reference in New Issue