SVCB: allow parsing keys in generic format without value
Short description
To avoid other issues, increase strictness of value checks for known keys, regardless if they are in generic or canonical format.
Also add a test for key00NNN (= leading zeroes).
https://github.com/PowerDNS/pdns/issues/15479
Checklist
I have:
- [x] read the CONTRIBUTING.md document
- [x] compiled this code
- [x] tested this code
- [ ] included documentation (including possible behaviour changes)
- [ ] documented the code
- [ ] added or modified regression test(s)
- [ ] added or modified unit test(s)
- [ ] checked that this code was merged to master
Pull Request Test Coverage Report for Build 16519017624
Details
- 87 of 95 (91.58%) changed or added relevant lines in 3 files are covered.
- 35 unchanged lines in 6 files lost coverage.
- Overall coverage increased (+0.03%) to 65.854%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| pdns/rcpgenerator.cc | 22 | 30 | 73.33% |
| <!-- | Total: | 87 | 95 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| pdns/recursordist/aggressive_nsec.cc | 2 | 66.1% |
| pdns/iputils.cc | 3 | 56.03% |
| pdns/recursordist/syncres.cc | 3 | 81.23% |
| pdns/dnsdistdist/dnsdist-tcp.cc | 4 | 77.14% |
| pdns/rcpgenerator.cc | 4 | 90.19% |
| pdns/recursordist/rec-system-resolve.cc | 19 | 45.92% |
| <!-- | Total: | 35 |
| Totals | |
|---|---|
| Change from base Build 16517016923: | 0.03% |
| Covered Lines: | 127927 |
| Relevant Lines: | 165693 |
💛 - Coveralls
There's still a parsing issue that I need to debug.
There's still a parsing issue that I need to debug.
Pushed some additional test cases and a fix for that.
@miodvallat could you rereview?
authpy tests found another thing I overlooked, fixed now
Did not find anything wrongly rejected, or valid data parsed wrong, but I hope this is not hiding a bug. These parse identically:
1 foo.powerdns.org. ipv4hint=1.2.3.4 key2=port=123
This is very clearly a bug. Fixed that. I wish the if (d_pos != d_end && d_string.at(d_pos) == '=') { block could go away, but that will make the "with value" case unreadable.
It's not that looking bad in the end.