From 45efe70ce2fff4211013b688911b76a6400fb0f5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 17 Oct 2022 00:05:31 -0700 Subject: [PATCH 07/10] =?UTF-8?q?Simplify=20auth-source--obfuscate=20via?= =?UTF-8?q?=20=E2=80=98make-nonce=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/auth-source.el (auth-source--obfuscate): Simplify by using make-nonce. This also improves the nonce by using all the bits in each byte. --- lisp/auth-source.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lisp/auth-source.el b/lisp/auth-source.el index feefd391a8..cba7324ea9 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -1216,9 +1216,7 @@ auth-source--obfuscate ;; useful information is leaked. If you reset the nonce, you also ;; have to call `auth-source-forget-all-cached'. (unless auth-source--session-nonce - (setq auth-source--session-nonce - (apply #'string (cl-loop repeat 16 - collect (random 128))))) + (setq auth-source--session-nonce (make-nonce 16))) (if (and (fboundp 'gnutls-symmetric-encrypt) (gnutls-available-p)) (let ((cdata (car (last (gnutls-ciphers))))) -- 2.34.1