Commit 673bb1ba authored by Brian Tiger Chow's avatar Brian Tiger Chow

refactor(crypto/spipe) move proto to internal pb package

https://docs.google.com/document/d/1e8kOo3r51b2BWtTs_1uADIA5djfXhPT36s6eHVRIvaU/edit
parent 488515c2
......@@ -20,6 +20,7 @@ import (
proto "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
ci "github.com/jbenet/go-ipfs/crypto"
pb "github.com/jbenet/go-ipfs/crypto/spipe/internal/pb"
peer "github.com/jbenet/go-ipfs/peer"
u "github.com/jbenet/go-ipfs/util"
)
......@@ -58,7 +59,7 @@ func (s *SecurePipe) handshake() error {
return err
}
proposeMsg := new(Propose)
proposeMsg := new(pb.Propose)
proposeMsg.Rand = nonce
proposeMsg.Pubkey = myPubKey
proposeMsg.Exchanges = &SupportedExchanges
......@@ -87,7 +88,7 @@ func (s *SecurePipe) handshake() error {
}
// u.POut("received encoded handshake\n")
proposeResp := new(Propose)
proposeResp := new(pb.Propose)
err = proto.Unmarshal(resp, proposeResp)
if err != nil {
return err
......@@ -129,7 +130,7 @@ func (s *SecurePipe) handshake() error {
handshake.Write(resp)
handshake.Write(epubkey)
exPacket := new(Exchange)
exPacket := new(pb.Exchange)
exPacket.Epubkey = epubkey
exPacket.Signature, err = s.local.PrivKey().Sign(handshake.Bytes())
......@@ -155,7 +156,7 @@ func (s *SecurePipe) handshake() error {
case resp1 = <-s.insecure.In:
}
exchangeResp := new(Exchange)
exchangeResp := new(pb.Exchange)
err = proto.Unmarshal(resp1, exchangeResp)
if err != nil {
return 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