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
190e4d29
Commit
190e4d29
authored
3 years ago
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
WIP auth setup
parent
2b55d329
No related branches found
No related tags found
3 merge requests
!510
Release
,
!207
WIP: Client Restructure
,
!203
Symmetric broadcast
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
auth/request.go
+11
-8
11 additions, 8 deletions
auth/request.go
cmix/message/fingerprints.go
+3
-1
3 additions, 1 deletion
cmix/message/fingerprints.go
with
14 additions
and
9 deletions
auth/request.go
+
11
−
8
View file @
190e4d29
...
@@ -56,6 +56,8 @@ func (s *state) Request(partner contact.Contact, myfacts fact.FactList) (id.Roun
...
@@ -56,6 +56,8 @@ func (s *state) Request(partner contact.Contact, myfacts fact.FactList) (id.Roun
// request internal helper
// request internal helper
func
(
s
*
state
)
request
(
partner
contact
.
Contact
,
myfacts
fact
.
FactList
,
reset
bool
)
(
id
.
Round
,
error
)
{
func
(
s
*
state
)
request
(
partner
contact
.
Contact
,
myfacts
fact
.
FactList
,
reset
bool
)
(
id
.
Round
,
error
)
{
jww
.
INFO
.
Printf
(
"request(...) called"
)
//do key generation
//do key generation
rng
:=
s
.
rng
.
GetStream
()
rng
:=
s
.
rng
.
GetStream
()
defer
rng
.
Close
()
defer
rng
.
Close
()
...
@@ -102,14 +104,21 @@ func (s *state) request(partner contact.Contact, myfacts fact.FactList, reset bo
...
@@ -102,14 +104,21 @@ func (s *state) request(partner contact.Contact, myfacts fact.FactList, reset bo
}
}
contents
:=
request
.
Marshal
()
contents
:=
request
.
Marshal
()
jww
.
TRACE
.
Printf
(
"Request ECRPAYLOAD: %v"
,
request
.
GetEcrPayload
())
jww
.
TRACE
.
Printf
(
"Request MAC: %v"
,
mac
)
jww
.
INFO
.
Printf
(
"Requesting Auth with %s, msgDigest: %s"
,
partner
.
ID
,
format
.
DigestContents
(
contents
))
//register the confirm fingerprint to pick up confirm
//register the confirm fingerprint to pick up confirm
err
=
s
.
net
.
AddFingerprint
(
me
,
confirmFp
,
&
receivedConfirmService
{
err
=
s
.
net
.
AddFingerprint
(
me
,
confirmFp
,
&
receivedConfirmService
{
s
:
s
,
s
:
s
,
SentRequest
:
sr
,
SentRequest
:
sr
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
return
0
,
errors
.
Errorf
(
"Failed to register fingperint request "
+
return
0
,
errors
.
Errorf
(
"cannot register fingerprint request "
+
"to %s from %s, bailing request"
,
partner
.
ID
,
me
)
"to %s from %s, bailing request: %+v"
,
partner
.
ID
,
me
,
err
)
}
}
//register service for notification on confirmation
//register service for notification on confirmation
...
@@ -119,12 +128,6 @@ func (s *state) request(partner contact.Contact, myfacts fact.FactList, reset bo
...
@@ -119,12 +128,6 @@ func (s *state) request(partner contact.Contact, myfacts fact.FactList, reset bo
Metadata
:
partner
.
ID
[
:
],
Metadata
:
partner
.
ID
[
:
],
},
nil
)
},
nil
)
jww
.
TRACE
.
Printf
(
"Request ECRPAYLOAD: %v"
,
request
.
GetEcrPayload
())
jww
.
TRACE
.
Printf
(
"Request MAC: %v"
,
mac
)
jww
.
INFO
.
Printf
(
"Requesting Auth with %s, msgDigest: %s"
,
partner
.
ID
,
format
.
DigestContents
(
contents
))
p
:=
cmix
.
GetDefaultCMIXParams
()
p
:=
cmix
.
GetDefaultCMIXParams
()
p
.
DebugTag
=
"auth.Request"
p
.
DebugTag
=
"auth.Request"
svc
:=
message
.
Service
{
svc
:=
message
.
Service
{
...
...
This diff is collapsed.
Click to expand it.
cmix/message/fingerprints.go
+
3
−
1
View file @
190e4d29
...
@@ -8,9 +8,10 @@
...
@@ -8,9 +8,10 @@
package
message
package
message
import
(
import
(
"sync"
jww
"github.com/spf13/jwalterweatherman"
jww
"github.com/spf13/jwalterweatherman"
"gitlab.com/xx_network/crypto/csprng"
"gitlab.com/xx_network/crypto/csprng"
"sync"
"github.com/pkg/errors"
"github.com/pkg/errors"
"gitlab.com/elixxir/primitives/format"
"gitlab.com/elixxir/primitives/format"
...
@@ -64,6 +65,7 @@ func (f *FingerprintsManager) pop(clientID *id.ID,
...
@@ -64,6 +65,7 @@ func (f *FingerprintsManager) pop(clientID *id.ID,
// identity in the session
// identity in the session
func
(
f
*
FingerprintsManager
)
AddFingerprint
(
clientID
*
id
.
ID
,
func
(
f
*
FingerprintsManager
)
AddFingerprint
(
clientID
*
id
.
ID
,
fingerprint
format
.
Fingerprint
,
mp
Processor
)
error
{
fingerprint
format
.
Fingerprint
,
mp
Processor
)
error
{
jww
.
INFO
.
Printf
(
"AddFingerprint: %s"
,
fingerprint
)
f
.
Lock
()
f
.
Lock
()
defer
f
.
Unlock
()
defer
f
.
Unlock
()
...
...
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