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)
diff --git a/src/structs.h b/src/structs.h
index 55a859b..7de0d9e 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -2771,11 +2771,24 @@
# define CRYPT_M_BF 1
# define CRYPT_M_BF2 2
# define CRYPT_M_SOD 3
-# define CRYPT_M_COUNT 4 // number of crypt methods
+# define CRYPT_M_SOD2 4
+# define CRYPT_M_COUNT 5 // number of crypt methods
// Currently all crypt methods work inplace. If one is added that isn't then
// define this.
# define CRYPT_NOT_INPLACE 1
+
+// Struct for passing arguments down to the crypt_init functions
+typedef struct {
+ char_u *cat_salt;
+ int cat_salt_len;
+ char_u *cat_seed;
+ int cat_seed_len;
+ char_u *cat_add;
+ int cat_add_len;
+ int cat_init_from_file;
+} crypt_arg_T;
+
#endif
#ifdef FEAT_PROP_POPUP