Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
a7ce3183
Commit
a7ce3183
authored
May 2, 2022
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
fixes to connect.go
parent
8900e521
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!510
Release
,
!207
WIP: Client Restructure
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
connect/connect.go
+13
-2
13 additions, 2 deletions
connect/connect.go
with
13 additions
and
2 deletions
connect/connect.go
+
13
−
2
View file @
a7ce3183
...
...
@@ -17,6 +17,7 @@ import (
clientE2e
"gitlab.com/elixxir/client/e2e"
"gitlab.com/elixxir/client/e2e/ratchet/partner"
"gitlab.com/elixxir/client/e2e/receive"
"gitlab.com/elixxir/client/e2e/rekey"
"gitlab.com/elixxir/client/event"
"gitlab.com/elixxir/client/storage/versioned"
"gitlab.com/elixxir/crypto/contact"
...
...
@@ -65,6 +66,7 @@ type handler struct {
// Params for managing Connection objects
type
Params
struct
{
auth
auth
.
Param
rekey
rekey
.
Params
event
event
.
Reporter
}
...
...
@@ -72,6 +74,7 @@ type Params struct {
func
GetDefaultParams
()
Params
{
return
Params
{
auth
:
auth
.
GetDefaultParams
(),
rekey
:
rekey
.
GetDefaultParams
(),
event
:
nil
,
}
}
...
...
@@ -79,13 +82,17 @@ func GetDefaultParams() Params {
// Connect performs auth key negotiation with the given recipient,
// and returns a Connection object for the newly-created partner.Manager
// This function is to be used sender-side and will block until the partner.Manager is confirmed
func
Connect
(
recipient
contact
.
Contact
,
myId
*
id
.
ID
,
rng
*
fastRNG
.
StreamGenerator
,
func
Connect
(
recipient
contact
.
Contact
,
myId
*
id
.
ID
,
privKey
*
cyclic
.
Int
,
rng
*
fastRNG
.
StreamGenerator
,
grp
*
cyclic
.
Group
,
net
cmix
.
Client
,
p
Params
)
(
Connection
,
error
)
{
// Build an ephemeral KV
kv
:=
versioned
.
NewKV
(
ekv
.
MakeMemstore
())
// Build E2e handler
err
:=
clientE2e
.
Init
(
kv
,
myId
,
privKey
,
grp
,
p
.
rekey
)
if
err
!=
nil
{
return
nil
,
err
}
e2eHandler
,
err
:=
clientE2e
.
Load
(
kv
,
net
,
myId
,
grp
,
rng
,
p
.
event
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -127,13 +134,17 @@ func Connect(recipient contact.Contact, myId *id.ID, rng *fastRNG.StreamGenerato
// RegisterConnectionCallback assembles a Connection object on the reception-side
// and feeds it into the given Callback whenever an incoming request
// for an E2E partnership with a partner.Manager is confirmed.
func
RegisterConnectionCallback
(
cb
Callback
,
myId
*
id
.
ID
,
rng
*
fastRNG
.
StreamGenerator
,
func
RegisterConnectionCallback
(
cb
Callback
,
myId
*
id
.
ID
,
privKey
*
cyclic
.
Int
,
rng
*
fastRNG
.
StreamGenerator
,
grp
*
cyclic
.
Group
,
net
cmix
.
Client
,
p
Params
)
error
{
// Build an ephemeral KV
kv
:=
versioned
.
NewKV
(
ekv
.
MakeMemstore
())
// Build E2e handler
err
:=
clientE2e
.
Init
(
kv
,
myId
,
privKey
,
grp
,
p
.
rekey
)
if
err
!=
nil
{
return
err
}
e2eHandler
,
err
:=
clientE2e
.
Load
(
kv
,
net
,
myId
,
grp
,
rng
,
p
.
event
)
if
err
!=
nil
{
return
err
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment