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

added more debug prints

parent be096603
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ func (m *Manager) StartProcessies() stoppable.Stoppable {
// specific
fpType, sr, myHistoricalPrivKey, err := authStore.GetFingerprint(fp)
if err != nil {
jww.INFO.Printf("FINGERPRINT FAILURE: %s", err.Error())
jww.TRACE.Printf("FINGERPRINT FAILURE: %s", err.Error())
// if the lookup fails, ignore the message. It is likely
// garbled or for a different protocol
break
......@@ -58,6 +58,8 @@ func (m *Manager) StartProcessies() stoppable.Stoppable {
// if it is specific, that means the original request was sent
// by this users and a confirmation has been received
case auth.Specific:
jww.INFO.Printf("Received AutConfirm from %s," +
" msgDigest: %s", sr.GetPartner(), cmixMsg.Digest())
m.handleConfirm(cmixMsg, sr, grp)
}
}
......@@ -76,8 +78,8 @@ func (m *Manager) handleRequest(cmixMsg format.Message,
myPubKey := diffieHellman.GeneratePublicKey(myHistoricalPrivKey, grp)
jww.INFO.Printf("handleRequest MYPUBKEY: %v", myPubKey.Bytes())
jww.INFO.Printf("handleRequest PARTNERPUBKEY: %v", partnerPubKey.Bytes())
jww.TRACE.Printf("handleRequest MYPUBKEY: %v", myPubKey.Bytes())
jww.TRACE.Printf("handleRequest PARTNERPUBKEY: %v", partnerPubKey.Bytes())
//decrypt the message
success, payload := cAuth.Decrypt(myHistoricalPrivKey,
......@@ -113,6 +115,9 @@ func (m *Manager) handleRequest(cmixMsg format.Message,
return
}
jww.INFO.Printf("Received AuthRequest from %s," +
" msgDigest: %s", partnerID, cmixMsg.Digest())
/*do state edge checks*/
// check if a relationship already exists.
// if it does and the keys used are the same as we have, send a
......@@ -143,10 +148,14 @@ func (m *Manager) handleRequest(cmixMsg format.Message,
// if we sent a request, then automatically confirm
// then exit, nothing else needed
case auth.Sent:
jww.INFO.Printf("Received AuthRequest from %s," +
" msgDigest: %s which has been requested, auto-confirming",
partnerID, cmixMsg.Digest())
// do the confirmation
if err := m.doConfirm(sr2, grp, partnerPubKey, myPubKey,
ecrFmt.GetOwnership()); err != nil {
jww.WARN.Printf("Confirmation failed: %s", err)
jww.WARN.Printf("Auto Confirmation with %s failed: %s",
partnerID, err)
}
//exit
return
......@@ -208,8 +217,8 @@ func (m *Manager) handleConfirm(cmixMsg format.Message, sr *auth.SentRequest,
return
}
jww.INFO.Printf("handleConfirm PARTNERPUBKEY: %v", partnerPubKey.Bytes())
jww.INFO.Printf("handleConfirm SRMYPUBKEY: %v", sr.GetMyPubKey().Bytes())
jww.TRACE.Printf("handleConfirm PARTNERPUBKEY: %v", partnerPubKey.Bytes())
jww.TRACE.Printf("handleConfirm SRMYPUBKEY: %v", sr.GetMyPubKey().Bytes())
// decrypt the payload
success, payload := cAuth.Decrypt(sr.GetMyPrivKey(),
......
......@@ -13,3 +13,14 @@ const (
None EncryptionType = 0
E2E EncryptionType = 1
)
func (et EncryptionType)String()string{
switch et{
case None:
return "None"
case E2E:
return "E2E"
default:
return "Unknown"
}
}
\ No newline at end of file
......@@ -103,6 +103,9 @@ func (m *Manager) handleMessage(ecrMsg format.Message, identity reception.Identi
return
}
jww.INFO.Printf("Received message of type %s from %s," +
" msgDigest: %s", encTy, sender, msg.Digest())
// Process the decrypted/unencrypted message partition, to see if
// we get a full message
xxMsg, ok := m.partitioner.HandlePartition(sender, encTy, msg.GetContents(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment