Commit 35034eda authored by Marten Seemann's avatar Marten Seemann

fix duplicate import

parent 2e8087cb
......@@ -4,7 +4,7 @@ import (
"crypto/tls"
cs "github.com/libp2p/go-conn-security"
ic "github.com/libp2p/go-libp2p-crypto"
ci "github.com/libp2p/go-libp2p-crypto"
peer "github.com/libp2p/go-libp2p-peer"
)
......@@ -12,10 +12,10 @@ type conn struct {
*tls.Conn
localPeer peer.ID
privKey ic.PrivKey
privKey ci.PrivKey
remotePeer peer.ID
remotePubKey ic.PubKey
remotePubKey ci.PubKey
}
var _ cs.Conn = &conn{}
......@@ -24,7 +24,7 @@ func (c *conn) LocalPeer() peer.ID {
return c.localPeer
}
func (c *conn) LocalPrivateKey() ic.PrivKey {
func (c *conn) LocalPrivateKey() ci.PrivKey {
return c.privKey
}
......@@ -32,6 +32,6 @@ func (c *conn) RemotePeer() peer.ID {
return c.remotePeer
}
func (c *conn) RemotePublicKey() ic.PubKey {
func (c *conn) RemotePublicKey() ci.PubKey {
return c.remotePubKey
}
......@@ -9,7 +9,6 @@ import (
cs "github.com/libp2p/go-conn-security"
ci "github.com/libp2p/go-libp2p-crypto"
ic "github.com/libp2p/go-libp2p-crypto"
peer "github.com/libp2p/go-libp2p-peer"
)
......@@ -101,7 +100,7 @@ func (t *Transport) handshake(
}
// Should be ready by this point, don't block.
var remotePubKey ic.PubKey
var remotePubKey ci.PubKey
select {
case remotePubKey = <-keyCh:
default:
......@@ -118,7 +117,7 @@ func (t *Transport) handshake(
return conn, nil
}
func (t *Transport) setupConn(tlsConn *tls.Conn, remotePubKey ic.PubKey) (cs.Conn, error) {
func (t *Transport) setupConn(tlsConn *tls.Conn, remotePubKey ci.PubKey) (cs.Conn, error) {
if remotePubKey == nil {
return nil, errors.New("go-libp2p-tls BUG: expected remote pub key to be set")
}
......
......@@ -17,7 +17,7 @@ import (
"github.com/onsi/gomega/gbytes"
cs "github.com/libp2p/go-conn-security"
ic "github.com/libp2p/go-libp2p-crypto"
ci "github.com/libp2p/go-libp2p-crypto"
peer "github.com/libp2p/go-libp2p-peer"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
......@@ -31,21 +31,21 @@ type transform struct {
var _ = Describe("Transport", func() {
var (
serverKey, clientKey ic.PrivKey
serverKey, clientKey ci.PrivKey
serverID, clientID peer.ID
)
createPeer := func() (peer.ID, ic.PrivKey) {
var priv ic.PrivKey
createPeer := func() (peer.ID, ci.PrivKey) {
var priv ci.PrivKey
if mrand.Int()%2 == 0 {
fmt.Fprintf(GinkgoWriter, " using an ECDSA key: ")
var err error
priv, _, err = ic.GenerateECDSAKeyPair(rand.Reader)
priv, _, err = ci.GenerateECDSAKeyPair(rand.Reader)
Expect(err).ToNot(HaveOccurred())
} else {
fmt.Fprintf(GinkgoWriter, " using an RSA key: ")
var err error
priv, _, err = ic.GenerateRSAKeyPair(1024, rand.Reader)
priv, _, err = ci.GenerateRSAKeyPair(1024, rand.Reader)
Expect(err).ToNot(HaveOccurred())
}
id, err := peer.IDFromPrivateKey(priv)
......
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