Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mpcs
dfss
Commits
95f67bf7
Commit
95f67bf7
authored
May 18, 2016
by
Richer Maximilien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[c][p] Add ip as seen by platform
parent
7a912bbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
dfssc/sign/starter.go
dfssc/sign/starter.go
+0
-1
dfssp/contract/join.go
dfssp/contract/join.go
+4
-2
No files found.
dfssc/sign/starter.go
View file @
95f67bf7
...
@@ -156,7 +156,6 @@ func (m *SignatureManager) addPeer(user *pAPI.User) (ready bool, err error) {
...
@@ -156,7 +156,6 @@ func (m *SignatureManager) addPeer(user *pAPI.User) (ready bool, err error) {
// This is an certificate authentificated TLS connection
// This is an certificate authentificated TLS connection
conn
,
err
=
net
.
Connect
(
addrPort
,
m
.
auth
.
Cert
,
m
.
auth
.
Key
,
m
.
auth
.
CA
,
user
.
KeyHash
)
conn
,
err
=
net
.
Connect
(
addrPort
,
m
.
auth
.
Cert
,
m
.
auth
.
Key
,
m
.
auth
.
CA
,
user
.
KeyHash
)
if
err
==
nil
{
if
err
==
nil
{
break
break
}
}
}
}
...
...
dfssp/contract/join.go
View file @
95f67bf7
package
contract
package
contract
import
(
import
(
n
"net"
"time"
"time"
"dfss/auth"
"dfss/auth"
...
@@ -20,7 +21,7 @@ import (
...
@@ -20,7 +21,7 @@ import (
// There is no timeout, this function will shut down on stream disconnection or on error.
// There is no timeout, this function will shut down on stream disconnection or on error.
func
JoinSignature
(
db
*
mgdb
.
MongoManager
,
rooms
*
common
.
WaitingGroupMap
,
in
*
api
.
JoinSignatureRequest
,
stream
api
.
Platform_JoinSignatureServer
)
{
func
JoinSignature
(
db
*
mgdb
.
MongoManager
,
rooms
*
common
.
WaitingGroupMap
,
in
*
api
.
JoinSignatureRequest
,
stream
api
.
Platform_JoinSignatureServer
)
{
ctx
:=
stream
.
Context
()
ctx
:=
stream
.
Context
()
state
,
_
,
_
:=
net
.
GetTLSState
(
&
ctx
)
state
,
addr
,
_
:=
net
.
GetTLSState
(
&
ctx
)
hash
:=
auth
.
GetCertificateHash
(
state
.
VerifiedChains
[
0
][
0
])
hash
:=
auth
.
GetCertificateHash
(
state
.
VerifiedChains
[
0
][
0
])
if
!
checkJoinSignatureRequest
(
db
,
&
stream
,
in
.
ContractUuid
,
hash
)
{
if
!
checkJoinSignatureRequest
(
db
,
&
stream
,
in
.
ContractUuid
,
hash
)
{
...
@@ -41,10 +42,11 @@ func JoinSignature(db *mgdb.MongoManager, rooms *common.WaitingGroupMap, in *api
...
@@ -41,10 +42,11 @@ func JoinSignature(db *mgdb.MongoManager, rooms *common.WaitingGroupMap, in *api
}
}
// Broadcast self identity
// Broadcast self identity
host
,
_
,
_
:=
n
.
SplitHostPort
(
addr
.
String
())
rooms
.
Broadcast
(
roomID
,
&
api
.
User
{
rooms
.
Broadcast
(
roomID
,
&
api
.
User
{
KeyHash
:
hash
,
KeyHash
:
hash
,
Email
:
net
.
GetCN
(
&
ctx
),
Email
:
net
.
GetCN
(
&
ctx
),
Ip
:
in
.
Ip
,
Ip
:
append
(
in
.
Ip
,
host
)
,
Port
:
in
.
Port
,
Port
:
in
.
Port
,
})
})
...
...
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