diff options
author | Christian Brabandt <cb@256bit.org> | 2023-04-23 17:50:22 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-04-23 17:50:22 +0100 |
commit | aae583441bcdbb0bfef3b8a1d193e04ae09ca95d (patch) | |
tree | e3cf7c27fc02e1232fe5ab8f8da32581e9782718 /src/proto | |
parent | dcd40cfca0fe0e65d405ce9711745a8ec846c30c (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/proto')
-rw-r--r-- | src/proto/blowfish.pro | 2 | ||||
-rw-r--r-- | src/proto/crypt.pro | 3 | ||||
-rw-r--r-- | src/proto/crypt_zip.pro | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/proto/blowfish.pro b/src/proto/blowfish.pro index 6b2c45459a..fbaa3dc594 100644 --- a/src/proto/blowfish.pro +++ b/src/proto/blowfish.pro @@ -1,6 +1,6 @@ /* blowfish.c */ void crypt_blowfish_encode(cryptstate_T *state, char_u *from, size_t len, char_u *to, int last); void crypt_blowfish_decode(cryptstate_T *state, char_u *from, size_t len, char_u *to, int last); -int crypt_blowfish_init(cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len); +int crypt_blowfish_init(cryptstate_T *state, char_u *key, crypt_arg_T *arg); int blowfish_self_test(void); /* vim: set ft=c : */ diff --git a/src/proto/crypt.pro b/src/proto/crypt.pro index 560e30b8dc..c067829520 100644 --- a/src/proto/crypt.pro +++ b/src/proto/crypt.pro @@ -4,12 +4,13 @@ int crypt_method_nr_from_name(char_u *name); int crypt_method_nr_from_magic(char *ptr, int len); int crypt_works_inplace(cryptstate_T *state); int crypt_get_method_nr(buf_T *buf); +int crypt_method_is_sodium(int method); int crypt_whole_undofile(int method_nr); int crypt_get_header_len(int method_nr); int crypt_get_max_header_len(void); void crypt_set_cm_option(buf_T *buf, int method_nr); int crypt_self_test(void); -cryptstate_T *crypt_create(int method_nr, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len); +cryptstate_T *crypt_create(int method_nr, char_u *key, crypt_arg_T *crypt_arg); cryptstate_T *crypt_create_from_header(int method_nr, char_u *key, char_u *header); cryptstate_T *crypt_create_from_file(FILE *fp, char_u *key); cryptstate_T *crypt_create_for_writing(int method_nr, char_u *key, char_u **header, int *header_len); diff --git a/src/proto/crypt_zip.pro b/src/proto/crypt_zip.pro index 626d9855bf..eb29dbf760 100644 --- a/src/proto/crypt_zip.pro +++ b/src/proto/crypt_zip.pro @@ -1,5 +1,5 @@ /* crypt_zip.c */ -int crypt_zip_init(cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len); +int crypt_zip_init(cryptstate_T *state, char_u *key, crypt_arg_T *arg); void crypt_zip_encode(cryptstate_T *state, char_u *from, size_t len, char_u *to, int last); void crypt_zip_decode(cryptstate_T *state, char_u *from, size_t len, char_u *to, int last); /* vim: set ft=c : */ |