From 1a4f31bb7a885a9d40956e9e2ab6d4f85f492105 Mon Sep 17 00:00:00 2001 From: Jono Wenger <jono@elixxir.io> Date: Tue, 13 Apr 2021 18:51:10 +0000 Subject: [PATCH] XX-3177 / Fix IdentityFP and CheckIdentityFP error returns --- go.mod | 2 +- go.sum | 4 ++++ network/message/handler.go | 7 ++----- network/message/sendCmix.go | 8 +------- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index c0ce181a7..5ea6ed4e2 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/spf13/viper v1.7.1 gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 gitlab.com/elixxir/comms v0.0.4-0.20210413160356-853e51fc18e5 - gitlab.com/elixxir/crypto v0.0.7-0.20210412231025-6f75c577f803 + gitlab.com/elixxir/crypto v0.0.7-0.20210413184512-e41c09223958 gitlab.com/elixxir/ekv v0.1.5 gitlab.com/elixxir/primitives v0.0.3-0.20210409190923-7bf3cd8d97e7 gitlab.com/xx_network/comms v0.0.4-0.20210409202820-eb3dca6571d3 diff --git a/go.sum b/go.sum index 2c9ea3fd1..402ad9912 100644 --- a/go.sum +++ b/go.sum @@ -269,6 +269,10 @@ gitlab.com/elixxir/crypto v0.0.7-0.20210412195114-be927031747a h1:DSYIXSCWrwkyHU gitlab.com/elixxir/crypto v0.0.7-0.20210412195114-be927031747a/go.mod h1:HMMRBuv/yMqB5c31G9OPlOAifOOqGypCyD5v6py+4vo= gitlab.com/elixxir/crypto v0.0.7-0.20210412231025-6f75c577f803 h1:8sLODlAYRT0Y9NA+uoMoF1qBrBRrW5TikyKAOvyCd+E= gitlab.com/elixxir/crypto v0.0.7-0.20210412231025-6f75c577f803/go.mod h1:HMMRBuv/yMqB5c31G9OPlOAifOOqGypCyD5v6py+4vo= +gitlab.com/elixxir/crypto v0.0.7-0.20210413182603-9525e6071fa7 h1:V004OOQrZ6F0iH4BwjObFWbWWqzvKbXRd3Dv2UEz6AI= +gitlab.com/elixxir/crypto v0.0.7-0.20210413182603-9525e6071fa7/go.mod h1:HMMRBuv/yMqB5c31G9OPlOAifOOqGypCyD5v6py+4vo= +gitlab.com/elixxir/crypto v0.0.7-0.20210413184512-e41c09223958 h1:tjEWlRieizWKnHFV1Q0nNegHT5QJJf9hECiM7nJSbik= +gitlab.com/elixxir/crypto v0.0.7-0.20210413184512-e41c09223958/go.mod h1:HMMRBuv/yMqB5c31G9OPlOAifOOqGypCyD5v6py+4vo= gitlab.com/elixxir/ekv v0.1.5 h1:R8M1PA5zRU1HVnTyrtwybdABh7gUJSCvt1JZwUSeTzk= gitlab.com/elixxir/ekv v0.1.5/go.mod h1:e6WPUt97taFZe5PFLPb1Dupk7tqmDCTQu1kkstqJvw4= gitlab.com/elixxir/primitives v0.0.0-20200731184040-494269b53b4d/go.mod h1:OQgUZq7SjnE0b+8+iIAT2eqQF+2IFHn73tOo+aV11mg= diff --git a/network/message/handler.go b/network/message/handler.go index 88484e6fb..b8892cff5 100644 --- a/network/message/handler.go +++ b/network/message/handler.go @@ -48,14 +48,11 @@ func (m *Manager) handleMessage(ecrMsg format.Message, identity reception.Identi var relationshipFingerprint []byte //check if the identity fingerprint matches - forMe, err := fingerprint2.CheckIdentityFP(ecrMsg.GetIdentityFP(), + forMe := fingerprint2.CheckIdentityFP(ecrMsg.GetIdentityFP(), ecrMsg.GetContents(), identity.Source) - if err != nil { - jww.FATAL.Panicf("Could not check IdentityFingerprint: %+v", err) - } if !forMe { if jww.GetLogThreshold() == jww.LevelTrace { - expectedFP, _ := fingerprint2.IdentityFP(ecrMsg.GetContents(), + expectedFP := fingerprint2.IdentityFP(ecrMsg.GetContents(), identity.Source) jww.TRACE.Printf("Message for %d (%s) failed identity "+ "check: %v (expected) vs %v (received)", identity.EphId, diff --git a/network/message/sendCmix.go b/network/message/sendCmix.go index 1aced6efe..7e0e0e633 100644 --- a/network/message/sendCmix.go +++ b/network/message/sendCmix.go @@ -108,13 +108,7 @@ func sendCmixHelper(msg format.Message, recipient *id.ID, param params.CMIX, ins msg.SetEphemeralRID(ephIdFilled[:]) //set the identity fingerprint - ifp, err := fingerprint.IdentityFP(msg.GetContents(), recipient) - if err != nil { - jww.FATAL.Panicf("failed to generate the Identity "+ - "fingerprint due to unrecoverable error when sending to %s "+ - "(msgDigest: %s): %+v", recipient, msg.Digest(), err) - } - + ifp := fingerprint.IdentityFP(msg.GetContents(), recipient) msg.SetIdentityFP(ifp) //build the topology -- GitLab