From c22df13d9548ac99ed7a50f462227523ee15d8ed Mon Sep 17 00:00:00 2001 From: Paul Fariello Date: Thu, 11 Jul 2019 18:51:03 +0320 Subject: Dirty fix libgcrypt memleak --- src/omemo/crypto.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/omemo') diff --git a/src/omemo/crypto.c b/src/omemo/crypto.c index 81d7c922..5a67c3b1 100644 --- a/src/omemo/crypto.c +++ b/src/omemo/crypto.c @@ -55,6 +55,11 @@ omemo_crypto_init(void) gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); + /* Ask for a first random buffer to ensure CSPRNG is initialized. + * Thus we control the memleak produced by gcrypt initialization and we can + * suppress it without having false negatives */ + gcry_free(gcry_random_bytes_secure(1, GCRY_VERY_STRONG_RANDOM)); + return 0; } -- cgit 1.4.1-2-gfad0