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

added debug logs

parent 99205801
No related branches found
No related tags found
3 merge requests!67Release,!60Hotfic/preimage,!55fully implemented trial hashing of identity fingerprints. Needs tests.
...@@ -56,6 +56,7 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle, edge *edge ...@@ -56,6 +56,7 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle, edge *edge
//if it exists, check against all in the list //if it exists, check against all in the list
has, forMe, _ := m.Session.GetEdge().Check(identity.Source, fingerprint[:], ecrMsg.GetContents()) has, forMe, _ := m.Session.GetEdge().Check(identity.Source, fingerprint[:], ecrMsg.GetContents())
if !has { if !has {
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(),
ecrMsg.GetContents(), preimage.MakeDefault(identity.Source)) ecrMsg.GetContents(), preimage.MakeDefault(identity.Source))
...@@ -64,7 +65,7 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle, edge *edge ...@@ -64,7 +65,7 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle, edge *edge
if !forMe { if !forMe {
if jww.GetLogThreshold() == jww.LevelTrace { if jww.GetLogThreshold() == jww.LevelTrace {
expectedFP := fingerprint2.IdentityFP(ecrMsg.GetContents(), expectedFP := fingerprint2.IdentityFP(ecrMsg.GetContents(),
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,
identity.Source, expectedFP, ecrMsg.GetIdentityFP()) identity.Source, expectedFP, ecrMsg.GetIdentityFP())
......
...@@ -145,8 +145,10 @@ func buildSlotMessage(msg format.Message, recipient *id.ID, target *id.ID, ...@@ -145,8 +145,10 @@ func buildSlotMessage(msg format.Message, recipient *id.ID, target *id.ID,
var preimage []byte var preimage []byte
if param.IdentityPreimage != nil { if param.IdentityPreimage != nil {
preimage = param.IdentityPreimage preimage = param.IdentityPreimage
jww.INFO.Printf("Sending to %s with override preimage %v", preimage)
}else{ }else{
preimage = preimage2.MakeDefault(recipient) preimage = preimage2.MakeDefault(recipient)
jww.INFO.Printf("Sending to %s with default preimage %v", preimage)
} }
// Set the identity fingerprint // Set the identity fingerprint
......
...@@ -177,6 +177,7 @@ func (s *Store) Check(identity *id.ID, identityFP []byte, messageContents []byte ...@@ -177,6 +177,7 @@ func (s *Store) Check(identity *id.ID, identityFP []byte, messageContents []byte
} }
for _, preimage := range preimages { for _, preimage := range preimages {
jww.INFO.Printf("checking %v", preimage)
if fingerprint2.CheckIdentityFP(identityFP, messageContents, preimage.Data) { if fingerprint2.CheckIdentityFP(identityFP, messageContents, preimage.Data) {
return true, true, preimage return true, true, preimage
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment