emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106825: * lisp/custom.el (custom-saf


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106825: * lisp/custom.el (custom-safe-themes): Use SHA-256 for hashing.
Date: Mon, 09 Jan 2012 15:48:51 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106825
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Mon 2012-01-09 15:48:51 +0800
message:
  * lisp/custom.el (custom-safe-themes): Use SHA-256 for hashing.
  
  * doc/emacs/custom.texi (Custom Themes): Switched custom-safe-themes
  to use SHA-256.
modified:
  doc/emacs/ChangeLog
  doc/emacs/custom.texi
  lisp/custom.el
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog       2012-01-07 08:55:43 +0000
+++ b/doc/emacs/ChangeLog       2012-01-09 07:48:51 +0000
@@ -1,3 +1,8 @@
+2012-01-09  Chong Yidong  <address@hidden>
+
+       * custom.texi (Custom Themes): Switched custom-safe-themes to use
+       SHA-256.
+
 2012-01-07  Chong Yidong  <address@hidden>
 
        * display.texi (Useless Whitespace): Add Whitespace mode.

=== modified file 'doc/emacs/custom.texi'
--- a/doc/emacs/custom.texi     2012-01-07 08:12:27 +0000
+++ b/doc/emacs/custom.texi     2012-01-09 07:48:51 +0000
@@ -598,7 +598,7 @@
 loading a Custom theme can execute arbitrary Lisp code, you should
 only say yes if you know that the theme is safe; in that case, Emacs
 offers to remember in the future that the theme is safe (this is done
-by saving the theme file's SHA1 hash to the variable
+by saving the theme file's SHA-256 hash to the variable
 @code{custom-safe-themes}; if you want to treat all themes as safe,
 change its value to @code{t}).  Themes that come with Emacs (in the
 @file{etc/themes} directory) are exempt from this check, and are

=== modified file 'lisp/custom.el'
--- a/lisp/custom.el    2012-01-05 11:12:11 +0000
+++ b/lisp/custom.el    2012-01-09 07:48:51 +0000
@@ -1105,7 +1105,7 @@
 
 (defcustom custom-safe-themes '(default)
   "Themes that are considered safe to load.
-If the value is a list, each element should be either the `sha1'
+If the value is a list, each element should be either the SHA-256
 hash of a safe theme file, or the symbol `default', which stands
 for any theme in the built-in Emacs theme directory (a directory
 named \"themes\" in `data-directory').
@@ -1161,7 +1161,7 @@
       (error "Unable to find theme file for `%s'" theme))
     (with-temp-buffer
       (insert-file-contents fn)
-      (setq hash (sha1 (current-buffer)))
+      (setq hash (secure-hash 'sha256 (current-buffer)))
       ;; Check file safety with `custom-safe-themes', prompting the
       ;; user if necessary.
       (when (or no-confirm


reply via email to

[Prev in Thread] Current Thread [Next in Thread]