1
0
forked from aniani/vim

updated for version 7.3.133

Problem:    When using encryption it's not clear what method was used.
Solution:   In the file message show "blowfish" when using blowfish.
This commit is contained in:
Bram Moolenaar
2011-02-25 16:52:17 +01:00
parent 0c1f3f4d49
commit 4cf35c2fa4
2 changed files with 16 additions and 2 deletions

View File

@@ -250,6 +250,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
char_u *cryptkey = NULL; char_u *cryptkey = NULL;
int did_ask_for_key = FALSE; int did_ask_for_key = FALSE;
int crypt_method_used;
#endif #endif
#ifdef FEAT_PERSISTENT_UNDO #ifdef FEAT_PERSISTENT_UNDO
context_sha256_T sha_ctx; context_sha256_T sha_ctx;
@@ -2289,6 +2290,7 @@ failed:
save_file_ff(curbuf); /* remember the current file format */ save_file_ff(curbuf); /* remember the current file format */
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
crypt_method_used = use_crypt_method;
if (cryptkey != NULL) if (cryptkey != NULL)
{ {
crypt_pop_state(); crypt_pop_state();
@@ -2483,7 +2485,10 @@ failed:
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
if (cryptkey != NULL) if (cryptkey != NULL)
{ {
STRCAT(IObuff, _("[crypted]")); if (crypt_method_used == 1)
STRCAT(IObuff, _("[blowfish]"));
else
STRCAT(IObuff, _("[crypted]"));
c = TRUE; c = TRUE;
} }
#endif #endif
@@ -3199,6 +3204,9 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
int write_undo_file = FALSE; int write_undo_file = FALSE;
context_sha256_T sha_ctx; context_sha256_T sha_ctx;
#endif #endif
#ifdef FEAT_CRYPT
int crypt_method_used;
#endif
if (fname == NULL || *fname == NUL) /* safety check */ if (fname == NULL || *fname == NUL) /* safety check */
return FAIL; return FAIL;
@@ -4728,6 +4736,7 @@ restore_backup:
mch_set_acl(wfname, acl); mch_set_acl(wfname, acl);
#endif #endif
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
crypt_method_used = use_crypt_method;
if (wb_flags & FIO_ENCRYPTED) if (wb_flags & FIO_ENCRYPTED)
crypt_pop_state(); crypt_pop_state();
#endif #endif
@@ -4882,7 +4891,10 @@ restore_backup:
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
if (wb_flags & FIO_ENCRYPTED) if (wb_flags & FIO_ENCRYPTED)
{ {
STRCAT(IObuff, _("[crypted]")); if (crypt_method_used == 1)
STRCAT(IObuff, _("[blowfish]"));
else
STRCAT(IObuff, _("[crypted]"));
c = TRUE; c = TRUE;
} }
#endif #endif

View File

@@ -714,6 +714,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
133,
/**/ /**/
132, 132,
/**/ /**/