summaryrefslogtreecommitdiffstats
path: root/src/crypt.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-11-12 15:15:42 +0100
committerBram Moolenaar <Bram@vim.org>2014-11-12 15:15:42 +0100
commit3a0c90898338c04bde314bede9f116f299eaddef (patch)
tree52c90925ed68b802fd1e0a4e943876a53532acf0 /src/crypt.c
parent983c4e93dc560b00c5c7b752a3a7c1c452359c38 (diff)
updated for version 7.4.509v7.4.509
Problem: Users are not aware their encryption is weak. Solution: Give a warning when prompting for the key.
Diffstat (limited to 'src/crypt.c')
-rw-r--r--src/crypt.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/crypt.c b/src/crypt.c
index c54e15c4af..f25a2c4a9d 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -504,6 +504,26 @@ crypt_free_key(key)
}
/*
+ * Check the crypt method and give a warning if it's outdated.
+ */
+ void
+crypt_check_method(method)
+ int method;
+{
+ if (method < CRYPT_M_BF2)
+ {
+ msg_scroll = TRUE;
+ MSG(_("Warning: Using a weak encryption method; see :help 'cm'"));
+ }
+}
+
+ void
+crypt_check_current_method()
+{
+ crypt_check_method(crypt_get_method_nr(curbuf));
+}
+
+/*
* Ask the user for a crypt key.
* When "store" is TRUE, the new key is stored in the 'key' option, and the
* 'key' option value is returned: Don't free it.