summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2023-04-23 17:50:22 +0100
committerBram Moolenaar <Bram@vim.org>2023-04-23 17:50:22 +0100
commitaae583441bcdbb0bfef3b8a1d193e04ae09ca95d (patch)
treee3cf7c27fc02e1232fe5ab8f8da32581e9782718 /src/buffer.c
parentdcd40cfca0fe0e65d405ce9711745a8ec846c30c (diff)
patch 9.0.1481: decrypting with libsodium may fail if the library changesv9.0.1481
Problem: Decrypting with libsodium may fail if the library changes. Solution: Add parameters used to the encrypted file header. (Christian Brabandt, closes #12279)
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 6d4c4359f0..98cca6ca7c 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -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);