Skip to content
Snippets Groups Projects
Commit 87dd38b9 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

removed the hack for the network not being updated with the correct message format

parent a833e20d
No related branches found
No related tags found
3 merge requests!170Release,!129removed the hack for the network not being updated with the correct message format,!126Dev
...@@ -59,9 +59,9 @@ func (m *Manager) handleGarbledMessages() { ...@@ -59,9 +59,9 @@ func (m *Manager) handleGarbledMessages() {
//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
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()...) grbldContents := grbldMsg.GetContents()
identity := m.Session.GetUser().ReceptionID identity := m.Session.GetUser().ReceptionID
_, forMe, _ := m.Session.GetEdge().Check(identity, grbldMsg.GetIdentityFP(), modifiedContents) _, forMe, _ := m.Session.GetEdge().Check(identity, grbldMsg.GetIdentityFP(), grbldContents)
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
......
...@@ -152,7 +152,7 @@ func TestManager_CheckGarbledMessages(t *testing.T) { ...@@ -152,7 +152,7 @@ func TestManager_CheckGarbledMessages(t *testing.T) {
copy(fmp.Timestamp, ts) copy(fmp.Timestamp, ts)
msg.SetContents(fmp.Bytes()) msg.SetContents(fmp.Bytes())
encryptedMsg := key.Encrypt(msg) encryptedMsg := key.Encrypt(msg)
msg.SetIdentityFP(fingerprint.IdentityFP(append([]byte{0}, msg.GetContents()...), preimage.Data)) // TODO: back this out after network update msg.SetIdentityFP(fingerprint.IdentityFP( msg.GetContents(), preimage.Data))
i.Session.GetGarbledMessages().Add(encryptedMsg) i.Session.GetGarbledMessages().Add(encryptedMsg)
stop := stoppable.NewSingle("stop") stop := stoppable.NewSingle("stop")
......
...@@ -54,18 +54,18 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle, edge *edge ...@@ -54,18 +54,18 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle, edge *edge
var relationshipFingerprint []byte var relationshipFingerprint []byte
//if it exists, check against all in the list //if it exists, check against all in the list
modifiedContents := append([]byte{0}, ecrMsg.GetContents()...) ecrMsgContents := ecrMsg.GetContents()
has, forMe, _ := m.Session.GetEdge().Check(identity.Source, ecrMsg.GetIdentityFP(), modifiedContents) has, forMe, _ := m.Session.GetEdge().Check(identity.Source, ecrMsg.GetIdentityFP(), ecrMsgContents)
if !has { if !has {
jww.INFO.Printf("checking backup %v", preimage.MakeDefault(identity.Source)) jww.INFO.Printf("checking backup %v", preimage.MakeDefault(identity.Source))
//if it doesnt exist, check against the default fingerprint for the identity //if it doesnt exist, check against the default fingerprint for the identity
forMe = fingerprint2.CheckIdentityFP(ecrMsg.GetIdentityFP(), forMe = fingerprint2.CheckIdentityFP(ecrMsg.GetIdentityFP(),
modifiedContents, preimage.MakeDefault(identity.Source)) ecrMsgContents, preimage.MakeDefault(identity.Source))
} }
if !forMe { if !forMe {
if jww.GetLogThreshold() == jww.LevelTrace { if jww.GetLogThreshold() == jww.LevelTrace {
expectedFP := fingerprint2.IdentityFP(modifiedContents, expectedFP := fingerprint2.IdentityFP(ecrMsgContents,
preimage.MakeDefault(identity.Source)) preimage.MakeDefault(identity.Source))
jww.TRACE.Printf("Message for %d (%s) failed identity "+ jww.TRACE.Printf("Message for %d (%s) failed identity "+
"check: %v (expected-default) vs %v (received)", identity.EphId, "check: %v (expected-default) vs %v (received)", identity.EphId,
......
...@@ -155,7 +155,7 @@ func buildSlotMessage(msg format.Message, recipient *id.ID, target *id.ID, ...@@ -155,7 +155,7 @@ func buildSlotMessage(msg format.Message, recipient *id.ID, target *id.ID,
// Set the identity fingerprint // Set the identity fingerprint
ifp := fingerprint.IdentityFP(append([]byte{0}, msg.GetContents()...), preimage) ifp := fingerprint.IdentityFP(msg.GetContents(), preimage)
msg.SetIdentityFP(ifp) msg.SetIdentityFP(ifp)
......
...@@ -10,7 +10,6 @@ package fileTransfer ...@@ -10,7 +10,6 @@ package fileTransfer
import ( import (
"bytes" "bytes"
"encoding/binary" "encoding/binary"
"fmt"
"github.com/pkg/errors" "github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman" jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/interfaces" "gitlab.com/elixxir/client/interfaces"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment