updated for version 7.4.399
Problem: Encryption implementation is messy. Blowfish encryption has a
weakness.
Solution: Refactor the encryption, store the state in an allocated struct
instead of using a save/restore mechanism. Introduce the
"blowfish2" method, which does not have the weakness and encrypts
the whole undo file. (largely by David Leadbeater)
diff --git a/src/structs.h b/src/structs.h
index 1382380..441fcaa 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1251,6 +1251,24 @@
} syn_time_T;
#endif
+#ifdef FEAT_CRYPT
+/*
+ * Structure to hold the type of encryption and the state of encryption or
+ * decryption.
+ */
+typedef struct {
+ int method_nr;
+ void *method_state; /* method-specific state information */
+} cryptstate_T;
+
+/* values for method_nr */
+# define CRYPT_M_ZIP 0
+# define CRYPT_M_BF 1
+# define CRYPT_M_BF2 2
+# define CRYPT_M_COUNT 3 /* number of crypt methods */
+#endif
+
+
/*
* These are items normally related to a buffer. But when using ":ownsyntax"
* a window may have its own instance.
@@ -1778,7 +1796,12 @@
int b_was_netbeans_file;/* TRUE if b_netbeans_file was once set */
#endif
-};
+#ifdef FEAT_CRYPT
+ cryptstate_T *b_cryptstate; /* Encryption state while reading or writing
+ * the file. NULL when not using encryption. */
+#endif
+
+}; /* file_buffer */
#ifdef FEAT_DIFF