[gnus git] branch master updated: m0-5-103-g8e1b4e5 =1= Better seed support for (random)
Katsumi Yamaoka <[email protected]>
| Newsgroups | gmane.emacs.gnus.cvs |
|---|---|
| Message-ID | <[email protected]> |
via 8e1b4e53da728a59be2dc56f9ee349c5b93d6121 (commit)
from 82cfe575fea4d5604f6c6cf84af0379d5df51fb7 (commit)
- Log -----------------------------------------------------------------
commit 8e1b4e53da728a59be2dc56f9ee349c5b93d6121
Author: Paul Eggert <[email protected]>
Date: Sat Sep 1 04:11:04 2012 +0000
Better seed support for (random)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 44adea5..77baac1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2012-09-01 Paul Eggert <[email protected]>
+
+ Better seeds for (random).
+ * gnus-sync.el (gnus-sync-lesync-setup):
+ * message.el (message-canlock-generate, message-unique-id):
+ Change (random t) to (random), now that the latter is more random.
+
2012-08-31 Dave Abrahams <[email protected]>
* auth-source.el (auth-sources): Fix macos keychain access.
diff --git a/lisp/gnus-sync.el b/lisp/gnus-sync.el
index 7e13b88..510e858 100644
--- a/lisp/gnus-sync.el
+++ b/lisp/gnus-sync.el
@@ -236,7 +236,7 @@ When SALT is nil, a random one will be generated using `random'."
(security-object (concat url "/_security"))
(user-record `((names . [,user]) (roles . [])))
(couch-user-name (format "org.couchdb.user:%s" user))
- (salt (or salt (sha1 (format "%s" (random t)))))
+ (salt (or salt (sha1 (format "%s" (random)))))
(couch-user-record
`((_id . ,couch-user-name)
(type . user)
diff --git a/lisp/message.el b/lisp/message.el
index 1e4436a..1fea5f9 100644
--- a/lisp/message.el
+++ b/lisp/message.el
@@ -4864,9 +4864,7 @@ Do not use this for anything important, it is cryptographically weak."
(require 'sha1)
(let (sha1-maximum-internal-length)
(sha1 (concat (message-unique-id)
- (format "%x%x%x" (random)
- (progn (random t) (random))
- (random))
+ (format "%x%x%x" (random) (random) (random))
(prin1-to-string (recent-keys))
(prin1-to-string (garbage-collect))))))
@@ -5569,7 +5567,6 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'."
;; You might for example insert a "." somewhere (not next to another dot
;; or string boundary), or modify the "fsf" string.
(defun message-unique-id ()
- (random t)
;; Don't use microseconds from (current-time), they may be unsupported.
;; Instead we use this randomly inited counter.
(setq message-unique-id-char
diff --git a/lisp/sasl.el b/lisp/sasl.el
index c6e9597..4e759a4 100644
--- a/lisp/sasl.el
+++ b/lisp/sasl.el
@@ -183,7 +183,7 @@ It contain at least 64 bits of entropy."
;; Don't use microseconds from (current-time), they may be unsupported.
;; Instead we use this randomly inited counter.
(setq sasl-unique-id-char
- (% (1+ (or sasl-unique-id-char (logand (random t) (1- (lsh 1 20)))))
+ (% (1+ (or sasl-unique-id-char (logand (random) (1- (lsh 1 20)))))
;; (current-time) returns 16-bit ints,
;; and 2^16*25 just fits into 4 digits i base 36.
(* 25 25)))
-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.
Summary of changes:
lisp/ChangeLog | 7 +++++++
lisp/gnus-sync.el | 2 +-
lisp/message.el | 5 +----
lisp/sasl.el | 2 +-
4 files changed, 10 insertions(+), 6 deletions(-)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".
The branch, master has been updated
hooks/post-receive
--
Gnus Project