mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-06 13:47:35 +03:00
generate valid tokens for remote addresses that are not UDP addresses
This commit is contained in:
parent
8e01921495
commit
eb72b494b2
6 changed files with 70 additions and 59 deletions
|
@ -228,40 +228,6 @@ var _ = Describe("Server Crypto Setup", func() {
|
|||
})
|
||||
})
|
||||
|
||||
Context("source address token", func() {
|
||||
It("uses the IP address when the remote address is a UDP address", func() {
|
||||
remoteAddr := &net.UDPAddr{IP: net.IPv4(1, 3, 3, 7), Port: 1337}
|
||||
cs, err := NewCryptoSetup(
|
||||
protocol.ConnectionID(42),
|
||||
remoteAddr,
|
||||
protocol.VersionWhatever,
|
||||
scfg,
|
||||
stream,
|
||||
cpm,
|
||||
supportedVersions,
|
||||
aeadChanged,
|
||||
)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(cs.(*cryptoSetupServer).sourceAddr).To(BeEquivalentTo(remoteAddr.IP))
|
||||
})
|
||||
|
||||
It("works with remote address that are not UDP", func() {
|
||||
remoteAddr := &net.TCPAddr{IP: net.IPv4(1, 3, 3, 7), Port: 1337}
|
||||
cs, err := NewCryptoSetup(
|
||||
protocol.ConnectionID(42),
|
||||
remoteAddr,
|
||||
protocol.VersionWhatever,
|
||||
scfg,
|
||||
stream,
|
||||
cpm,
|
||||
supportedVersions,
|
||||
aeadChanged,
|
||||
)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(cs.(*cryptoSetupServer).sourceAddr).To(BeEquivalentTo("1.3.3.7:1337"))
|
||||
})
|
||||
})
|
||||
|
||||
Context("when responding to client messages", func() {
|
||||
var cert []byte
|
||||
var xlct []byte
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue