Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-unixfs
Commits
32417724
Commit
32417724
authored
Oct 27, 2014
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reenable secure channel code
parent
f89cfc11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
29 deletions
+31
-29
crypto/spipe/handshake.go
crypto/spipe/handshake.go
+31
-29
No files found.
crypto/spipe/handshake.go
View file @
32417724
...
...
@@ -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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment