MiniDNS / minidns

DNS library for Android and Java SE
Other
220 stars 61 forks source link

WIP: Add SVCB record #110

Open Ch4t4r opened 4 years ago

Ch4t4r commented 4 years ago

SVCB is a new record type currently in draft: https://tools.ietf.org/html/draft-ietf-dnsop-svcb-https-01

Support for it has already been added to Safari in iOS 14 (where it is used by default instead of A/AAAA), Cloudflare also added support for it just recently. Mozilla announced to implement it soon as well.

This PR adds the TYPE (RR type 64 according to the RFC) and the Data class for it.

Ch4t4r commented 4 years ago

I updated the PR with the comments. One thing that I think is still wrong is how the values of the key-value pairs are decoded (key decoding is fine, it's a plain UShort). According to the RFC the value is an octet String (which is why I currently simply decode with UTF-8), but the Appendix has some encoding for the value. I can't make any sense of it, but maybe you can? I suspect the encoding is the same as in a TXT entry, but I couldn't find any conversion from String -> the encoded value, only from encoded value -> String (´getText()´ in TXT.java). With the former missing there would be no way to create a SVCB entry, only reading it from Wireformat.

Ch4t4r commented 4 years ago

I'm going to close this PR. I don't have enough knowledge about the encoding and wireformat to make this work. I published my last changes (which don't work right now).

SVCB support would be nice though, it'd be awesome if you could somehow finish this, if you've got time.

Flowdalic commented 4 years ago

I think it is best to mark this PR as WIP and leave it open then.