From b8a991a49e1f16900362ef048e0c3883d8d1e316 Mon Sep 17 00:00:00 2001 From: Jacob Appelbaum Date: Sat, 17 Aug 2024 16:08:11 +0200 Subject: [PATCH] Possible option to fix memory corruption issue; off by default --- c_monocypher.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/c_monocypher.pyx b/c_monocypher.pyx index ce579c9..695f735 100644 --- a/c_monocypher.pyx +++ b/c_monocypher.pyx @@ -319,7 +319,7 @@ cdef uint32_t _validate_u32(variable_name, value): return value -def argon2i_32(nb_blocks, nb_iterations, password, salt, key=None, ad=None) -> bytes: +def argon2i_32(nb_blocks, nb_iterations, password, salt, key=None, ad=None, _wipe=True) -> bytes: key = b'' if key is None else key ad = b'' if ad is None else ad @@ -347,7 +347,8 @@ def argon2i_32(nb_blocks, nb_iterations, password, salt, key=None, ad=None) -> b crypto_argon2(hash, len(hash), work_area, config, inputs, extras) finally: free(work_area) - crypto_wipe(password, len(password)) + if _wipe: + crypto_wipe(password, len(password)) return hash