Add choice to reshow certificate information (Bug#31877)

In various situations, the window displaying the certificate
information can be hidden (such as if the user accidentally presses ?,
which causes the read-multiple-choice help window to replace it).
Instead of leaving the user to make a choice blindly, add a choice to
reshow the certification information.

* lisp/net/nsm.el (nsm-query-user): Add reshow choice.
This commit is contained in:
Allen Li 2018-08-01 03:04:26 -07:00 committed by Noam Postavsky
parent 6f2c471689
commit 3bbf21b913

View file

@ -319,6 +319,8 @@ unencrypted."
t)))) t))))
(defun nsm-query-user (message args cert) (defun nsm-query-user (message args cert)
(catch 'return
(while t
(let ((buffer (get-buffer-create "*Network Security Manager*"))) (let ((buffer (get-buffer-create "*Network Security Manager*")))
(save-window-excursion (save-window-excursion
;; First format the certificate and warnings. ;; First format the certificate and warnings.
@ -334,14 +336,17 @@ unencrypted."
;; contains lots of explanatory text. ;; contains lots of explanatory text.
(fill-region (point) (line-end-position))))) (fill-region (point) (line-end-position)))))
;; Then ask the user what to do about it. ;; Then ask the user what to do about it.
(unwind-protect (pcase (unwind-protect
(cadr (cadr
(read-multiple-choice (read-multiple-choice
"Continue connecting?" "Continue connecting?"
'((?a "always" "Accept this certificate this session and for all future sessions.") '((?a "always" "Accept this certificate this session and for all future sessions.")
(?s "session only" "Accept this certificate this session only.") (?s "session only" "Accept this certificate this session only.")
(?n "no" "Refuse to use this certificate, and close the connection.")))) (?n "no" "Refuse to use this certificate, and close the connection.")
(kill-buffer buffer))))) (?r "reshow" "Reshow certificate information."))))
(kill-buffer buffer))
("reshow")
(val (throw 'return val))))))))
(defun nsm-save-host (host port status what permanency) (defun nsm-save-host (host port status what permanency)
(let* ((id (nsm-id host port)) (let* ((id (nsm-id host port))