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 an AddrVerified field to the ClientHelloInfo #4360

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
rename ClientHelloInfo.AddressVerififed to ClientHelloInfo.AddrVerififed
  • Loading branch information
marten-seemann committed Mar 10, 2024
commit c24c004b98e4511de716086b3565a322f5e91e83
4 changes: 2 additions & 2 deletions integrationtests/self/handshake_rtt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var _ = Describe("Handshake RTT tests", func() {
fmt.Sprintf("localhost:%d", proxy.LocalAddr().(*net.UDPAddr).Port),
getTLSClientConfig(),
getQuicConfig(&quic.Config{GetConfigForClient: func(info *quic.ClientHelloInfo) (*quic.Config, error) {
Expect(info.AddressVerified).To(BeTrue())
Expect(info.AddrVerified).To(BeTrue())
return nil, nil
}}),
)
Expand All @@ -98,7 +98,7 @@ var _ = Describe("Handshake RTT tests", func() {
fmt.Sprintf("localhost:%d", proxy.LocalAddr().(*net.UDPAddr).Port),
getTLSClientConfig(),
getQuicConfig(&quic.Config{GetConfigForClient: func(info *quic.ClientHelloInfo) (*quic.Config, error) {
Expect(info.AddressVerified).To(BeFalse())
Expect(info.AddrVerified).To(BeFalse())
return nil, nil
}}),
)
Expand Down
6 changes: 3 additions & 3 deletions interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,12 @@ type Config struct {
// ClientHelloInfo contains information about an incoming connection attempt.
type ClientHelloInfo struct {
// RemoteAddr is the remote address on the Initial packet.
// Unless AddressVerified is set, the address is not yet verified, and could be a spoofed IP address.
// Unless AddrVerified is set, the address is not yet verified, and could be a spoofed IP address.
RemoteAddr net.Addr
// AddressVerified says if the remote address was verified using QUIC's Retry mechanism.
// AddrVerified says if the remote address was verified using QUIC's Retry mechanism.
// Note that the Retry mechanism costs one network roundtrip,
// and is not performed unless Transport.MaxUnvalidatedHandshakes is surpassed.
AddressVerified bool
AddrVerified bool
}

// ConnectionState records basic details about a QUIC connection
Expand Down
4 changes: 2 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,8 @@ func (s *baseServer) handleInitialImpl(p receivedPacket, hdr *wire.Header) error
config := s.config
if s.config.GetConfigForClient != nil {
conf, err := s.config.GetConfigForClient(&ClientHelloInfo{
RemoteAddr: p.remoteAddr,
AddressVerified: clientAddrValidated,
RemoteAddr: p.remoteAddr,
AddrVerified: clientAddrValidated,
})
if err != nil {
s.logger.Debugf("Rejecting new connection due to GetConfigForClient callback")
Expand Down
Loading