Commit Graph

80 Commits

Author SHA1 Message Date
Marten Seemann bdbef49cdb
ci: run go generate as part of the go-check workflow (#1986) 2023-01-11 20:34:34 -08:00
Marten Seemann e59aba2d09
webtransport: initialize a NullResourceManager if none is provided (#1962) 2022-12-29 15:28:09 -08:00
Marten Seemann 3ecf0b9aa9
webtransport: fix flaky accept queue test (#1938) 2022-12-09 17:00:17 -08:00
Marten Seemann e368799d18
quic: update quic-go to v0.31.1 (#1942) 2022-12-08 13:14:31 -08:00
Marco Munizaga 5d22740c38
Disable support for signed/static TLS certificates in WebTransport (#1927) 2022-12-05 13:27:12 -08:00
Marten Seemann cefbf97aa6
webtransport: add PSK to constructor, and fail if it is used (#1929)
That way, it won't be possible to construct a host with a PSK
when WebTransport is enabled. This is desireable since WebTransport doesn't
support private network (same as QUIC).
2022-12-05 12:44:15 -08:00
Marco Munizaga 1c8eaabfd3
transport.Listener,quic: Support multiple QUIC versions with the same Listener. Only return a single multiaddr per listener. (#1923)
* Revert "transport.Listener  returns a list of multiaddrs"

This reverts commit 8962b2ae33.

* Support multiple QUIC versions on the same listener

* No long running accept loop

* Don't use a goroutine

* PR comments
2022-12-01 14:06:13 -08:00
Marten Seemann f73205096f
quic / webtransport: make it possible to listen on the same address / port (#1905)
* quic: add an integration test for QUIC version support

* quic: refactor the stateless reset test

* quic: simplify the interface of the noreuseConn

DecreaseCount now closes the underlying UDP conn, so that callers don't
need to pay attention if they're dealing with a reuseConn or a
noreuseConn.

* implement a quicreuse to manage QUIC connections

* quicreuse: introduce options

* config: construct the quicreuse.ConnManager using fx

* webtransport: use the quicreuse

* add integration test for QUIC and WebTranport sharing the same UDP addr

* Handle errors in accept loop goroutine

* Add comment

* Remove todo

* Rename mutexes

* Cleanup extra close

* Only log on err

* Use webtransport-go 0.4.0

* Fix expected error

Co-authored-by: Marco Munizaga <git@marcopolo.io>
2022-11-28 15:55:38 -08:00
Marten Seemann 26a5edf765
webtransport: update webtransport-go to v0.3.0 (#1895) 2022-11-21 18:59:45 -08:00
Marten Seemann 14ca991a41
transports: expose the name of the transport in the ConnectionState (#1911) 2022-11-21 17:34:02 -08:00
Marco Munizaga 0b4867c117
feat: quic,webtransport: enable both quic-draft29 and quic-v1 addrs on quic. only quic-v1 on webtransport (#1881)
* transport.Listener  returns a list of multiaddrs

* Support both QUIC versions in QUIC transport

* Support only QUIC v1 in webtransport

* Update dialMatcher

* Update tests

* Only use draft 29 when dialing if the server is a draft 29 server

* Removes QUIC draft 29 addrs if we have a QUIC v1 addr

* Lint fix

* Add changes to deterministic certhashes after rebase

* Update p2p/transport/quic/options.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Update p2p/transport/quic/listener.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Update p2p/transport/quic/quic_multiaddr.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Stylize QUIC correctly

* Update doc around ListenClose

* Preallocate a bit extra to avoid paying for an allocation later

* Keep a list of multiaddrs, then join

* PR nits

* Close transport or listener just once

* Update go-multiaddr

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2022-11-17 10:01:19 -08:00
Marco Munizaga a0432e70af
webtransport: use deterministic TLS certificates (#1833)
* Use deterministic TLS certificates for webtransport

* Update test to work with buckets

* Make sure to overlap and use a random offset

* Fixup mistaken change in other test

* Add QuickCheck tests for cert behavior

* Lint fix

* Add more tests

* Add webtransport integration test

* Use same key

* Actually offset by at least clockSkew

* Use seeded key for certs after reboot test

* PR comments

* Remove debug code

* Fix calculation for cert having been valid

Fixes the logic that a cert has been valid for a clockSkew by
subtracting the clockSkew from the start time rather than incorporating
it into the offset. The offset should be used to shift the buckets.

* Update comment

* Lint fix

* Update TestGetCurrentBucketStartTimeIsWithinBounds to include clockSkew calculation

* Rebase fixes
2022-11-14 07:44:25 -08:00
Marten Seemann cbe50095f3 config: use fx to construct security transports 2022-11-10 10:09:45 +00:00
julian88110 7465a509d0
noise: use Noise Extension to negotiate the muxer during the handshake (#1813)
* Muxer early selection over Noise protocol

* Address review points round 2

* Muxer selection according responder's preference

* Address some review points again.

* noise: regenerate the protobuf

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2022-10-25 10:11:19 -07:00
Marten Seemann b50b4609ab webtransport: use the rcmgr to control flow control window increases 2022-10-24 13:24:06 +01:00
Marten Seemann c0a0aa010e rcmgr: make it possible to embed the NullResourceManager 2022-10-24 13:24:04 +01:00
Marten Seemann 28ca6e5139 quicutils: make the package internal 2022-10-12 19:48:05 +02:00
Marten Seemann ead3e4f981 webtransport: simplify listener constructor 2022-10-12 19:46:49 +02:00
Marten Seemann 98bcb66a9a webtransport: record qlogs when QLOGDIR is set 2022-10-12 19:27:00 +02:00
Marco Munizaga 1d04a70704
Fix comment in webtransport client auth handshake (#1793) 2022-10-04 14:57:45 -07:00
Marten Seemann 031ec50a04
webtransport: return error before wrapping opened / accepted streams (#1775) 2022-09-22 00:57:57 -07:00
Marten Seemann edf655a503 noise / webtransport: use the Noise Extension Registry for cert hashes 2022-09-20 20:55:37 +03:00
Marco Munizaga 0788ccd1e3
webtransport: add custom resolver to add SNI (#1761)
* Add custom resolver to webtransport to add SNI

* Update p2p/transport/webtransport/transport.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Nits

* Remove race in test

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2022-09-20 09:26:03 -07:00
Marten Seemann 131e5bd828
webtransport: have the server send the certificates (#1757) 2022-09-19 11:52:35 -07:00
Marten Seemann c1bdab429f
noise: make it possible for the server to send early data (#1750)
* noise: make it possible for the server to send early data

* noise: use separate early data handlers for initiator and responder

* noise: use a 2 kb buffer for all handshake operations

* Add comments around EarlyData(Handler)

* noise: send early data with 2nd and 3rd handshake message

* Update p2p/security/noise/session_transport.go

Co-authored-by: Marco Munizaga <git@marcopolo.io>
2022-09-19 09:16:10 +03:00
Marten Seemann 5ab6d3fd1d
webtransport: add and check the ?type=noise URL parameter (#1749) 2022-09-14 22:18:24 -07:00
Marten Seemann a4e45c294c
webtransport: disable HTTP origin check (#1752) 2022-09-14 22:17:07 -07:00
Marten Seemann 73b3d566f3 webtransport: adjust import paths 2022-09-07 12:46:35 +03:00
Marten Seemann 98ff0c6551 fix CanDial for addresses that don't contain any certificate hashes (#25) 2022-09-07 02:30:55 -07:00
Marten Seemann 7714b04df5 drop incoming sessions when the accept queue fills up (#24) 2022-09-07 01:51:13 -07:00
Marten Seemann f49dd4f322 clarify comment about certificate hash verification 2022-09-07 10:52:54 +03:00
Marten Seemann 86a058d848 close the scope when the connection gater intercepts 2022-09-07 10:21:56 +03:00
Marten Seemann d2b47dd539 remove the unneeded connSecurityMultiaddrs interface 2022-09-07 10:19:30 +03:00
Marten Seemann ef657d6d7c make addrComponentForCert a pure function 2022-09-07 10:14:22 +03:00
Marten Seemann c783884fb1 add a link to the certificate hashes section of the w3c WebTransport spec 2022-09-07 10:12:41 +03:00
Marten Seemann 0295df0074 remove Hello World HTTP endpoint 2022-09-07 09:44:35 +03:00
Marten Seemann 97e739f0a8 update to the current master of go-libp2p (#23) 2022-09-03 03:52:50 -07:00
Marten Seemann 3521b4fae8 chore: update go-multiaddr to v0.6.0 2022-09-03 12:07:15 +03:00
Marten Seemann 4ce4e4f05e only use positive numbers for x509.Certificate serial numbers 2022-09-03 11:57:25 +03:00
Marten Seemann 60a40710ab chore: update CI to Go 1.18 / 1.19, update webtransport-go to v0.1.0 2022-08-29 17:48:04 +03:00
Marten Seemann d74921df0a make it possible to use a custom tls.Config for listening and dialing (#22) 2022-07-16 06:55:57 -07:00
Marten Seemann 2823159a99 optimize expiry periods of certificates (#21) 2022-07-16 03:22:10 -07:00
Marten Seemann ff5aa304a0 simplify certificate generation 2022-07-12 10:56:05 +00:00
Marten Seemann 9f2e830b65 remove member variable for certificate validity from cert manager 2022-07-10 21:22:52 +00:00
Marten Seemann ebcb51309f use a mock clock in cert manager tests (#20) 2022-07-10 14:19:25 -07:00
Marten Seemann d626e80696 move connection interface to conn.go 2022-07-10 20:53:43 +00:00
Marten Seemann f0dbd3e7e7 fix flaky resource manager test (#19) 2022-07-10 06:01:21 -07:00
Marten Seemann 851e6ba171 verify the hash of the server's certificate (#16) 2022-07-10 05:36:39 -07:00
Marten Seemann 7e8ca3ac06 implement InterceptSecured for accepted connections 2022-07-09 22:33:43 +00:00
Marten Seemann a508e94004 implement InterceptAccept connection gating 2022-07-09 22:33:43 +00:00