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

added debug logs

parent 99205801
Branches
Tags
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
//if it exists, check against all in the list
has, forMe, _ := m.Session.GetEdge().Check(identity.Source, fingerprint[:], ecrMsg.GetContents())
if !has {
jww.INFO.Printf("checking backup %v", preimage.MakeDefault(identity.Source))
//if it doesnt exist, check against the default fingerprint for the identity
forMe = fingerprint2.CheckIdentityFP(ecrMsg.GetIdentityFP(),
ecrMsg.GetContents(), preimage.MakeDefault(identity.Source))
......@@ -64,7 +65,7 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle, edge *edge
if !forMe {
if jww.GetLogThreshold() == jww.LevelTrace {
expectedFP := fingerprint2.IdentityFP(ecrMsg.GetContents(),
identity.Source[:])
preimage.MakeDefault(identity.Source))
jww.TRACE.Printf("Message for %d (%s) failed identity "+
"check: %v (expected-default) vs %v (received)", identity.EphId,
identity.Source, expectedFP, ecrMsg.GetIdentityFP())
......
......@@ -145,8 +145,10 @@ func buildSlotMessage(msg format.Message, recipient *id.ID, target *id.ID,
var preimage []byte
if param.IdentityPreimage != nil {
preimage = param.IdentityPreimage
jww.INFO.Printf("Sending to %s with override preimage %v", preimage)
}else{
preimage = preimage2.MakeDefault(recipient)
jww.INFO.Printf("Sending to %s with default preimage %v", preimage)
}
// Set the identity fingerprint
......
......@@ -177,6 +177,7 @@ func (s *Store) Check(identity *id.ID, identityFP []byte, messageContents []byte
}
for _, preimage := range preimages {
jww.INFO.Printf("checking %v", preimage)
if fingerprint2.CheckIdentityFP(identityFP, messageContents, preimage.Data) {
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