Commit Graph

67 Commits

Author SHA1 Message Date
julian88110 ebd000db1e
tls: use ALPN to negotiate the stream multiplexer (#1772)
* Muxer selection in TLS handshake first cut

* Clean up some part of the code

* Change earlydata to ConnectionState for security connection.

* resolve merging conflicts

* Add stubs for noise

* clean up code

* Switch over to passing muxers to security transport constructors

* Address feedback points

* Update p2p/net/upgrader/upgrader.go

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

* clean up accidental checked file.

* Review points round 2

* Address some go nit points

* Update tls transport test to address review points

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2022-10-07 10:34:58 -07:00
Marten Seemann 69a574cb56
tls: add tests for test vector from the spec (#1788) 2022-10-06 23:21:02 -07:00
Marten Seemann 2c1e54083a
tls: fix flaky handshake cancellation test (#1779) 2022-09-23 11:25:08 -07:00
Marten Seemann 4623690009 switch from github.com/libp2p/go-libp2p-core to core 2022-08-17 17:13:02 +03:00
web3-bot eff72c4afa
sync: update CI config files (#1678)
* bump go.mod to Go 1.18 and run go fix

* bump go.mod to Go 1.18 and run go fix

* bump go.mod to Go 1.18 and run go fix

* bump go.mod to Go 1.18 and run go fix

* run gofmt -s

* update .github/workflows/go-test.yml

* update .github/workflows/go-check.yml

* stop using the deprecated io/ioutil package

Co-authored-by: web3-bot <web3-bot@users.noreply.github.com>
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2022-08-17 01:05:51 -07:00
Peter Argue 8a8734387f
Support generating custom x509 certificates (#1481)
* Support generating custom x509 certificates

* add unit tests

* updates from review with tests

* fix type in test email
2022-08-02 08:13:46 -07:00
Marco Munizaga 452ddfbb76
Add canonical peer status logs (#1624)
* Add canonical peer status logs

* Move logs to swarm

* Remove quic log

* Update deps
2022-07-01 12:52:39 -07:00
Marco Munizaga 8cb44cbd4e
logging: Add canonical log for misbehaving peers (#1600)
* Add misbehaving log

* Add logging when security handshake or muxer fails

* Update go-libp2p-core

* Log at the security handshake level

* Remove misbehaving log from setup muxer
2022-06-26 03:37:57 -07:00
Marten Seemann ce5ff06a6f tls: catch cases where Windows doesn't deliver the TLS error in tests 2022-05-28 22:25:17 +02:00
Marten Seemann dacdb5fc0f tls: set TCP linger to 0 on tests on Windows
Otherwise we can't reliably establish a few TCP connections in short
succession.
2022-05-28 22:25:17 +02:00
Marten Seemann 2f109aea68 tls: fix error reporting in TestInvalidCerts 2022-05-28 22:25:17 +02:00
Marten Seemann 9cb3cd1149
tls: fix flaky handshake cancelation test (#1503) 2022-05-18 12:11:39 -07:00
Marten Seemann 27cfd3f4ed switch from github.com/libp2p/go-libp2p-tls to p2p/security/tls 2022-04-27 12:00:11 +02:00
Steven Allen 6d7a3968cd feat: catch panics in TLS negotiation
Part of https://github.com/libp2p/go-libp2p/issues/1389
2022-04-19 11:42:05 +02:00
Marten Seemann 7ee67dd8d4 use tls.Conn.HandshakeContext instead of tls.Conn.Handshake (#106)
* use tls.Conn.HandshakeContext instead of tls.Conn.Handshake

* make sure that crypto/tls picks up the handshake ctx cancelation in tests
2022-04-10 06:30:15 -07:00
Marten Seemann 5ffe478c08 remove the Ginkgo test suite 2022-01-04 13:05:32 +04:00
Marten Seemann 07909fc545 migrate the transport tests away from Ginkgo 2022-01-04 13:05:30 +04:00
Marten Seemann 414ea4c984 migrate the extension tests away from Ginkgo 2022-01-04 13:04:57 +04:00
Marten Seemann 433e650113 set an actual NotBefore time on the certificate 2021-11-23 11:59:38 +04:00
Marten Seemann 1b09f16b42 set a random certificate issuer
According to RFC3280, the issuer field must not be empty.
2021-11-23 11:59:36 +04:00
Marten Seemann 2bf69fb8d4 add the peer ID to SecureInbound 2021-09-08 12:22:46 +01:00
Marten Seemann 958fc8e5b1 fix keys used for generating cert chain in tests 2021-09-05 12:28:09 +01:00
Marten Seemann 1e7a4d7b35 fix: don't fail the handshake when the libp2p extension is critical 2021-08-07 11:45:29 +01:00
Marten Seemann aa3fa7d693 fix deprecated call to key.Bytes 2021-07-23 12:09:01 +02:00
Marten Seemann aaa62b9eed fix usage of deprecated peer.IDB58Decode 2021-03-30 11:20:09 +07:00
Marten Seemann 8aa3448da2 remove setting of the TLS 1.3 GODEBUG flag 2020-07-30 12:25:36 +07:00
Marten Seemann 4fa1ab45d6 improve the error message returned when peer verification fails 2020-04-21 20:00:28 +07:00
Marten Seemann 1ca135881c update to Go 1.14 2020-03-13 09:47:22 +07:00
Steven Allen 04be62c1c8 chore: update deps
And bump minimum key to 2048.
2019-12-06 21:22:27 -05:00
Marten Seemann 3b381d806f close the underlying connection when the handshake fails 2019-11-24 18:07:58 +07:00
Steven Allen 7c0aea2417 Merge pull request #34 from libp2p/no-key-error-check
make the error check for not receiving a public key more explicit
2019-11-11 16:06:40 -08:00
Hector Sanjuan 0328485c9f Fix: Connection Closed after handshake
The context-cancelled watchdog goroutine may start running way after the
handshake has finished and the associated context has been cancelled (by the
executeDial() function in go-libp2p-swarm usuaully).

This results in the connection being closed right after being stablished.
2019-11-01 21:52:28 +01:00
Marten Seemann ea13d7a1e9 make the error check for not receiving a public key more explicit 2019-08-01 10:46:07 +07:00
Marten Seemann cca3e39b3c Merge pull request #33 from libp2p/expose-pubkey-from-certchain
expose the function to derive the peer's public key from the cert chain
2019-08-01 09:17:51 +07:00
Marten Seemann f7ede37249 expose the function to derive the peer's public key from the cert chain 2019-08-01 08:54:31 +07:00
Marten Seemann 08736ac1f3 set an ALPN value in the tls.Config 2019-07-28 06:49:08 +09:00
Marten Seemann 250af20339 don't use deprecated go-libp2p-crypto.MarshalPublicKey 2019-07-28 06:41:42 +09:00
Raúl Kripalani c37e733d40 migrate to consolidated types. (#30) 2019-05-27 12:00:30 +01:00
Marten Seemann 2684cc16ea disable session tickets
When resuming a session using session tickets, no certificate chain is
presented, and the callbacks needed to verify the peer identity would
not be called.
2019-04-07 14:36:06 +09:00
Marten Seemann 2b073e1ebf use a prefix when signing the public key 2019-03-14 11:29:54 +09:00
Marten Seemann 5f2940245f Merge pull request #23 from libp2p/chacha-preference
use ChaCha if one of the peers doesn't have AES hardware support
2019-03-14 10:58:42 +09:00
Marten Seemann a49a4b1ccf use ChaCha if one of the peers doesn't have AES hardware support 2019-03-14 10:46:49 +09:00
Marten Seemann a2bf05d881 use the new Protocol Labs PEN for the certificate extension 2019-03-14 09:55:14 +09:00
Raúl Kripalani afcc2e4cff fix logging when using secp256k1 key in tests
Co-Authored-By: marten-seemann <martenseemann@gmail.com>
2019-03-11 23:06:32 +09:00
Marten Seemann c6c1a34470 implement the new handshake 2019-03-11 14:56:28 +09:00
Marten Seemann e31e5a86ca Merge pull request #17 from libp2p/peer-verification
improve peer verification
2019-02-28 10:14:24 +09:00
Marten Seemann 20005517f5 fix package name of tlsdiag 2019-02-28 09:44:58 +09:00
Marten Seemann e996c4ac2a rename example to cmd, move to a single .go file 2019-02-28 09:30:59 +09:00
Marten Seemann e4b8bb72f3 add a command line flag to set the key type 2019-02-28 09:30:59 +09:00
Marten Seemann 7d129c2a6f add an example server and client 2019-02-28 09:30:59 +09:00