From df68880e3af3a20108ccaf91a78b1c16360a8b93 Mon Sep 17 00:00:00 2001
From: Jake Taylor <jake@elixxir.io>
Date: Thu, 30 Jun 2022 12:54:00 -0500
Subject: [PATCH] fix integration

---
 cmd/root.go      | 16 ++++++++++++----
 xxdk/identity.go |  4 ++++
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/cmd/root.go b/cmd/root.go
index 813bd9c41..443f7042b 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -682,7 +682,6 @@ func initE2e() *xxdk.E2e {
 
 	// load the client
 	baseClient, err := xxdk.LoadCmix(storeDir, pass, params)
-
 	if err != nil {
 		jww.FATAL.Panicf("%+v", err)
 	}
@@ -690,9 +689,18 @@ func initE2e() *xxdk.E2e {
 	authCbs = makeAuthCallbacks(
 		viper.GetBool("unsafe-channel-creation"))
 
-	client, err := xxdk.Login(baseClient, authCbs, receptionIdentity)
-	if err != nil {
-		jww.FATAL.Panicf("%+v", err)
+	// Force LoginLegacy for precanned senderID
+	var client *xxdk.E2e
+	if isPrecanned := viper.GetUint("sendid") != 0; isPrecanned {
+		client, err = xxdk.LoginLegacy(baseClient, authCbs)
+		if err != nil {
+			jww.FATAL.Panicf("%+v", err)
+		}
+	} else {
+		client, err = xxdk.Login(baseClient, authCbs, receptionIdentity)
+		if err != nil {
+			jww.FATAL.Panicf("%+v", err)
+		}
 	}
 
 	if protoUser := viper.GetString("protoUserOut"); protoUser != "" {
diff --git a/xxdk/identity.go b/xxdk/identity.go
index 566ed4f19..46caef778 100644
--- a/xxdk/identity.go
+++ b/xxdk/identity.go
@@ -141,11 +141,15 @@ func (r ReceptionIdentity) DeepCopy() ReceptionIdentity {
 
 	dhKeyCopy := make([]byte, len(r.DHKeyPrivate))
 	copy(dhKeyCopy, r.DHKeyPrivate)
+
+	grpCopy := make([]byte, len(r.E2eGrp))
+	copy(grpCopy, r.E2eGrp)
 	return ReceptionIdentity{
 		ID:            r.ID.DeepCopy(),
 		RSAPrivatePem: r.RSAPrivatePem,
 		Salt:          saltCopy,
 		DHKeyPrivate:  dhKeyCopy,
+		E2eGrp:        grpCopy,
 	}
 }
 
-- 
GitLab