0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 9.0.1583: get E304 when using 'cryptmethod' "xchacha20v2"

Problem:    Get E304 when using 'cryptmethod' "xchacha20v2". (Steve Mynott)
Solution:   Add 4th crypt method to block zero ID check.  Avoid syncing a swap
            file before reading the file. (closes #12433)
This commit is contained in:
Bram Moolenaar
2023-05-27 18:02:55 +01:00
parent a40c0bcc83
commit 3a2a60ce4a
9 changed files with 117 additions and 48 deletions

View File

@@ -691,6 +691,12 @@ typedef struct
int cmod_did_esilent; // incremented when emsg_silent is
} cmdmod_T;
typedef enum {
MF_DIRTY_NO = 0, // no dirty blocks
MF_DIRTY_YES, // there are dirty blocks
MF_DIRTY_YES_NOSYNC, // there are dirty blocks, do not sync yet
} mfdirty_T;
#define MF_SEED_LEN 8
struct memfile
@@ -712,7 +718,7 @@ struct memfile
blocknr_T mf_neg_count; // number of negative blocks numbers
blocknr_T mf_infile_count; // number of pages in the file
unsigned mf_page_size; // number of bytes in a page
int mf_dirty; // TRUE if there are dirty blocks
mfdirty_T mf_dirty;
#ifdef FEAT_CRYPT
buf_T *mf_buffer; // buffer this memfile is for
char_u mf_seed[MF_SEED_LEN]; // seed for encryption