* Implement SVCB
* Fix serialization and deserialization of double quotes
* More effort (?)
4 months old commit
* DEBUG
* _
* Presentation format serialization/deserialization
* _
Remove generated
* Progress on presentation format parse & write
* _
* Finish parsing presentation format
* Regenerate
* Pack unpack
* Move to svcb.go
Scan_rr.go and types.go should be untouched now
* 🐛
Thanks ghedo
* Definitions
* TypeHTTPSSVC
* Generated
and isDuplicate
* Goodbye lenient functions
Now private key=value pairs have to be defined as structs too. They are no longer automatically named as KeyNNNNN
* Encode/decode
* Experimental svc
* Read method
* Implement some of the methods, use trick...
to report where the error is while reading it. This should be applied to EDNS too. Todo: Find if case can only contain e := new(SVC_ALPN) and rest moved out
Also fix two compile errors
* Add SVC_LOCAL methods, reorder, remove alpn value, bugs
* Errors
* Alpn, make it build
* Correct testsuite
* Fully implement parser
Change from keeping a state variable to reading in one iteration until the key=value pair is fully consumed
* Simplify and document
EDNS should be simplified too
* Attempt to fix fuzzer
And Alpn bug
* A bug and change type values to match @ghedo's implementation
* IP bug
Also there are two ip duplicating patterns, one with copy, one with append. Maybe change it to be consistent.
* Check for strictly increasing keys as required
* Don't panic on invalid alpn
* Redundant check, don't modify original array
* Size calculation
* Fix the fuzzer, match the style
* 65535 is reserved too, don't delay errors
* Check keyNNN, check for aliasform having values
* IPvNHint is an array
* Fix ipvNHint
* Rename everything
* Unrecognized keys according to the updated specification
* Skip zero-length structs in generators. Fix CI
* Doc cleanup
* Off by one
* Add parse tests
* Check if private key doesn't collide with known key, invalid tests
* Disallow IPv4 as IPv6. More tests.
Related #1107
* Style fixes
* More consistency, more tests
* 🐛 Deep copy as in the documentation
a := make([]net.IP, 1)
a[0] = net.ParseIP("1.1.1.1").To4()
b := append(make([]net.IP, 0, 1), a...)
b[0] = net.ParseIP("3.1.1.1").To4()
fmt.Println(a[0][0])
* Make tests readable
* Move valid parse tests to different file
* 🐛 One of previous commits not fully committed
* Test binary single value encoding/decoding and full encode/decode
* Add worst-case grows to builders, 🐛 Wrong visible character range, redundant tests
* Testing improvements
And don't convert to IPv4 twice
* Doc update only
* Document worst case allocations
and ipv6 can be at most of length 39, not 40
* Redundant IP copy, consistent IPv6 behavior, fix deep copy
* isDuplicate for SVCB
* Optimizations
* echoconfig
* Svc => SVCB
* Fix CI
* Regenerate after REBASE (2)
Rebased twice on 15th and 20th May
* Rename svc, use escapeByte.
* Fix parsing whitespaces between quotes, rename ECHOHOConfig
* resolve
Remove svcbFieldLen
Use reverseInt
Uppercase SVCB
Rename key_value
"invalid" => bad
Alpn comments
> 65535 check
Unneeded slices
* a little more
read => parse
IP array meaning
Force pushed because forgot to change read in svcb_test.go
* HTTPSSVC -> HTTPS
* Use new values
* mandatory code
https://github.com/MikeBishop/dns-alt-svc/pull/205
* Resolve comments
Rename svcb-pairs
Remove SVCB_PRIVATE ranges
Comment on SVCB_KEY65535
ParseError return l.token
rename svcbKeyToString and svcbStringToKey
privatize SVCBKeyToString, SVCBStringToKey
* Refactor 1
Rename sorted, originalPairs
Use append instead of copy
Use svcb_RESERVED instead of 65535, with it now being private
"type SVCBKey uint16"
* Refactor 2
svcbKeyToString as method
svcbStringToKey updated after key 0
🐛 mandatory has missing key
Rename str
idx < 0
* Refactor 3
Use l.token as z
var key, value string
Comment wrap
0:
Sentences with '.'
keyValue => kv
* Refactor 4
* Refactor 5
len() int
* Refactor 6
* Refactor 7
* Test remove parsing
* Error messages
* Rewrite two estimate comments
* parse shouldn't modify original array 🐛
* Remove two unneeded comments
* Address review comments
Push 2 because can't build fuzzer python
Push 3 to try again
* Simplify argument duplication as per tmthrgd's suggestion
And add the relevant test
Force push edit: Make sorting code fit into one line
* Rewrite ECHConfig and address the review
* Remove the optional tab
* Add To4() Check
* More cleanup and fix mandatory not sorting bug
* answer queries with no matching handler with RcodeRefused
* update documentation
* mark HandleFailed deprecated
* add handleRefused and use it to answer requests matching no handler
* silence noise maker
Co-authored-by: Brian <brian@pop-os.localdomain>
* Improve sprintName tests
* Fix sprintName handling of escaped dots
* Make sprintName consistently drop dangling incomplete escapes
* Be consistent about domain name label character escaping
Fixes#1121
* Replace strings.IndexByte with faster special-purpose function
* fix check for bad offset on 32 bit systems
* parse integers into int64 rather than platform dependent ints
Co-authored-by: Michael Hudson-Doyle <Michael Hudson-Doyle michael.hudson@ubuntu.com>
* Implements ExchangeWithConn, a function that allows callers to pass in a connection instead of having the library create a new one for them. Exchange now wraps around this, implementing the existing behavior by creating a new connection and passing it to ExchangeWithConn. c.exchange has been updated to support this behavior as well.
* adding tab
* formatting problem
* adds test case for ExchangeWithConn
Paraphrase @miekg's response to emphasize that multiple
questions in the question section of a DNS message
is not supported in practice.
refs miekg/dns#1092
Co-authored-by: Adam Chalkley <atc0005@users.noreply.github.com>
* add Canonical function to get name in canonical form
* replace strings.ToLower with Canonical
* rename Canonical to CanonicalName
* replace Fqdn with CanonicalName in ServeMux
* Fixed the default values of HorizPre and VertPre
According to RFC-1876 those fields should be:
"a pair of four-bit unsigned
integers, each ranging from zero to nine, with the most
significant four bits representing the base and the second
number representing the power of ten by which to multiply
the base. This allows sizes from 0e0 (<1cm) to 9e9
(90,000km) to be expressed"
Current values for HorizPre and VertPre (165=0xA5 and 162=0xA2)
are incorrect because the first HEX digit is greater then 9
The default values should be:
HorizPre = 10000m = 10000 * 100 cm = 10^6 = 0x16
VertPre = 10m = 10 * 100 cm = 10^3 = 0x13
Size = 1m = 1 * 100 cm = 10^2 = 0x12
The value of Size was correct, but this PR changes it to HEX
representation to be more readable
* Informative comments
Made comments on LOC record default field values more informative
Co-Authored-By: Richard Gibson <richard.gibson@gmail.com>
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Doc updates
Was reading https://pkg.go.dev/github.com/miekg/dns?tab=doc and spotted
some types and things to could be slightly better.
Make v unexported, as this version stuff should not be part of the
public API.
Signed-off-by: Miek Gieben <miek@miek.nl>
* fix test
Signed-off-by: Miek Gieben <miek@miek.nl>
* APL record: add structure and code point
* APL record: add wire format support
* APL record: add presentation format support
* APL record: add isDuplicate implementation
* APL record: add copy implementation
* APL record: add len implementation
* APL record: run go generate
* APL record: fix condition checking for equality
* APL record: use switches to map family to address length
* APL record: check bounds of individual fields rather than whole header
* APL record: stylistic changes
* APL record: remove APLPrefix methods from public interface
* APL record: update README
* APL record: additional cleanup for code review
* APL record: change return type from pointer to struct
* APL record: refactor of pack and unpack to eliminate extra variables
* Support the zero length EDNS0 EXPIRE option
* EDNS0 EXPIRE: Just reference the RFC, don't link to it
Co-Authored-By: Miek Gieben <miek@miek.nl>
Co-authored-by: Miek Gieben <miek@miek.nl>
* doc: fix xfr example.
The currently example code has a data race, put in the proper code.
Fixes: #1061
Signed-off-by: Miek Gieben <miek@miek.nl>
* Feedback
Signed-off-by: Miek Gieben <miek@miek.nl>
* Doc fixes
Polish the docs a bit; fix a link to miek.nl, remove edns0client subnet
draft link and point to the RFC. Some layout fixes and pull GOPATH from
the readme as we do go modules now.
Signed-off-by: Miek Gieben <miek@miek.nl>
* review comments
Signed-off-by: Miek Gieben <miek@miek.nl>