From a8eb255c6227f95a6452efdc73da085cf56e633d Mon Sep 17 00:00:00 2001
From: "Richard T. Carback III" <rick.carback@gmail.com>
Date: Mon, 9 Nov 2020 23:12:38 +0000
Subject: [PATCH] Debug messages and outputs so far

---
 auth/request.go             | 7 +++++++
 cmd/root.go                 | 1 +
 go.mod                      | 2 +-
 go.sum                      | 4 ++++
 network/message/handler.go  | 1 +
 network/message/sendCmix.go | 1 +
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/auth/request.go b/auth/request.go
index 9251af76b..91eeb88d1 100644
--- a/auth/request.go
+++ b/auth/request.go
@@ -122,6 +122,8 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader,
 	cmixMsg.SetKeyFP(fp)
 	cmixMsg.SetMac(mac)
 	cmixMsg.SetContents(baseFmt.Marshal())
+	cmixMsg.SetRecipientID(partner.ID)
+	jww.INFO.Printf("PARTNER ID: %s", partner.ID)
 
 	/*store state*/
 	//fixme: channel is bricked if the first store succedes but the second fails
@@ -135,6 +137,11 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader,
 	//store the message as a critical message so it will always be sent
 	storage.GetCriticalRawMessages().AddProcessing(cmixMsg)
 
+	//jww.INFO.Printf("CMIX MESSAGE 1: %s, %v, %v, %v", cmixMsg.GetRecipientID(),
+	//	cmixMsg.GetKeyFP(), cmixMsg.GetMac(), cmixMsg.GetContents())
+	jww.INFO.Printf("CMIX MESSAGE FP: %s, %v", cmixMsg.GetRecipientID(),
+		cmixMsg.GetKeyFP())
+
 	/*send message*/
 	round, err := net.SendCMIX(cmixMsg, params.GetDefaultCMIX())
 	if err != nil {
diff --git a/cmd/root.go b/cmd/root.go
index 1c0ac853d..e8063ec06 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -156,6 +156,7 @@ var rootCmd = &cobra.Command{
 		if viper.GetBool("unsafe-channel-creation") {
 			authMgr.AddGeneralRequestCallback(func(
 				requestor contact.Contact, message string) {
+				jww.INFO.Printf("Got Request: %s", requestor.ID)
 				err := client.ConfirmAuthenticatedChannel(
 					requestor)
 				if err != nil {
diff --git a/go.mod b/go.mod
index 1177dcbb6..f1ae06038 100644
--- a/go.mod
+++ b/go.mod
@@ -18,7 +18,7 @@ require (
 	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/spf13/viper v1.7.1
 	gitlab.com/elixxir/comms v0.0.3
-	gitlab.com/elixxir/crypto v0.0.4
+	gitlab.com/elixxir/crypto v0.0.5-0.20201109203841-ba162a25be6e
 	gitlab.com/elixxir/ekv v0.1.3
 	gitlab.com/elixxir/primitives v0.0.2
 	gitlab.com/xx_network/comms v0.0.3
diff --git a/go.sum b/go.sum
index cd8869a5b..6bc013c92 100644
--- a/go.sum
+++ b/go.sum
@@ -258,6 +258,10 @@ gitlab.com/elixxir/crypto v0.0.3 h1:znCt/x2bL4y8czTPaaFkwzdgSgW3BJc/1+dxyf1jqVw=
 gitlab.com/elixxir/crypto v0.0.3/go.mod h1:ZNgBOblhYToR4m8tj4cMvJ9UsJAUKq+p0gCp07WQmhA=
 gitlab.com/elixxir/crypto v0.0.4 h1:8eWjvUepCU2PiqZM2NFYo6rFg1w8KWO1hMDwMNFEqoI=
 gitlab.com/elixxir/crypto v0.0.4/go.mod h1:ZNgBOblhYToR4m8tj4cMvJ9UsJAUKq+p0gCp07WQmhA=
+gitlab.com/elixxir/crypto v0.0.5-0.20201109195944-c4a4090b258a h1:SnZm8bO8Cw4j7FDGqzt4kfP58peuNE3z1Q3NqifXwns=
+gitlab.com/elixxir/crypto v0.0.5-0.20201109195944-c4a4090b258a/go.mod h1:ZNgBOblhYToR4m8tj4cMvJ9UsJAUKq+p0gCp07WQmhA=
+gitlab.com/elixxir/crypto v0.0.5-0.20201109203841-ba162a25be6e h1:rkT8Pzjgo9oF3uS8ExHGNUQoJX/22qK3lU+vU8QsOCY=
+gitlab.com/elixxir/crypto v0.0.5-0.20201109203841-ba162a25be6e/go.mod h1:ZNgBOblhYToR4m8tj4cMvJ9UsJAUKq+p0gCp07WQmhA=
 gitlab.com/elixxir/ekv v0.1.3 h1:OE+LBMIhjGUMwc6hHJzYvEPNJQV7t1vMnJyIgxUMUo8=
 gitlab.com/elixxir/ekv v0.1.3/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 8e3b34f30..9018e36f8 100644
--- a/network/message/handler.go
+++ b/network/message/handler.go
@@ -72,6 +72,7 @@ func (m *Manager) handleMessage(ecrMsg format.Message) {
 			Timestamp:   time.Time{},
 			Encryption:  message.None,
 		}
+		jww.INFO.Printf("Garbled/RAW Message: %v", msg.GetKeyFP())
 		m.Session.GetGarbledMessages().Add(msg)
 		m.Switchboard.Speak(raw)
 		return
diff --git a/network/message/sendCmix.go b/network/message/sendCmix.go
index 25e93f33d..19e58074a 100644
--- a/network/message/sendCmix.go
+++ b/network/message/sendCmix.go
@@ -77,6 +77,7 @@ func (m *Manager) SendCMIX(msg format.Message, param params.CMIX) (id.Round, err
 			return 0, errors.WithMessage(err, "Failed to generate "+
 				"salt, this should never happen")
 		}
+		jww.INFO.Printf("RECIPIENTIDPRE_ENCRYPT: %s", msg.GetRecipientID())
 		encMsg, kmacs := roundKeys.Encrypt(msg, salt)
 
 		//build the message payload
-- 
GitLab