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

webtransport: move certhash verification to the client #1757

Merged
merged 1 commit into from
Sep 19, 2022

Conversation

marten-seemann
Copy link
Contributor

@marten-seemann marten-seemann commented Sep 16, 2022

As suggested in libp2p/specs#455.

This PR builds on top #1750. Please only review the last commit. I'll rebase this PR once #1750 is merged.

p2p/transport/webtransport/transport.go Outdated Show resolved Hide resolved
return &connSecurityMultiaddrs{
ConnSecurity: c,
ConnMultiaddrs: &connMultiaddrs{local: local, remote: remote},
}, nil
}

func decodeCertHashesFromProtobuf(b []byte) ([]multihash.DecodedMultihash, error) {
var msg pb.WebTransport
if err := msg.Unmarshal(b); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we error if len(b) == 0? (The unmarshal will not fail this I think)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be okay. A server sending an empty early data can be interpreted to mean that there is no certhash. Just a bit surprising

@marten-seemann marten-seemann merged commit 131e5bd into master Sep 19, 2022
@marten-seemann marten-seemann deleted the new-webtransport-noise-handshake branch September 19, 2022 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants