diff --git a/cmd/root.go b/cmd/root.go index 2b5fbe29df75f8bbec1875bbeeaa230b462d0745..a5612bf92ad819fd2478f177466c3bd800d4b510 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -479,8 +479,15 @@ var rootCmd = &cobra.Command{ done = true break case m := <-recvCh: - fmt.Printf("Message received: %s\n", string( - m.Payload)) + strToPrint := string(m.Payload) + if m.MessageType != catalog.XxMessage { + strToPrint = fmt.Sprintf("type is %s", + m.MessageType) + } + + fmt.Printf("Message received: %s\n", + strToPrint) + // fmt.Printf("%s", m.Timestamp) receiveCnt++ if receiveCnt == expectedCnt { diff --git a/e2e/processor.go b/e2e/processor.go index 1b6620149005c12ad456fc3b3b34ead31890a240..17e2293401209f84783f4855182f607cc8f6bd0e 100644 --- a/e2e/processor.go +++ b/e2e/processor.go @@ -2,6 +2,7 @@ package e2e import ( "fmt" + "gitlab.com/elixxir/client/e2e/ratchet/partner/session" jww "github.com/spf13/jwalterweatherman" @@ -18,6 +19,7 @@ type processor struct { func (p *processor) Process(ecrMsg format.Message, receptionID receptionID.EphemeralIdentity, round rounds.Round) { + jww.TRACE.Printf("[E2E] Process(ecrMsgDigest: %s)", ecrMsg.Digest()) // ensure the key will be marked used before returning defer p.cy.Use() diff --git a/e2e/ratchet/partner/relationship.go b/e2e/ratchet/partner/relationship.go index ff321d04becdce2e4ddeb9f18d520174b40f1b5c..bd6f60ccef05edaaa526a01288b7905f4e351829 100644 --- a/e2e/ratchet/partner/relationship.go +++ b/e2e/ratchet/partner/relationship.go @@ -273,8 +273,8 @@ func (r *relationship) getSessionForSending() *session.Session { for _, s := range sessions { status := s.Status() confirmed := s.IsConfirmed() - jww.TRACE.Printf("[REKEY] Session Status/Confirmed: %v, %v", - status, confirmed) + jww.TRACE.Printf("[REKEY] Session Status/Confirmed: (%v, %s), %v", + status, s.NegotiationStatus(), confirmed) if status == session.Active && confirmed { //always return the first confirmed active, happy path return s diff --git a/e2e/ratchet/partner/session/session.go b/e2e/ratchet/partner/session/session.go index 58d1ca8ac4ca71d2adbc3f0eaf554e1507dfee0c..d0ee6ca19b1e233699ca6d7869e7e88420046b19 100644 --- a/e2e/ratchet/partner/session/session.go +++ b/e2e/ratchet/partner/session/session.go @@ -11,6 +11,11 @@ import ( "encoding/binary" "encoding/json" "fmt" + "math" + "math/big" + "sync" + "testing" + "github.com/cloudflare/circl/dh/sidh" "github.com/pkg/errors" jww "github.com/spf13/jwalterweatherman" @@ -23,10 +28,6 @@ import ( "gitlab.com/xx_network/crypto/randomness" "gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/netTime" - "math" - "math/big" - "sync" - "testing" ) const currentSessionVersion = 0 diff --git a/e2e/receive/switchboard.go b/e2e/receive/switchboard.go index ad214f53ae524c36fa36ab62a598d76e6e732fa0..2b2160fd516fb84e59d82723392f4fb17751ed1c 100644 --- a/e2e/receive/switchboard.go +++ b/e2e/receive/switchboard.go @@ -8,11 +8,12 @@ package receive import ( + "sync" + "github.com/golang-collections/collections/set" jww "github.com/spf13/jwalterweatherman" "gitlab.com/elixxir/client/catalog" "gitlab.com/xx_network/primitives/id" - "sync" ) type Switchboard struct { @@ -139,6 +140,9 @@ func (sw *Switchboard) Speak(item Message) { // well as those that do not care about certain criteria matches := sw.matchListeners(item) + jww.TRACE.Printf("[E2E] Switchboard.Speak(SenderID: %s, MsgType: %s)", + item.Sender, item.MessageType) + //Execute hear on all matched listeners in a new goroutine matches.Do(func(i interface{}) { r := i.(Listener) diff --git a/e2e/rekey/confirm.go b/e2e/rekey/confirm.go index b6ae0a6ddaec07fa19dab7b8e86a0d374ad27b50..449aefddbbd2bd3723545ad03c1df5f9424757f9 100644 --- a/e2e/rekey/confirm.go +++ b/e2e/rekey/confirm.go @@ -32,6 +32,9 @@ func startConfirm(ratchet *ratchet.Ratchet, c chan receive.Message, } func handleConfirm(ratchet *ratchet.Ratchet, confirmation receive.Message) { + jww.DEBUG.Printf("[REKEY] handleConfirm(partner: %s)", + confirmation.Sender) + //ensure the message was encrypted properly if !confirmation.Encrypted { jww.ERROR.Printf( diff --git a/e2e/rekey/rekey.go b/e2e/rekey/rekey.go index 8de7ef2daff692cc41914f67c3d8ea7974bb84c9..960df918f20e3aee3e87a77ac4959668fc5db87c 100644 --- a/e2e/rekey/rekey.go +++ b/e2e/rekey/rekey.go @@ -96,6 +96,8 @@ func trigger(instance *commsNetwork.Instance, grp *cyclic.Group, sendE2E E2eSend func negotiate(instance *commsNetwork.Instance, grp *cyclic.Group, sendE2E E2eSender, param Params, sess *session.Session, sendTimeout time.Duration) error { + // Note: All new sending sessions are set to "Sending" status by default + //generate public key pubKey := diffieHellman.GeneratePublicKey(sess.GetMyPrivKey(), grp)