mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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)
This commit is contained in:
@@ -1251,6 +1251,24 @@ typedef struct {
|
||||
} 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 @@ struct file_buffer
|
||||
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
|
||||
|
Reference in New Issue
Block a user