aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/auth-source.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/auth-source.el b/lisp/auth-source.el
index e608afca2db..365ed2fa284 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -1164,9 +1164,15 @@ FILE is the file from which we obtained this token."
1164(defvar auth-source--session-nonce nil) 1164(defvar auth-source--session-nonce nil)
1165 1165
1166(defun auth-source--obfuscate (string) 1166(defun auth-source--obfuscate (string)
1167 ;; We want to keep passwords out of backtraces and bug reports and
1168 ;; the like, so if we have GnuTLS available, we encrypt them with a
1169 ;; nonce that we just keep in memory. If somebody has access to the
1170 ;; current Emacs session, they can be decrypted, but if not, little
1171 ;; useful information is leaked. If you reset the nonce, you also
1172 ;; have to call `auth-source-forget-all-cached'.
1167 (unless auth-source--session-nonce 1173 (unless auth-source--session-nonce
1168 (setq auth-source--session-nonce 1174 (setq auth-source--session-nonce
1169 (apply #'string (cl-loop repeat 10 1175 (apply #'string (cl-loop repeat 32
1170 collect (random 128))))) 1176 collect (random 128)))))
1171 (if (and (fboundp 'gnutls-symmetric-encrypt) 1177 (if (and (fboundp 'gnutls-symmetric-encrypt)
1172 (gnutls-available-p)) 1178 (gnutls-available-p))