commit 5b146e9eaa01a28c51431471bce6ea13a031e8ae
parent ffd418aaa7b4bdf401193a96194346ff7e403b9e
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Fri, 8 Apr 2016 14:50:45 +0200
Close PRNG source after reading our PBKDF2 salt from it.
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/password.c b/src/password.c
@@ -99,6 +99,12 @@ static void _generate_salt()
return;
}
+#if defined G_OS_UNIX
+ close(rnd);
+#elif defined G_OS_WIN32
+ CryptReleaseContext(rnd, 0);
+#endif
+
prefs_common_get_prefs()->master_passphrase_salt =
g_base64_encode(salt, KD_SALT_LENGTH);
}