Reenable secure channel code
Jeromy committed
Oct 27, 2014 at 21:34 UTC
32417724a6e822b6a83b52f7ef7bf1be5d99fd1e
1 file changed
+31
-29
crypto/spipe/handshake.go
+31
-29
@@ -184,41 +184,43 @@ func (s *SecurePipe) handshake() error {
184
}
185
186
cmp := bytes.Compare(myPubKey, proposeResp.GetPubkey())
187
- //mIV, tIV, mCKey, tCKey, mMKey, tMKey := ci.KeyStretcher(cmp, cipherType, hashType, secret)
188
- ci.KeyStretcher(cmp, cipherType, hashType, secret)
189
-
190
- //go s.handleSecureIn(hashType, cipherType, tIV, tCKey, tMKey)
191
- //go s.handleSecureOut(hashType, cipherType, mIV, mCKey, mMKey)
192
-
193
- // Disable Secure Channel
194
- go func(sp *SecurePipe) {
195
- for {
196
- select {
197
- case <-sp.ctx.Done():
198
- return
199
- case m, ok := <-sp.insecure.In:
200
- if !ok {
201
- sp.cancel()
187
+ mIV, tIV, mCKey, tCKey, mMKey, tMKey := ci.KeyStretcher(cmp, cipherType, hashType, secret)
188
+ //ci.KeyStretcher(cmp, cipherType, hashType, secret)
189
+
190
+ go s.handleSecureIn(hashType, cipherType, tIV, tCKey, tMKey)
191
+ go s.handleSecureOut(hashType, cipherType, mIV, mCKey, mMKey)
192
+
193
+ /*
194
+ // Disable Secure Channel
195
+ go func(sp *SecurePipe) {
196
+ for {
197
+ select {
198
+ case <-sp.ctx.Done():
199
return
200
+ case m, ok := <-sp.insecure.In:
201
+ if !ok {
202
+ sp.cancel()
203
+ return
204
+ }
205
+ sp.In <- m
206
}
204
- sp.In <- m
207
}
206
- }
207
- }(s)
208
- go func(sp *SecurePipe) {
209
- for {
210
- select {
211
- case <-sp.ctx.Done():
212
- return
213
- case m, ok := <-sp.Out:
214
- if !ok {
215
- sp.cancel()
208
+ }(s)
209
+ go func(sp *SecurePipe) {
210
+ for {
211
+ select {
212
+ case <-sp.ctx.Done():
213
return
214
+ case m, ok := <-sp.Out:
215
+ if !ok {
216
+ sp.cancel()
217
+ return
218
+ }
219
+ sp.insecure.Out <- m
220
}
218
- sp.insecure.Out <- m
221
}
220
- }
221
- }(s)
222
+ }(s)
223
+ */
224
225
finished := []byte("Finished")
226