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
9fc6d2cf
Commit
9fc6d2cf
authored
4 years ago
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
Add a wait loop to wait for rekeying when we run out of keys
parent
0583d19d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
interfaces/params/E2E.go
+6
-3
6 additions, 3 deletions
interfaces/params/E2E.go
network/message/handler.go
+2
-2
2 additions, 2 deletions
network/message/handler.go
network/message/sendE2E.go
+14
-3
14 additions, 3 deletions
network/message/sendE2E.go
with
22 additions
and
8 deletions
interfaces/params/E2E.go
+
6
−
3
View file @
9fc6d2cf
...
...
@@ -15,12 +15,15 @@ import (
type
E2E
struct
{
Type
SendType
RetryCount
int
CMIX
}
func
GetDefaultE2E
()
E2E
{
return
E2E
{
Type
:
Standard
,
return
E2E
{
Type
:
Standard
,
CMIX
:
GetDefaultCMIX
(),
RetryCount
:
10
,
}
}
func
(
e
E2E
)
Marshal
()
([]
byte
,
error
)
{
...
...
This diff is collapsed.
Click to expand it.
network/message/handler.go
+
2
−
2
View file @
9fc6d2cf
...
...
@@ -50,7 +50,7 @@ func (m *Manager) handleMessage(ecrMsg format.Message, identity reception.Identi
forMe
,
err
:=
fingerprint2
.
CheckIdentityFP
(
ecrMsg
.
GetIdentityFP
(),
ecrMsg
.
GetContents
(),
identity
.
Source
)
if
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"Could not check IdentityF
I
ngerprint: %+v"
,
err
)
jww
.
FATAL
.
Panicf
(
"Could not check IdentityF
i
ngerprint: %+v"
,
err
)
}
if
!
forMe
{
return
...
...
This diff is collapsed.
Click to expand it.
network/message/sendE2E.go
+
14
−
3
View file @
9fc6d2cf
...
...
@@ -9,6 +9,7 @@ package message
import
(
"github.com/pkg/errors"
jww
"github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/interfaces/message"
"gitlab.com/elixxir/client/interfaces/params"
"gitlab.com/elixxir/client/keyExchange"
...
...
@@ -17,7 +18,6 @@ import (
"gitlab.com/xx_network/primitives/id"
"sync"
"time"
jww
"github.com/spf13/jwalterweatherman"
)
func
(
m
*
Manager
)
SendE2E
(
msg
message
.
Send
,
param
params
.
E2E
)
([]
id
.
Round
,
e2e
.
MessageID
,
error
)
{
...
...
@@ -51,7 +51,6 @@ func (m *Manager) SendE2E(msg message.Send, param params.E2E) ([]id.Round, e2e.M
jww
.
INFO
.
Printf
(
"E2E sending %d messages to %s"
,
len
(
partitions
),
msg
.
Recipient
)
for
i
,
p
:=
range
partitions
{
//create the cmix message
msgCmix
:=
format
.
NewMessage
(
m
.
Session
.
Cmix
()
.
GetGroup
()
.
GetP
()
.
ByteLen
())
...
...
@@ -59,6 +58,18 @@ func (m *Manager) SendE2E(msg message.Send, param params.E2E) ([]id.Round, e2e.M
//get a key to end to end encrypt
key
,
err
:=
partner
.
GetKeyForSending
(
param
.
Type
)
keyTries
:=
0
for
err
!=
nil
&&
keyTries
<
param
.
RetryCount
{
jww
.
WARN
.
Printf
(
"Out of sending keys for %s "
+
"(msgDigest: %s, partition: %d), this can "
+
"happen when sending messages faster than "
+
"the client can negotiate keys. Please "
+
"adjust your e2e key parameters"
,
msg
.
Recipient
,
msgCmix
.
Digest
(),
i
)
keyTries
++
time
.
Sleep
(
param
.
RetryDelay
)
key
,
err
=
partner
.
GetKeyForSending
(
param
.
Type
)
}
if
err
!=
nil
{
return
nil
,
e2e
.
MessageID
{},
errors
.
WithMessagef
(
err
,
"Failed to get key "
+
"for end to end encryption"
)
...
...
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