Commit 32417724 authored by Jeromy's avatar Jeromy

Reenable secure channel code

parent f89cfc11
...@@ -184,41 +184,43 @@ func (s *SecurePipe) handshake() error { ...@@ -184,41 +184,43 @@ func (s *SecurePipe) handshake() error {
} }
cmp := bytes.Compare(myPubKey, proposeResp.GetPubkey()) cmp := bytes.Compare(myPubKey, proposeResp.GetPubkey())
//mIV, tIV, mCKey, tCKey, mMKey, tMKey := ci.KeyStretcher(cmp, cipherType, hashType, secret) mIV, tIV, mCKey, tCKey, mMKey, tMKey := ci.KeyStretcher(cmp, cipherType, hashType, secret)
ci.KeyStretcher(cmp, cipherType, hashType, secret) //ci.KeyStretcher(cmp, cipherType, hashType, secret)
//go s.handleSecureIn(hashType, cipherType, tIV, tCKey, tMKey) go s.handleSecureIn(hashType, cipherType, tIV, tCKey, tMKey)
//go s.handleSecureOut(hashType, cipherType, mIV, mCKey, mMKey) go s.handleSecureOut(hashType, cipherType, mIV, mCKey, mMKey)
// Disable Secure Channel /*
go func(sp *SecurePipe) { // Disable Secure Channel
for { go func(sp *SecurePipe) {
select { for {
case <-sp.ctx.Done(): select {
return case <-sp.ctx.Done():
case m, ok := <-sp.insecure.In:
if !ok {
sp.cancel()
return return
case m, ok := <-sp.insecure.In:
if !ok {
sp.cancel()
return
}
sp.In <- m
} }
sp.In <- m
} }
} }(s)
}(s) go func(sp *SecurePipe) {
go func(sp *SecurePipe) { for {
for { select {
select { case <-sp.ctx.Done():
case <-sp.ctx.Done():
return
case m, ok := <-sp.Out:
if !ok {
sp.cancel()
return return
case m, ok := <-sp.Out:
if !ok {
sp.cancel()
return
}
sp.insecure.Out <- m
} }
sp.insecure.Out <- m
} }
} }(s)
}(s) */
finished := []byte("Finished") finished := []byte("Finished")
......
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