From 086ab02f77dda4951bea1f426a5a3059f14126ce Mon Sep 17 00:00:00 2001 From: Erica Z Date: Wed, 16 Oct 2024 00:07:19 +0200 Subject: [PATCH] dont actually use random_bytes, it leaks memory ha ha vala what the fuck --- src/ui/setup.vala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/setup.vala b/src/ui/setup.vala index 2a7b206..1db29c2 100644 --- a/src/ui/setup.vala +++ b/src/ui/setup.vala @@ -101,7 +101,8 @@ public class Ui.Setup : Adw.PreferencesDialog { private void salt_password (string password, out string token, out string salt) { const int SALT_BYTES = 8; - uchar salt_bytes[SALT_BYTES] = GCrypt.Random.random_bytes (SALT_BYTES); + uchar salt_bytes[SALT_BYTES]; + GCrypt.Random.randomize (salt_bytes); uchar salt_chars[2*SALT_BYTES+1]; for (int i = 0; i < SALT_BYTES; i += 1) { salt_chars[2*i+0] = "0123456789abcdef"[(salt_bytes[i]>>4)&0xf];