-
-
Notifications
You must be signed in to change notification settings - Fork 121
EDNS0 padding option support with DoT #494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wtoorop
wants to merge
2
commits into
master
Choose a base branch
from
features/edns0-padding
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| server: | ||
| zonesdir: "" | ||
| verbosity: 2 | ||
| ip-address: 127.0.0.1 | ||
| ip-address: 127.0.0.1@@TPKG_DOT_PORT@ | ||
| tls-port: @TPKG_DOT_PORT@ | ||
| xfrdfile: "xfrd.state" | ||
| zonelistfile: "zone.list" | ||
| tls-service-key: "dot_padding.key" | ||
| tls-service-pem: "dot_padding.pem" | ||
|
|
||
| zone: | ||
| name: "example.com" | ||
| zonefile: "dot_padding.zone" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| BaseName: dot_padding | ||
| Version: 1.0 | ||
| Description: Test EDNS0 padding option | ||
| CreationDate: do 2 jul 2026 12:00:23 CEST | ||
| Maintainer: Willem Toorop | ||
| Category: | ||
| Component: | ||
| CmdDepends: | ||
| Depends: | ||
| Help: | ||
| Pre: dot_padding.pre | ||
| Post: dot_padding.post | ||
| Test: dot_padding.test | ||
| AuxFiles: dot_padding.conf.in dot_padding.zone dot_padding.key dot_padding.pem | ||
| Passed: | ||
| Failure: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Please describe how to use this test. | ||
| i.e. tpkg -a ARG exe testname: | ||
| ARG is used to ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| -----BEGIN PRIVATE KEY----- | ||
| MIIG/QIBADANBgkqhkiG9w0BAQEFAASCBucwggbjAgEAAoIBgQCjsBHexLKQb89F | ||
| S+bj3t+QNWMvWgxWReBj7yCjDXGsMU/SaanMUs/4BgTE7IVeaqQQlYlr4TT0m5HS | ||
| 8UWSIp9BSYH+NA6epbCa7iBFKLOsTOvDAsQuWV3aB1ApqQYGp6Ou2TqIF0DupE0x | ||
| jDE32+GEj8p/+jjKhC+BD9XtNf2RyOBQhCgTTlD8oKoPxo+V3T0N8fRymojXElTQ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KGJRZnFNdXnAhk8853k6FQbhLlB0fqbYH8x8KtwH9uMn9UkAXFdvr0JKrg7 | ||
| 9xp+kDb98VxJtXSMeGB5iIgoi5jnAannMiNszk07IoClUpU5f1QZzmz5+UYTNEt9 | ||
| PPG/m1FTeHXH407sfqB8frY= | ||
| -----END PRIVATE KEY----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| -----BEGIN CERTIFICATE----- | ||
| MIIEPDCCAqSgAwIBAgIUJGe+SRXT0yBhTv5pnLcuYt/29wgwDQYJKoZIhvcNAQEL | ||
| BQAwDjEMMAoGA1UEAwwDbnNkMB4XDTIzMTExOTE2MjUxNFoXDTQzMDgwNjE2MjUx | ||
| NFowDjEMMAoGA1UEAwwDbnNkMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKC | ||
| AYEAo7AR3sSykG/PRUvm497fkDVjL1oMVkXgY+8gow1xrDFP0mmpzFLP+AYExOyF | ||
| XmqkEJWJa+E09JuR0vFFkiKfQUmB/jQOnqWwmu4gRSizrEzrwwLELlld2gdQKakG | ||
| Bqejrtk6iBdA7qRNMYwxN9vhhI/Kf/o4yoQvgQ/V7TX9kcjgUIQoE05Q/KCqD8aP | ||
| ld09DfH0cpqI1xJU0Ej/HIGXRxFBDlJcohtwAoL9P8CW6ccr7NdpyLyz5lkOC/0L | ||
| 6kTsFAneLjFJngD0s3LQ+pBvrH9pVT4NEjlvTn+fA5Glh3qelXhKEaItEkKSR/po | ||
| PxCOjbAy5b8o0rZGJELioduiP/0DS3rT5kzJQnnrzKFTwde3K9wIcLnSmig+xMFa | ||
| G4J7o/XJrp1AyRvzJ42nW6v/2SELknYWt6acdwOPAol9fiMouzwr+6967UAZHJgN | ||
| ZiFoq98yx7o2SdMHQUC+t+l8/Xp1cqwruA9uniS4B9VW4cIK2tlD3ZC/aYQO9D6y | ||
| +ag/AgMBAAGjgZEwgY4wHQYDVR0OBBYEFPb//R1Ree4/yWEwjm4NDgyZFsVuMEkG | ||
| A1UdIwRCMECAFPb//R1Ree4/yWEwjm4NDgyZFsVuoRKkEDAOMQwwCgYDVQQDDANu | ||
| c2SCFCRnvkkV09MgYU7+aZy3LmLf9vcIMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYD | ||
| VR0RBAcwBYIDbnNkMA0GCSqGSIb3DQEBCwUAA4IBgQBd6s8T0xbDqPOp4dTn3YDi | ||
| y16owyzuIp1yE7Cyi1DJnKYaV43Svsc/M0ERg2nR8mv9Xka5z2rLvma2K00D4rl4 | ||
| zIgNrUg99l6TVmf3HHtXbUP4RKRSLivlNj4v2Qf1SlAnFUju0XPNOH7EzuiA/vLi | ||
| DVwlLFrqyuayiJqnzmt9lLfwQCgpkzhxoHlAKy/YACLTv21sywzQYpWLupE2r/nG | ||
| LSvXCOYquQNeYeiwpyXFptAQFRXcSIYfA3ayiEQWmZ/l1/J/4Xd2PJ++eImPoTMN | ||
| rWRgymfVUah0e/G4SXrMmwpT07zdAZ87B2w6wRN3ZJekIoZY7Kqew0v4Knv7yY/Z | ||
| H+48gnqK6wznGODW4KRh4Kaje2aYicviCfSEnh+jVRkFZfdBO+OXw9jqdoeaJRRV | ||
| +71izHLTmWqMvMKjnYHggxeS7TXcQM761wHAjm+8Zl6p4iMTVqIIKpln2JEteaJ3 | ||
| FYZtYjczaItlB5LrP++BrFi95s9sAYJ3SP6Uer4NVPI= | ||
| -----END CERTIFICATE----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # #-- dot_padding.post --# | ||
| # source the master var file when it's there | ||
| [ -f ../.tpkg.var.master ] && source ../.tpkg.var.master | ||
| # source the test var file when it's there | ||
| [ -f .tpkg.var.test ] && source .tpkg.var.test | ||
| # | ||
| # do your teardown here | ||
| . ../common.sh | ||
|
|
||
| # do your teardown here | ||
| if [ -z $TPKG_NSD_PID ]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| # kill NSD | ||
| NSD_PID=`cat $TPKG_NSD_PID` | ||
| kill_pid $NSD_PID | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # #-- dot_padding.pre--# | ||
| # source the master var file when it's there | ||
| [ -f ../.tpkg.var.master ] && source ../.tpkg.var.master | ||
| # use .tpkg.var.test for in test variable passing | ||
| [ -f .tpkg.var.test ] && source .tpkg.var.test | ||
| . ../common.sh | ||
|
|
||
| # start NSD | ||
| get_random_port 2 | ||
| TPKG_PORT=$RND_PORT | ||
| TPKG_DOT_PORT=`expr $RND_PORT + 1` | ||
|
|
||
| PRE="../.." | ||
| TPKG_NSD_PID="$PRE/nsd.pid.$$" | ||
| TPKG_NSD="$PRE/nsd" | ||
|
|
||
| # share the vars | ||
| echo "export TPKG_PORT=$TPKG_PORT" >> .tpkg.var.test | ||
| echo "export TPKG_DOT_PORT=$TPKG_DOT_PORT" >> .tpkg.var.test | ||
| echo "export TPKG_NSD_PID=$TPKG_NSD_PID" >> .tpkg.var.test | ||
|
|
||
| sed -e "s/@TPKG_DOT_PORT@/$TPKG_DOT_PORT/" < dot_padding.conf.in > edit.conf | ||
|
|
||
| $TPKG_NSD -c edit.conf -u "" -l nsd.log -p $TPKG_PORT -P $TPKG_NSD_PID | ||
| wait_nsd_up nsd.log | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # #-- dot_padding.test --# | ||
| # source the master var file when it's there | ||
| [ -f ../.tpkg.var.master ] && source ../.tpkg.var.master | ||
| # use .tpkg.var.test for in test variable passing | ||
| [ -f .tpkg.var.test ] && source .tpkg.var.test | ||
|
|
||
| for SIZE_PADDED in 463:468 464:468 465:936 466:936 467:936 468:468 469:936 \ | ||
| 931:936 932:936 933:1404 934:1404 935:1404 936:936 937:1404 | ||
| do | ||
| SIZE=${SIZE_PADDED%:*} | ||
| PADDED=${SIZE_PADDED#*:} | ||
|
|
||
| dig @127.0.0.1 -p $TPKG_PORT ${SIZE}.example.com. TXT +padding=128 2>&1 > UDP-${SIZE}.out | ||
| if ! grep -q ';; SERVER:.*(UDP)$' UDP-${SIZE}.out; then | ||
| cat UDP-${SIZE}.out | ||
| echo "Error: transport was not UDP" | ||
| exit 1 | ||
| fi | ||
| if grep -q '^; PAD:' UDP-${SIZE}.out; then | ||
| cat UDP-${SIZE}.out | ||
| echo "Error: padding option seen in UDP message" | ||
| exit 1 | ||
| fi | ||
| if ! grep -q "^;; MSG SIZE[[:space:]][[:space:]]*rcvd: ${SIZE}$" UDP-${SIZE}.out; then | ||
| cat UDP-${SIZE}.out | ||
| echo "Error: UDP message has wrong message size" | ||
| exit 1 | ||
| fi | ||
|
|
||
| dig @127.0.0.1 -p $TPKG_PORT ${SIZE}.example.com. TXT +padding=128 +tcp 2>&1 > TCP-${SIZE}.out | ||
| if ! grep -q ';; SERVER:.*(TCP)$' TCP-${SIZE}.out; then | ||
| cat TCP-${SIZE}.out | ||
| echo "Error: transport was not TCP" | ||
| exit 1 | ||
| fi | ||
| if grep -q '^; PAD:' TCP-${SIZE}.out; then | ||
| cat TCP-${SIZE}.out | ||
| echo "Error: padding option seen in TCP message" | ||
| exit 1 | ||
| fi | ||
| if ! grep -q "^;; MSG SIZE[[:space:]][[:space:]]*rcvd: ${SIZE}$" TCP-${SIZE}.out; then | ||
| cat TCP-${SIZE}.out | ||
| echo "Error: TCP message has wrong message size" | ||
| exit 1 | ||
| fi | ||
|
|
||
| dig @127.0.0.1 -p $TPKG_DOT_PORT ${SIZE}.example.com. TXT +padding=128 +tls 2>&1 > TLS-${SIZE}.out | ||
| if ! grep -q ';; SERVER:.*(TLS)$' TLS-${SIZE}.out; then | ||
| cat TLS-${SIZE}.out | ||
| echo "Error: transport was not TLS" | ||
| exit 1 | ||
| fi | ||
| if [ $SIZE -eq 468 -o $SIZE -eq 936 ]; then | ||
| if grep -q '^; PAD:' TLS-${SIZE}.out; then | ||
| cat TLS-${SIZE}.out | ||
| echo "Error: padding option seen in TLS message of size $SIZE" | ||
| exit 1 | ||
| fi | ||
| else | ||
| if ! grep -q '^; PAD:' TLS-${SIZE}.out; then | ||
| cat TLS-${SIZE}.out | ||
| echo "Error: padding option not seen in TLS message" | ||
| exit 1 | ||
| fi | ||
| fi | ||
| if ! grep -q "^;; MSG SIZE[[:space:]][[:space:]]*rcvd: ${PADDED}$" TLS-${SIZE}.out; then | ||
| cat TLS-${SIZE}.out | ||
| echo "Error: TLS message has wrong message size (should have been $PADDED)" | ||
| exit 1 | ||
| fi | ||
| done | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.