Commit 814cb992 authored by Brian Tiger Chow's avatar Brian Tiger Chow

misc(crypto) remove stale test

@jbenet

Handshake library has been modified to use Secure Pipe. This test
targets the old implementation.

TODO: write a new handshake test
parent 8112fae7
package spipe
import (
"testing"
ci "github.com/jbenet/go-ipfs/crypto"
"github.com/jbenet/go-ipfs/peer"
)
func TestHandshake(t *testing.T) {
ska, pka, err := ci.GenerateKeyPair(ci.RSA, 512)
if err != nil {
t.Fatal(err)
}
skb, pkb, err := ci.GenerateKeyPair(ci.RSA, 512)
if err != nil {
t.Fatal(err)
}
cha := make(chan []byte, 5)
chb := make(chan []byte, 5)
ida, err := IDFromPubKey(pka)
if err != nil {
t.Fatal(err)
}
pa := &peer.Peer{
ID: ida,
PubKey: pka,
PrivKey: ska,
}
idb, err := IDFromPubKey(pkb)
if err != nil {
t.Fatal(err)
}
pb := &peer.Peer{
ID: idb,
PubKey: pkb,
PrivKey: skb,
}
go func() {
_, _, err := Handshake(pa, pb, cha, chb)
if err != nil {
t.Fatal(err)
}
}()
_, _, err = Handshake(pb, pa, chb, cha)
if err != nil {
t.Fatal(err)
}
}
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