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
3628e8c9
Commit
3628e8c9
authored
2 years ago
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
added identity storage bindings calls
parent
11a672d0
No related branches found
No related tags found
2 merge requests
!510
Release
,
!257
change structure of identities in api and bindings
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
bindings/identity.go
+29
-0
29 additions, 0 deletions
bindings/identity.go
bindings/identity_test.go
+0
-0
0 additions, 0 deletions
bindings/identity_test.go
connect/authenticated.go
+5
-1
5 additions, 1 deletion
connect/authenticated.go
with
34 additions
and
1 deletion
bindings/
contact
.go
→
bindings/
identity
.go
+
29
−
0
View file @
3628e8c9
...
@@ -110,3 +110,32 @@ func GetFactsFromContact(marshaled []byte) ([]byte, error) {
...
@@ -110,3 +110,32 @@ func GetFactsFromContact(marshaled []byte) ([]byte, error) {
}
}
return
factsListMarshaled
,
nil
return
factsListMarshaled
,
nil
}
}
// StoreReceptionIdentity stores the given identity in Cmix storage with the given key
// This is the ideal way to securely store identities, as the caller of this function
// is only required to store the given key separately rather than the keying material
func
StoreReceptionIdentity
(
key
string
,
identity
[]
byte
,
cmixId
int
)
error
{
cmix
,
err
:=
cmixTrackerSingleton
.
get
(
cmixId
)
if
err
!=
nil
{
return
err
}
receptionIdentity
,
err
:=
xxdk
.
UnmarshalReceptionIdentity
(
identity
)
if
err
!=
nil
{
return
err
}
return
xxdk
.
StoreReceptionIdentity
(
key
,
receptionIdentity
,
cmix
.
api
)
}
// LoadReceptionIdentity loads the given identity in Cmix storage with the given key
func
LoadReceptionIdentity
(
key
string
,
cmixId
int
)
([]
byte
,
error
)
{
cmix
,
err
:=
cmixTrackerSingleton
.
get
(
cmixId
)
if
err
!=
nil
{
return
nil
,
err
}
storageObj
,
err
:=
cmix
.
api
.
GetStorage
()
.
Get
(
key
)
if
err
!=
nil
{
return
nil
,
err
}
return
storageObj
.
Data
,
nil
}
This diff is collapsed.
Click to expand it.
bindings/
contact
_test.go
→
bindings/
identity
_test.go
+
0
−
0
View file @
3628e8c9
File moved
This diff is collapsed.
Click to expand it.
connect/authenticated.go
+
5
−
1
View file @
3628e8c9
...
@@ -66,7 +66,11 @@ func ConnectWithAuthentication(recipient contact.Contact, e2eClient *xxdk.E2e,
...
@@ -66,7 +66,11 @@ func ConnectWithAuthentication(recipient contact.Contact, e2eClient *xxdk.E2e,
// Build the authenticated connection and return
// Build the authenticated connection and return
identity
:=
e2eClient
.
GetReceptionIdentity
()
identity
:=
e2eClient
.
GetReceptionIdentity
()
return
connectWithAuthentication
(
conn
,
timeStart
,
recipient
,
identity
.
Salt
,
identity
.
RSAPrivatePem
,
privKey
,
err
:=
identity
.
GetRSAPrivatePem
()
if
err
!=
nil
{
return
nil
,
err
}
return
connectWithAuthentication
(
conn
,
timeStart
,
recipient
,
identity
.
Salt
,
privKey
,
e2eClient
.
GetRng
(),
e2eClient
.
GetCmix
(),
p
)
e2eClient
.
GetRng
(),
e2eClient
.
GetCmix
(),
p
)
}
}
...
...
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