From 5fd27d119166bfdf2ff462e55599f715589b3e39 Mon Sep 17 00:00:00 2001
From: "Richard T. Carback III" <rick.carback@gmail.com>
Date: Wed, 20 Apr 2022 21:05:19 +0000
Subject: [PATCH] Add E2E creation during storage initialization

---
 api/client.go | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/api/client.go b/api/client.go
index eda856840..9f4b68968 100644
--- a/api/client.go
+++ b/api/client.go
@@ -20,6 +20,7 @@ import (
 	"gitlab.com/elixxir/client/cmix"
 	"gitlab.com/elixxir/client/e2e"
 	"gitlab.com/elixxir/client/e2e/receive"
+	"gitlab.com/elixxir/client/e2e/rekey"
 	"gitlab.com/elixxir/client/event"
 	"gitlab.com/elixxir/client/interfaces"
 	"gitlab.com/elixxir/client/registration"
@@ -936,7 +937,7 @@ func checkVersionAndSetupStorage(def *ndf.NetworkDefinition,
 
 	//store the registration code for later use
 	storageSess.SetRegCode(registrationCode)
-	//move the registration state to keys generaXSted
+	//move the registration state to keys generated
 	err = storageSess.ForwardRegistrationStatus(storage.KeyGenComplete)
 
 	if err != nil {
@@ -944,5 +945,13 @@ func checkVersionAndSetupStorage(def *ndf.NetworkDefinition,
 			"change in session")
 	}
 
+	// create new E2E
+	rekeyParams := rekey.GetDefaultParams()
+	err = e2e.Init(storageSess.GetKV(), protoUser.ReceptionID,
+		protoUser.E2eDhPrivateKey, e2eGrp, rekeyParams)
+	if err != nil {
+		return nil, err
+	}
+
 	return storageSess, nil
 }
-- 
GitLab