refactor(crypto/spipe) move proto to internal pb package
https://docs.google.com/document/d/1e8kOo3r51b2BWtTs_1uADIA5djfXhPT36s6eHVRIvaU/edit
Brian Tiger Chow committed
Oct 22, 2014 at 04:04 UTC
673bb1ba689fcca30c2c1195aa6c24e5d6ca2b7a
4 files changed
+5
-4
crypto/spipe/handshake.go
+5
-4
@@ -20,6 +20,7 @@ import (
20
proto "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
21
22
ci "github.com/jbenet/go-ipfs/crypto"
23
+ pb "github.com/jbenet/go-ipfs/crypto/spipe/internal/pb"
24
peer "github.com/jbenet/go-ipfs/peer"
25
u "github.com/jbenet/go-ipfs/util"
26
)
@@ -58,7 +59,7 @@ func (s *SecurePipe) handshake() error {
59
return err
60
}
61
61
- proposeMsg := new(Propose)
62
+ proposeMsg := new(pb.Propose)
63
proposeMsg.Rand = nonce
64
proposeMsg.Pubkey = myPubKey
65
proposeMsg.Exchanges = &SupportedExchanges
@@ -87,7 +88,7 @@ func (s *SecurePipe) handshake() error {
88
}
89
90
// u.POut("received encoded handshake\n")
90
- proposeResp := new(Propose)
91
+ proposeResp := new(pb.Propose)
92
err = proto.Unmarshal(resp, proposeResp)
93
if err != nil {
94
return err
@@ -129,7 +130,7 @@ func (s *SecurePipe) handshake() error {
130
handshake.Write(resp)
131
handshake.Write(epubkey)
132
132
- exPacket := new(Exchange)
133
+ exPacket := new(pb.Exchange)
134
135
exPacket.Epubkey = epubkey
136
exPacket.Signature, err = s.local.PrivKey().Sign(handshake.Bytes())
@@ -155,7 +156,7 @@ func (s *SecurePipe) handshake() error {
156
case resp1 = <-s.insecure.In:
157
}
158
158
- exchangeResp := new(Exchange)
159
+ exchangeResp := new(pb.Exchange)
160
err = proto.Unmarshal(resp1, exchangeResp)
161
if err != nil {
162
return err