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
7d58e534
Commit
7d58e534
authored
2 years ago
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
Update auth to use passed in E2E parameters
parent
6c727529
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!510
Release
,
!253
General Cleanup
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
auth/confirm.go
+1
-2
1 addition, 2 deletions
auth/confirm.go
auth/receivedConfirm.go
+1
-2
1 addition, 2 deletions
auth/receivedConfirm.go
auth/state.go
+18
-9
18 additions, 9 deletions
auth/state.go
with
20 additions
and
13 deletions
auth/confirm.go
+
1
−
2
View file @
7d58e534
...
...
@@ -15,7 +15,6 @@ import (
"gitlab.com/elixxir/client/auth/store"
"gitlab.com/elixxir/client/cmix"
"gitlab.com/elixxir/client/cmix/message"
"gitlab.com/elixxir/client/e2e/ratchet/partner/session"
"gitlab.com/elixxir/client/event"
util
"gitlab.com/elixxir/client/storage/utility"
"gitlab.com/elixxir/crypto/contact"
...
...
@@ -110,7 +109,7 @@ func (s *state) confirm(partner contact.Contact, serviceTag string) (
// into critical messages does not occur
// create local relationship
p
:=
session
.
GetDefault
Params
()
p
:=
s
.
sessionParams
_
,
err
:=
s
.
e2e
.
AddPartner
(
partner
.
ID
,
partner
.
DhPubKey
,
dhPriv
,
rr
.
GetTheirSidHPubKeyA
(),
sidhPriv
,
p
,
p
)
if
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
auth/receivedConfirm.go
+
1
−
2
View file @
7d58e534
...
...
@@ -9,7 +9,6 @@ import (
"gitlab.com/elixxir/client/cmix/identity/receptionID"
"gitlab.com/elixxir/client/cmix/message"
"gitlab.com/elixxir/client/cmix/rounds"
"gitlab.com/elixxir/client/e2e/ratchet/partner/session"
"gitlab.com/elixxir/crypto/contact"
cAuth
"gitlab.com/elixxir/crypto/e2e/auth"
"gitlab.com/elixxir/primitives/fact"
...
...
@@ -90,7 +89,7 @@ func (rcs *receivedConfirmService) Process(msg format.Message,
}
// add the partner
p
:=
session
.
GetDefault
Params
()
p
:=
authState
.
session
Params
_
,
err
=
authState
.
e2e
.
AddPartner
(
rcs
.
GetPartner
(),
partnerPubKey
,
rcs
.
GetMyPrivKey
(),
partnerSIDHPubKey
,
rcs
.
GetMySIDHPrivKey
(),
p
,
p
)
if
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
auth/state.go
+
18
−
9
View file @
7d58e534
...
...
@@ -9,12 +9,14 @@ package auth
import
(
"encoding/base64"
"github.com/pkg/errors"
"gitlab.com/elixxir/client/auth/store"
"gitlab.com/elixxir/client/cmix"
"gitlab.com/elixxir/client/cmix/identity/receptionID"
"gitlab.com/elixxir/client/cmix/message"
"gitlab.com/elixxir/client/e2e"
"gitlab.com/elixxir/client/e2e/ratchet/partner/session"
"gitlab.com/elixxir/client/event"
"gitlab.com/elixxir/client/storage/versioned"
"gitlab.com/elixxir/crypto/fastRNG"
...
...
@@ -37,6 +39,10 @@ type state struct {
params
Params
// These are the parameters used when creating/adding session
// partners
sessionParams
session
.
Params
backupTrigger
func
(
reason
string
)
}
...
...
@@ -56,11 +62,12 @@ type state struct {
// with a memory only versioned.KV) as well as a memory only versioned.KV for
// NewState and use GetDefaultTemporaryParams() for the parameters
func
NewState
(
kv
*
versioned
.
KV
,
net
cmix
.
Client
,
e2e
e2e
.
Handler
,
rng
*
fastRNG
.
StreamGenerator
,
event
event
.
Reporter
,
params
Params
,
callbacks
Callbacks
,
backupTrigger
func
(
reason
string
))
(
State
,
error
)
{
rng
*
fastRNG
.
StreamGenerator
,
event
event
.
Reporter
,
authParams
Params
,
sessParams
session
.
Params
,
callbacks
Callbacks
,
backupTrigger
func
(
reason
string
))
(
State
,
error
)
{
kv
=
kv
.
Prefix
(
makeStorePrefix
(
e2e
.
GetReceptionID
()))
return
NewStateLegacy
(
kv
,
net
,
e2e
,
rng
,
event
,
params
,
callbacks
,
backupTrigger
)
return
NewStateLegacy
(
kv
,
net
,
e2e
,
rng
,
event
,
authParams
,
sessParams
,
callbacks
,
backupTrigger
)
}
// NewStateLegacy loads the auth state or creates new auth state if one cannot
...
...
@@ -68,8 +75,9 @@ func NewState(kv *versioned.KV, net cmix.Client, e2e e2e.Handler,
// Does not modify the kv prefix for backwards compatibility.
// Otherwise, acts the same as NewState
func
NewStateLegacy
(
kv
*
versioned
.
KV
,
net
cmix
.
Client
,
e2e
e2e
.
Handler
,
rng
*
fastRNG
.
StreamGenerator
,
event
event
.
Reporter
,
params
Params
,
callbacks
Callbacks
,
backupTrigger
func
(
reason
string
))
(
State
,
error
)
{
rng
*
fastRNG
.
StreamGenerator
,
event
event
.
Reporter
,
authParams
Params
,
sessParams
session
.
Params
,
callbacks
Callbacks
,
backupTrigger
func
(
reason
string
))
(
State
,
error
)
{
s
:=
&
state
{
callbacks
:
callbacks
,
...
...
@@ -78,7 +86,8 @@ func NewStateLegacy(kv *versioned.KV, net cmix.Client, e2e e2e.Handler,
e2e
:
e2e
,
rng
:
rng
,
event
:
event
,
params
:
params
,
params
:
authParams
,
sessionParams
:
sessParams
,
backupTrigger
:
backupTrigger
,
}
...
...
@@ -90,13 +99,13 @@ func NewStateLegacy(kv *versioned.KV, net cmix.Client, e2e e2e.Handler,
// register services
net
.
AddService
(
e2e
.
GetReceptionID
(),
message
.
Service
{
Identifier
:
e2e
.
GetReceptionID
()[
:
],
Tag
:
p
arams
.
RequestTag
,
Tag
:
authP
arams
.
RequestTag
,
Metadata
:
nil
,
},
&
receivedRequestService
{
s
:
s
,
reset
:
false
})
net
.
AddService
(
e2e
.
GetReceptionID
(),
message
.
Service
{
Identifier
:
e2e
.
GetReceptionID
()[
:
],
Tag
:
p
arams
.
ResetRequestTag
,
Tag
:
authP
arams
.
ResetRequestTag
,
Metadata
:
nil
,
},
&
receivedRequestService
{
s
:
s
,
reset
:
true
})
...
...
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