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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
61575d6b
Commit
61575d6b
authored
2 years ago
by
Jono Wenger
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/hotfix/integration' into hotfix/integration
parents
57e742ae
7b23b159
No related branches found
No related tags found
3 merge requests
!510
Release
,
!267
Make BuildReceptionIdentity public, and make backup restore function return a...
,
!263
Hotfix/refactor cmd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xxdk/precan.go
+14
-5
14 additions, 5 deletions
xxdk/precan.go
with
14 additions
and
5 deletions
xxdk/precan.go
+
14
−
5
View file @
61575d6b
...
...
@@ -61,9 +61,18 @@ func NewPrecannedClient(precannedID uint, defJSON, storageDir string,
func
(
m
*
E2e
)
MakePrecannedAuthenticatedChannel
(
precannedID
uint
)
(
contact
.
Contact
,
error
)
{
precan
:=
m
.
GetReceptionIdentity
()
.
GetContact
()
rng
:=
m
.
GetRng
()
.
GetStream
()
precanUserInfo
:=
createPrecannedUser
(
precannedID
,
rng
,
m
.
GetStorage
()
.
GetE2EGroup
())
rng
.
Close
()
precanRecipient
,
err
:=
buildReceptionIdentity
(
precanUserInfo
.
ReceptionID
,
precanUserInfo
.
ReceptionSalt
,
precanUserInfo
.
ReceptionRSA
,
m
.
GetStorage
()
.
GetE2EGroup
(),
precanUserInfo
.
E2eDhPrivateKey
)
if
err
!=
nil
{
return
contact
.
Contact
{},
err
}
precanContact
:=
precanRecipient
.
GetContact
()
myID
:=
binary
.
BigEndian
.
Uint64
(
m
.
Get
Storage
()
.
GetReceptionID
()
[
:
])
myID
:=
binary
.
BigEndian
.
Uint64
(
m
.
Get
ReceptionIdentity
()
.
ID
[
:
])
// Pick a variant based on if their ID is bigger than mine.
myVariant
:=
sidh
.
KeyVariantSidhA
theirVariant
:=
sidh
.
KeyVariant
(
sidh
.
KeyVariantSidhB
)
...
...
@@ -74,7 +83,7 @@ func (m *E2e) MakePrecannedAuthenticatedChannel(precannedID uint) (
prng1
:=
rand
.
New
(
rand
.
NewSource
(
int64
(
precannedID
)))
theirSIDHPrivKey
:=
util
.
NewSIDHPrivateKey
(
theirVariant
)
theirSIDHPubKey
:=
util
.
NewSIDHPublicKey
(
theirVariant
)
err
:
=
theirSIDHPrivKey
.
Generate
(
prng1
)
err
=
theirSIDHPrivKey
.
Generate
(
prng1
)
if
err
!=
nil
{
return
contact
.
Contact
{},
err
}
...
...
@@ -92,7 +101,7 @@ func (m *E2e) MakePrecannedAuthenticatedChannel(precannedID uint) (
// add the precanned user as a e2e contact
// FIXME: these params need to be threaded through...
sesParam
:=
session
.
GetDefaultParams
()
_
,
err
=
m
.
e2e
.
AddPartner
(
precan
.
ID
,
precan
.
DhPubKey
,
_
,
err
=
m
.
e2e
.
AddPartner
(
precan
Contact
.
ID
,
precan
Contact
.
DhPubKey
,
m
.
e2e
.
GetHistoricalDHPrivkey
(),
theirSIDHPubKey
,
mySIDHPrivKey
,
sesParam
,
sesParam
)
...
...
@@ -100,5 +109,5 @@ func (m *E2e) MakePrecannedAuthenticatedChannel(precannedID uint) (
// the channel
m
.
GetCmix
()
.
CheckInProgressMessages
()
return
precan
,
err
return
precan
Contact
,
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