diff options
| author | Lars Ingebrigtsen | 2019-09-20 22:24:56 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-09-20 22:24:56 +0200 |
| commit | c3958e48f6a257fa7e681b2b39ea83d677bcb2f3 (patch) | |
| tree | 490d43e178e063349bcd014cd8b3069dc506d407 | |
| parent | 76c14b7191f5c30ceeb06a546b44b3bac03ea8e0 (diff) | |
| download | emacs-c3958e48f6a257fa7e681b2b39ea83d677bcb2f3.tar.gz emacs-c3958e48f6a257fa7e681b2b39ea83d677bcb2f3.zip | |
Add some comments to the auth-source obfuscation
* lisp/auth-source.el (auth-source--obfuscate): Add comments.
| -rw-r--r-- | lisp/auth-source.el | 8 |
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)) |