summaryrefslogtreecommitdiff
path: root/lisp/gnus
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2022-10-17 08:01:51 +0200
committerStefan Kangas <stefankangas@gmail.com>2022-10-17 08:03:00 +0200
commit44541c78541a96f85f3316a527374c4e4d3c75fc (patch)
treefd6088e1ddcb43c9091449f425e6205297d3a29f /lisp/gnus
parent4a6ad6e18f4de30e30f2a5c87c08078eaec821b5 (diff)
downloademacs-44541c78541a96f85f3316a527374c4e4d3c75fc.tar.gz
emacs-44541c78541a96f85f3316a527374c4e4d3c75fc.tar.bz2
emacs-44541c78541a96f85f3316a527374c4e4d3c75fc.zip
Make `message-canlock-generate' faster
* lisp/gnus/message.el (message-canlock-generate): Improve performance by several orders of magnitude.
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/message.el5
1 files changed, 1 insertions, 4 deletions
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 5e4e9854a6b..a714e318767 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -5192,10 +5192,7 @@ command evaluates `message-send-mail-hook' just before sending a message."
(defun message-canlock-generate ()
"Return a string that is non-trivial to guess.
Do not use this for anything important, it is cryptographically weak."
- (sha1 (concat (message-unique-id)
- (format "%x%x%x" (random) (random) (random))
- (prin1-to-string (recent-keys))
- (prin1-to-string (garbage-collect)))))
+ (secure-hash 'sha1 'iv-auto 128))
(defvar canlock-password)
(defvar canlock-password-for-verify)