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
4e4eb707
Commit
4e4eb707
authored
3 years ago
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
added a ton of logging to garbled messages
parent
82885c9d
No related branches found
No related tags found
2 merge requests
!170
Release
,
!125
Garbled message logging
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
network/message/garbled.go
+11
-2
11 additions, 2 deletions
network/message/garbled.go
network/message/sendCmixUtils.go
+3
-1
3 additions, 1 deletion
network/message/sendCmixUtils.go
with
14 additions
and
3 deletions
network/message/garbled.go
+
11
−
2
View file @
4e4eb707
...
@@ -8,10 +8,12 @@
...
@@ -8,10 +8,12 @@
package
message
package
message
import
(
import
(
"encoding/base64"
"fmt"
"fmt"
jww
"github.com/spf13/jwalterweatherman"
jww
"github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/interfaces/message"
"gitlab.com/elixxir/client/interfaces/message"
"gitlab.com/elixxir/client/stoppable"
"gitlab.com/elixxir/client/stoppable"
"gitlab.com/elixxir/crypto/fingerprint"
"gitlab.com/elixxir/primitives/format"
"gitlab.com/elixxir/primitives/format"
"gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/id/ephemeral"
"gitlab.com/xx_network/primitives/id/ephemeral"
...
@@ -45,6 +47,7 @@ func (m *Manager) processGarbledMessages(stop *stoppable.Single) {
...
@@ -45,6 +47,7 @@ func (m *Manager) processGarbledMessages(stop *stoppable.Single) {
stop
.
ToStopped
()
stop
.
ToStopped
()
return
return
case
<-
m
.
triggerGarbled
:
case
<-
m
.
triggerGarbled
:
jww
.
INFO
.
Printf
(
"[GARBLE] Checking Garbled messages"
)
m
.
handleGarbledMessages
()
m
.
handleGarbledMessages
()
}
}
}
}
...
@@ -56,11 +59,16 @@ func (m *Manager) handleGarbledMessages() {
...
@@ -56,11 +59,16 @@ func (m *Manager) handleGarbledMessages() {
e2eKv
:=
m
.
Session
.
E2e
()
e2eKv
:=
m
.
Session
.
E2e
()
var
failedMsgs
[]
format
.
Message
var
failedMsgs
[]
format
.
Message
//try to decrypt every garbled message, excising those who's counts are too high
//try to decrypt every garbled message, excising those who's counts are too high
i
:=
0
for
grbldMsg
,
count
,
timestamp
,
has
:=
garbledMsgs
.
Next
();
has
;
grbldMsg
,
count
,
timestamp
,
has
=
garbledMsgs
.
Next
()
{
for
grbldMsg
,
count
,
timestamp
,
has
:=
garbledMsgs
.
Next
();
has
;
grbldMsg
,
count
,
timestamp
,
has
=
garbledMsgs
.
Next
()
{
//if it exists, check against all in the list
//if it exists, check against all in the list
modifiedContents
:=
append
([]
byte
{
0
},
grbldMsg
.
GetContents
()
...
)
modifiedContents
:=
append
([]
byte
{
0
},
grbldMsg
.
GetContents
()
...
)
identity
:=
m
.
Session
.
GetUser
()
.
GetContact
()
.
ID
identity
:=
m
.
Session
.
GetUser
()
.
ReceptionID
_
,
forMe
,
_
:=
m
.
Session
.
GetEdge
()
.
Check
(
identity
,
grbldMsg
.
GetIdentityFP
(),
modifiedContents
)
hasID
,
forMe
,
_
:=
m
.
Session
.
GetEdge
()
.
Check
(
identity
,
grbldMsg
.
GetIdentityFP
(),
modifiedContents
)
jww
.
INFO
.
Printf
(
"[GARBLE] Msg %d -- hasID: %t, forMe: %t, identity: %s, "
+
"fp: %s, contentsHash: %s"
,
i
,
hasID
,
forMe
,
identity
,
base64
.
StdEncoding
.
EncodeToString
(
grbldMsg
.
GetIdentityFP
()),
base64
.
StdEncoding
.
EncodeToString
(
fingerprint
.
GetMessageHash
(
modifiedContents
)))
if
forMe
{
if
forMe
{
fingerprint
:=
grbldMsg
.
GetKeyFP
()
fingerprint
:=
grbldMsg
.
GetKeyFP
()
// Check if the key is there, process it if it is
// Check if the key is there, process it if it is
...
@@ -121,6 +129,7 @@ func (m *Manager) handleGarbledMessages() {
...
@@ -121,6 +129,7 @@ func (m *Manager) handleGarbledMessages() {
m
.
Session
.
GetGarbledMessages
()
.
Add
(
grbldMsg
)
m
.
Session
.
GetGarbledMessages
()
.
Add
(
grbldMsg
)
m
.
Switchboard
.
Speak
(
raw
)
m
.
Switchboard
.
Speak
(
raw
)
}
}
i
++
}
}
// fail the message if any part of the decryption fails,
// fail the message if any part of the decryption fails,
...
...
This diff is collapsed.
Click to expand it.
network/message/sendCmixUtils.go
+
3
−
1
View file @
4e4eb707
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
package
message
package
message
import
(
import
(
"encoding/base64"
"github.com/pkg/errors"
"github.com/pkg/errors"
jww
"github.com/spf13/jwalterweatherman"
jww
"github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/interfaces/message"
"gitlab.com/elixxir/client/interfaces/message"
...
@@ -159,7 +160,8 @@ func buildSlotMessage(msg format.Message, recipient *id.ID, target *id.ID,
...
@@ -159,7 +160,8 @@ func buildSlotMessage(msg format.Message, recipient *id.ID, target *id.ID,
msg
.
SetIdentityFP
(
ifp
)
msg
.
SetIdentityFP
(
ifp
)
jww
.
INFO
.
Printf
(
"Sending to %s with preimage %v, ifp: %v"
,
recipient
,
preimage
,
ifp
)
jww
.
INFO
.
Printf
(
"Sending to %s with preimage %v, ifp: %v, messageHash: %s"
,
recipient
,
preimage
,
ifp
,
base64
.
StdEncoding
.
EncodeToString
(
append
([]
byte
{
0
},
msg
.
GetContents
()
...
)))
// Encrypt the message
// Encrypt the message
salt
:=
make
([]
byte
,
32
)
salt
:=
make
([]
byte
,
32
)
...
...
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