Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
78a6ca3f
Commit
78a6ca3f
authored
May 29, 2015
by
Juan Batiz-Benet
Browse files
Merge pull request #1294 from rht/cleanup-tour
Cleanup tour
parents
c0474823
1db54248
Changes
2
Show whitespace changes
Inline
Side-by-side
crypto/secio/protocol.go
View file @
78a6ca3f
...
@@ -218,7 +218,7 @@ func (s *secureSession) runHandshake() error {
...
@@ -218,7 +218,7 @@ func (s *secureSession) runHandshake() error {
s
.
local
.
ephemeralPubKey
,
genSharedKey
,
err
=
ci
.
GenerateEKeyPair
(
s
.
local
.
curveT
)
s
.
local
.
ephemeralPubKey
,
genSharedKey
,
err
=
ci
.
GenerateEKeyPair
(
s
.
local
.
curveT
)
// Gather corpus to sign.
// Gather corpus to sign.
var
selectionOut
bytes
.
Buffer
selectionOut
:=
new
(
bytes
.
Buffer
)
selectionOut
.
Write
(
proposeOutBytes
)
selectionOut
.
Write
(
proposeOutBytes
)
selectionOut
.
Write
(
proposeInBytes
)
selectionOut
.
Write
(
proposeInBytes
)
selectionOut
.
Write
(
s
.
local
.
ephemeralPubKey
)
selectionOut
.
Write
(
s
.
local
.
ephemeralPubKey
)
...
@@ -249,7 +249,7 @@ func (s *secureSession) runHandshake() error {
...
@@ -249,7 +249,7 @@ func (s *secureSession) runHandshake() error {
// get their ephemeral pub key
// get their ephemeral pub key
s
.
remote
.
ephemeralPubKey
=
exchangeIn
.
GetEpubkey
()
s
.
remote
.
ephemeralPubKey
=
exchangeIn
.
GetEpubkey
()
var
selectionIn
bytes
.
Buffer
selectionIn
:=
new
(
bytes
.
Buffer
)
selectionIn
.
Write
(
proposeInBytes
)
selectionIn
.
Write
(
proposeInBytes
)
selectionIn
.
Write
(
proposeOutBytes
)
selectionIn
.
Write
(
proposeOutBytes
)
selectionIn
.
Write
(
s
.
remote
.
ephemeralPubKey
)
selectionIn
.
Write
(
s
.
remote
.
ephemeralPubKey
)
...
...
protocol/mux_test.go
View file @
78a6ca3f
...
@@ -16,8 +16,8 @@ var testCases = map[string]string{
...
@@ -16,8 +16,8 @@ var testCases = map[string]string{
func
TestWrite
(
t
*
testing
.
T
)
{
func
TestWrite
(
t
*
testing
.
T
)
{
for
k
,
v
:=
range
testCases
{
for
k
,
v
:=
range
testCases
{
var
buf
bytes
.
Buffer
buf
:=
new
(
bytes
.
Buffer
)
if
err
:=
WriteHeader
(
&
buf
,
ID
(
k
));
err
!=
nil
{
if
err
:=
WriteHeader
(
buf
,
ID
(
k
));
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
@@ -46,13 +46,13 @@ func TestHandler(t *testing.T) {
...
@@ -46,13 +46,13 @@ func TestHandler(t *testing.T) {
m
.
SetHandler
(
"/ipfs/dksnafkasnfkdajfkdajfdsjadosiaaodj"
,
h
(
"bitswap"
))
m
.
SetHandler
(
"/ipfs/dksnafkasnfkdajfkdajfdsjadosiaaodj"
,
h
(
"bitswap"
))
for
k
,
v
:=
range
testCases
{
for
k
,
v
:=
range
testCases
{
var
buf
bytes
.
Buffer
buf
:=
new
(
bytes
.
Buffer
)
if
_
,
err
:=
buf
.
Write
([]
byte
(
v
));
err
!=
nil
{
if
_
,
err
:=
buf
.
Write
([]
byte
(
v
));
err
!=
nil
{
t
.
Error
(
err
)
t
.
Error
(
err
)
continue
continue
}
}
name
,
err
:=
ReadHeader
(
&
buf
)
name
,
err
:=
ReadHeader
(
buf
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Error
(
err
)
t
.
Error
(
err
)
continue
continue
...
...
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