0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.1481: decrypting with libsodium may fail if the library changes

Problem:    Decrypting with libsodium may fail if the library changes.
Solution:   Add parameters used to the encrypted file header. (Christian
            Brabandt, closes #12279)
This commit is contained in:
Christian Brabandt
2023-04-23 17:50:22 +01:00
committed by Bram Moolenaar
parent dcd40cfca0
commit aae583441b
16 changed files with 422 additions and 121 deletions

View File

@@ -2362,8 +2362,8 @@ free_buf_options(
#endif
#ifdef FEAT_CRYPT
# ifdef FEAT_SODIUM
if ((buf->b_p_key != NULL) && (*buf->b_p_key != NUL) &&
(crypt_get_method_nr(buf) == CRYPT_M_SOD))
if (buf->b_p_key != NULL && *buf->b_p_key != NUL
&& crypt_method_is_sodium(crypt_get_method_nr(buf)))
crypt_sodium_munlock(buf->b_p_key, STRLEN(buf->b_p_key));
# endif
clear_string_option(&buf->b_p_key);