summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2021-02-24 18:30:14 -0500
committerrsiddharth <s@ricketyspace.net>2021-02-24 18:30:14 -0500
commit5312ff721fe74a8d2a4085bfd331680b497ea043 (patch)
tree7c1594f9ae82541fc83af589ea5309a4b9e35440 /lib
parent9d96d7e781710b306cf40828e35843656ddfe72e (diff)
lib: update webSessionEncryptionKey
Use RandomBytes to set `webSessionEncryptionKey`
Diffstat (limited to 'lib')
-rw-r--r--lib/web.go8
1 files changed, 4 insertions, 4 deletions
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)
}