Skip to content
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

Add a TSIG client. #373

Merged
merged 91 commits into from
Sep 11, 2024
Merged

Add a TSIG client. #373

merged 91 commits into from
Sep 11, 2024

Conversation

ximon18
Copy link
Member

@ximon18 ximon18 commented Aug 8, 2024

Taken from the xfr branch in order to split PR #335 into several smaller PRs.

Also extends the client-transports.rs example to demonstrate TSIG (requires a suitably configured server).

ximon18 added 20 commits August 6, 2024 23:34
…tain number of bytes should be reserved (to make space for post-processing adding EDNS options to the response), and (b) strongly typed passing of arbitrary metadata between middleware that produces a type and middleware that consumes the type (e.g. a TSIG key name).
…o that a wrapper client (such as a future TSIG client) can augment the message before it gets sent.
- Added a simple UDP client that doesn't interfere with requests before sending (for TSIG testing).
- Added support for receiving multiple responses (for XFR testing).
- Added support for connection timeout errors
- Added support for connection termination errors (for EDNS testing).
- Added support for specifying the TSIG key to use (for TSIG testing).
- Added support for $ORIGIN in zone file fragments.
- Simplified rcode checking and use it instead of the yxrrset BADCOOKIE hack.
- In memory channel changes:
  - Fixed a trace message that incorrectly referred to client instead of server.
  - Fixed a too-tight connection read loop that was preventing Tokio task switching.
  - Added connection shutdown detection.
- Fixed incorrect setting of TCP mode to true when UDP mode was requested.
@ximon18 ximon18 requested a review from a team August 8, 2024 22:20
@ximon18 ximon18 changed the base branch from stelline-server-testing-changes to main September 9, 2024 18:20
@ximon18
Copy link
Member Author

ximon18 commented Sep 10, 2024

We should decide what to do with the TSIG client extension that was added to client-transports.rs. The example isn't very useful as it won't work without having a server that allows AXFR with TSIG using your key bytes and key name, i.e. only a server you spin up yourself. For everyone else who runs the example it will just fail at the TSIG client step.

The only public DNS server offering open XFR access with TSIG signing that I'm aware of is from Swtich but we also shouldn't configure the example code to do AXFR to that as (a) it's a bit impolite and (b) we'd have to ask users to accept the Switch terms before running the example.

We could make the example take optional TSIG key name and key file base64 bytes and alg name as input ala dig, and also make the queried host configurable too, and then only run the TSIG client code if TSIG key details were provided.

What do you think @Philip-NLnetLabs and @partim?

@Philip-NLnetLabs
Copy link
Member

I think it is fine if it fails. Maybe print something to that effect. I see the examples mostly as code snippets.

- Renamed AuthenticatedRequestMessage to RequestMessage to be consitent with src::net::client::request and to shorten the name (as it is scoped by the module so is still unique).
- Renamed UpstreamSender to Forwarder as it's shorter and (I thnk) better.
- Replaced HandleResponseResult by Option.
- Renamed handle_response() to validate_response() and simplified the option/error handling a little.
- Moved some impls around in the file to be nearer the type they affect.
@ximon18
Copy link
Member Author

ximon18 commented Sep 11, 2024

I think it is fine if it fails. Maybe print something to that effect. I see the examples mostly as code snippets.

Done.

@ximon18 ximon18 merged commit 282f94b into main Sep 11, 2024
26 checks passed
@ximon18 ximon18 deleted the tsig-client branch September 11, 2024 14:33
ximon18 added a commit that referenced this pull request Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants