dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 5735d162968ef90368d3bb3b8d1ab6a6080c1ca8
parent 9cc1f10a07b07bf83d12cf3e12c50f01a7777a1c
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Mon, 19 Dec 2022 23:10:29 -0800

handle err

Diffstat:
Mpkg/database/tableChatMessages.go | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pkg/database/tableChatMessages.go b/pkg/database/tableChatMessages.go @@ -521,6 +521,8 @@ func encryptMessage(roomKey, msg string) (string, error) { return "", err } nonce := make([]byte, nonceSize) - _, _ = io.ReadFull(rand.Reader, nonce) + if _, err := io.ReadFull(rand.Reader, nonce); err != nil { + return "", err + } return string(aesgcm.Seal(nonce, nonce, []byte(msg), nil)), nil }