From 5312ff721fe74a8d2a4085bfd331680b497ea043 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Wed, 24 Feb 2021 18:30:14 -0500 Subject: lib: update webSessionEncryptionKey Use RandomBytes to set `webSessionEncryptionKey` --- lib/web.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/web.go b/lib/web.go index 191d2f2..814d016 100644 --- a/lib/web.go +++ b/lib/web.go @@ -3,16 +3,16 @@ package lib -import "crypto/rand" - type Profile map[string]string -var webSessionEncryptionKey []byte = make([]byte, 16) +var webSessionEncryptionKey []byte var webUidCounter int64 var webUserProfiles map[string]Profile = make(map[string]Profile, 0) func init() { - _, err := rand.Read(webSessionEncryptionKey) + var err error + + webSessionEncryptionKey, err = RandomBytes(16) if err != nil { panic(err) } -- cgit v1.2.3