(message-canlock-generate): Make sure sha1 doesn't
authorSimon Josefsson <jas@extundo.com>
Wed, 4 Sep 2002 00:54:44 +0000 (00:54 +0000)
committerSimon Josefsson <jas@extundo.com>
Wed, 4 Sep 2002 00:54:44 +0000 (00:54 +0000)
call external programs.

lisp/ChangeLog
lisp/message.el

index 47fe33c..480f5b9 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-04  Simon Josefsson  <jas@extundo.com>
+
+       * message.el (message-canlock-generate): Make sure sha1 doesn't
+       call external programs.
+
 2002-09-03  Simon Josefsson  <jas@extundo.com>
 
        * nntp.el (nntp-wait-for-string): Dont infloop if process died.
index 69a4ade..b6b2534 100644 (file)
@@ -3139,10 +3139,11 @@ documentation for the function `mail-source-touch-pop'."
 (defun message-canlock-generate ()
   "Return a string that is non-trival to guess.
 Do not use this for anything important, it is cryptographically weak."
-  (sha1 (concat (message-unique-id)
-               (format "%x%x%x" (random) (random t) (random))
-               (prin1-to-string (recent-keys))
-               (prin1-to-string (garbage-collect)))))
+  (let (sha1-maximum-internal-length)
+    (sha1 (concat (message-unique-id)
+                 (format "%x%x%x" (random) (random t) (random))
+                 (prin1-to-string (recent-keys))
+                 (prin1-to-string (garbage-collect))))))
 
 (defun message-canlock-password ()
   "The password used by message for cancel locks.