Commit 33c96f0a authored by tavit ohanian's avatar tavit ohanian

Merge branch 'port-2021-07-04'

parents e85a8ebe 9a6719a5
Pipeline #822 passed with stages
in 14 seconds
......@@ -9,7 +9,7 @@ import (
"time"
"gitlab.dms3.io/p2p/go-p2p-core/peer"
libp2ptls "gitlab.dms3.io/p2p/go-p2p-tls"
p2ptls "gitlab.dms3.io/p2p/go-p2p-tls"
)
func StartClient() error {
......@@ -33,7 +33,7 @@ func StartClient() error {
return err
}
fmt.Printf(" Peer ID: %s\n", id.Pretty())
tp, err := libp2ptls.New(priv)
tp, err := p2ptls.New(priv)
if err != nil {
return err
}
......
......@@ -8,7 +8,7 @@ import (
"time"
"gitlab.dms3.io/p2p/go-p2p-core/peer"
libp2ptls "gitlab.dms3.io/p2p/go-p2p-tls"
p2ptls "gitlab.dms3.io/p2p/go-p2p-tls"
)
func StartServer() error {
......@@ -26,7 +26,7 @@ func StartServer() error {
return err
}
fmt.Printf(" Peer ID: %s\n", id.Pretty())
tp, err := libp2ptls.New(priv)
tp, err := p2ptls.New(priv)
if err != nil {
return err
}
......@@ -53,7 +53,7 @@ func StartServer() error {
}
}
func handleConn(tp *libp2ptls.Transport, conn net.Conn) error {
func handleConn(tp *p2ptls.Transport, conn net.Conn) error {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
sconn, err := tp.SecureInbound(ctx, conn)
......
package libp2ptls
package p2ptls
import (
"crypto/tls"
......
package libp2ptls
package p2ptls
import (
"crypto/ecdsa"
......@@ -20,8 +20,8 @@ import (
)
const certValidityPeriod = 100 * 365 * 24 * time.Hour // ~100 years
const certificatePrefix = "libp2p-tls-handshake:"
const alpn string = "libp2p"
const certificatePrefix = "p2p-tls-handshake:"
const alpn string = "p2p"
var extensionID = getPrefixedExtensionID([]int{1, 1})
......@@ -121,7 +121,7 @@ func PubKeyFromCertChain(chain []*x509.Certificate) (ic.PubKey, error) {
var found bool
var keyExt pkix.Extension
// find the libp2p key extension, skipping all unknown extensions
// find the p2p key extension, skipping all unknown extensions
for _, ext := range cert.Extensions {
if extensionIDEqual(ext.Id, extensionID) {
keyExt = ext
......
package libp2ptls
package p2ptls
var extensionPrefix = []int{1, 3, 6, 1, 4, 1, 53594}
......
package libp2ptls
package p2ptls
import (
. "github.com/onsi/ginkgo"
......
package libp2ptls
package p2ptls
import (
mrand "math/rand"
......@@ -8,9 +8,9 @@ import (
. "github.com/onsi/gomega"
)
func TestLibp2pTLS(t *testing.T) {
func TestP2pTLS(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "libp2p TLS Suite")
RunSpecs(t, "p2p TLS Suite")
}
var _ = BeforeSuite(func() {
......
package libp2ptls
package p2ptls
import (
"context"
......@@ -118,7 +118,7 @@ func (t *Transport) handshake(
default:
}
if remotePubKey == nil {
return nil, errors.New("go-libp2p-tls BUG: expected remote pub key to be set")
return nil, errors.New("go-p2p-tls BUG: expected remote pub key to be set")
}
conn, err := t.setupConn(tlsConn, remotePubKey)
......
package libp2ptls
package p2ptls
import (
"context"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment