Skip to content

Commit 4a8c2cf

Browse files
committed
patch 7.4.979
Problem: When changing the crypt key the blocks read from disk are not decrypted. Solution: Also call ml_decrypt_data() when mf_old_key is set. (Ken Takata)
1 parent c42b9c6 commit 4a8c2cf

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/memfile.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,8 +1032,9 @@ mf_read(mfp, hp)
10321032
}
10331033

10341034
#ifdef FEAT_CRYPT
1035-
/* Decrypt if 'key' is set and this is a data block. */
1036-
if (*mfp->mf_buffer->b_p_key != NUL)
1035+
/* Decrypt if 'key' is set and this is a data block. And when changing the
1036+
* key. */
1037+
if (*mfp->mf_buffer->b_p_key != NUL || mfp->mf_old_key != NULL)
10371038
ml_decrypt_data(mfp, hp->bh_data, offset, size);
10381039
#endif
10391040

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
979,
744746
/**/
745747
978,
746748
/**/

0 commit comments

Comments
 (0)