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

Fix bug with trailing slashes in URL #1644

Merged
merged 3 commits into from
Jul 26, 2023
Merged

Fix bug with trailing slashes in URL #1644

merged 3 commits into from
Jul 26, 2023

Conversation

inahga
Copy link
Contributor

@inahga inahga commented Jul 25, 2023

In #1579 (comment) I identified cases where https://example.com would be encoded as https://example.com/ (notice the trailing slash). At the time I didn't think this was relevant, but it turns out to affect task ID derivation.

Task ID derivation is sha256sum(encoded_task_config). If we are peered with a non-janus aggregator and if we introduce trailing slashes, Janus could derive a different task ID than its peer. (This is actually somewhat unlikely since we'd derive task ID directly from the encoded bytes, but is a subtle inconsistency that could hit us later).

Instead, provide TryInto<url::Url> to ease converting DAP Urls to a more useful type.

@inahga inahga requested a review from a team as a code owner July 25, 2023 19:21
messages/src/lib.rs Outdated Show resolved Hide resolved
@inahga
Copy link
Contributor Author

inahga commented Jul 26, 2023

I also snuck in a change to implement a custom Debug for Url, since otherwise it'll give us the unhelpful bytewise output, I could use a quick look at that.

@inahga inahga requested a review from tgeoghegan July 26, 2023 15:51
@inahga inahga enabled auto-merge (squash) July 26, 2023 20:29
@inahga inahga merged commit 5d71b17 into main Jul 26, 2023
7 checks passed
@inahga inahga deleted the inahga/taskprov-task-id branch July 26, 2023 21:25
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.

None yet

2 participants