jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/7.4.509

073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.509
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.509
073263
Problem:    Users are not aware their encryption is weak.
073263
Solution:   Give a warning when prompting for the key.
073263
Files:	    src/crypt.c, src/ex_docmd.c, src/fileio.c, src/main.c,
073263
	    src/proto/crypt.pro
073263
073263
073263
*** ../vim-7.4.508/src/crypt.c	2014-08-13 22:05:49.032892299 +0200
073263
--- src/crypt.c	2014-11-12 15:10:22.359161977 +0100
073263
***************
073263
*** 504,509 ****
073263
--- 504,529 ----
073263
  }
073263
  
073263
  /*
073263
+  * Check the crypt method and give a warning if it's outdated.
073263
+  */
073263
+     void
073263
+ crypt_check_method(method)
073263
+     int method;
073263
+ {
073263
+     if (method < CRYPT_M_BF2)
073263
+     {
073263
+ 	msg_scroll = TRUE;
073263
+ 	MSG(_("Warning: Using a weak encryption method; see :help 'cm'"));
073263
+     }
073263
+ }
073263
+ 
073263
+     void
073263
+ crypt_check_current_method()
073263
+ {
073263
+     crypt_check_method(crypt_get_method_nr(curbuf));
073263
+ }
073263
+ 
073263
+ /*
073263
   * Ask the user for a crypt key.
073263
   * When "store" is TRUE, the new key is stored in the 'key' option, and the
073263
   * 'key' option value is returned: Don't free it.
073263
*** ../vim-7.4.508/src/ex_docmd.c	2014-11-05 09:53:19.989153321 +0100
073263
--- src/ex_docmd.c	2014-11-12 14:53:09.621921631 +0100
073263
***************
073263
*** 11524,11529 ****
073263
--- 11524,11530 ----
073263
  ex_X(eap)
073263
      exarg_T	*eap UNUSED;
073263
  {
073263
+     crypt_check_current_method();
073263
      (void)crypt_get_key(TRUE, TRUE);
073263
  }
073263
  #endif
073263
*** ../vim-7.4.508/src/fileio.c	2014-10-31 19:51:33.010698056 +0100
073263
--- src/fileio.c	2014-11-12 15:10:44.986925300 +0100
073263
***************
073263
*** 2958,2963 ****
073263
--- 2958,2964 ----
073263
  		 * Happens when retrying to detect encoding. */
073263
  		smsg((char_u *)_(need_key_msg), fname);
073263
  		msg_scroll = TRUE;
073263
+ 		crypt_check_method(method);
073263
  		cryptkey = crypt_get_key(newfile, FALSE);
073263
  		*did_ask = TRUE;
073263
  
073263
*** ../vim-7.4.508/src/main.c	2014-09-19 13:46:49.550399801 +0200
073263
--- src/main.c	2014-11-12 14:52:47.866169622 +0100
073263
***************
073263
*** 854,859 ****
073263
--- 854,860 ----
073263
  #ifdef FEAT_CRYPT
073263
      if (params.ask_for_key)
073263
      {
073263
+ 	crypt_check_current_method();
073263
  	(void)crypt_get_key(TRUE, TRUE);
073263
  	TIME_MSG("getting crypt key");
073263
      }
073263
*** ../vim-7.4.508/src/proto/crypt.pro	2014-08-10 13:34:59.060785459 +0200
073263
--- src/proto/crypt.pro	2014-11-12 15:06:51.349363319 +0100
073263
***************
073263
*** 19,24 ****
073263
--- 19,26 ----
073263
  void crypt_encode_inplace __ARGS((cryptstate_T *state, char_u *buf, size_t len));
073263
  void crypt_decode_inplace __ARGS((cryptstate_T *state, char_u *buf, size_t len));
073263
  void crypt_free_key __ARGS((char_u *key));
073263
+ void crypt_check_method __ARGS((int method));
073263
+ void crypt_check_current_method __ARGS((void));
073263
  char_u *crypt_get_key __ARGS((int store, int twice));
073263
  void crypt_append_msg __ARGS((buf_T *buf));
073263
  /* vim: set ft=c : */
073263
*** ../vim-7.4.508/src/version.c	2014-11-12 13:07:48.774069557 +0100
073263
--- src/version.c	2014-11-12 14:45:09.979391243 +0100
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     509,
073263
  /**/
073263
073263
-- 
073263
Q: How do you tell the difference between a female cat and a male cat?
073263
A: You ask it a question and if HE answers, it's a male but, if SHE
073263
   answers, it's a female.
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///