Commit 32417724 authored by Jeromy's avatar Jeromy

Reenable secure channel code

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