From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jens Schmidt Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Keep network security info buffers after use Date: Fri, 22 Dec 2023 22:58:38 +0100 Message-ID: References: <87plz4irev.fsf@red-bean.com> <83frzufo9x.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16033"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: kfogel@red-bean.com, emacs-devel@gnu.org To: Eli Zaretskii , Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 22 22:59:51 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rGnYc-0003zh-Lw for ged-emacs-devel@m.gmane-mx.org; Fri, 22 Dec 2023 22:59:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGnXu-0005dV-J9; Fri, 22 Dec 2023 16:59:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGnXr-0005d2-4X for emacs-devel@gnu.org; Fri, 22 Dec 2023 16:59:03 -0500 Original-Received: from mr4.vodafonemail.de ([145.253.228.164]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGnXn-00032F-W3; Fri, 22 Dec 2023 16:59:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-mb-mr2-23sep; t=1703282336; bh=xVdU6CCMqMlfjqNJpcq1o+/JOyOTitiPHjRzJ3/S47s=; h=Message-ID:Date:User-Agent:Subject:Content-Language:To:References: From:In-Reply-To:Content-Type:From; b=YGndeBTznNjWcdRfbXSW1L1XJ7ROJOBbD84bBHoZeURUi5ieyiV3WAthnVNHDuh5Y jyB8XDP4Gosw/s7nLIjo7RU8waBQArOe7ZIIUwH0U3WIoK9KbNuxRL3ZWpJBgtrBt7 pKqYXJwEgFjwqu9mnpGpi68L1rexTcNrYpfgh9WQ= Original-Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr4.vodafonemail.de (Postfix) with ESMTPS id 4Sxh5X0WcTz1y39; Fri, 22 Dec 2023 21:58:56 +0000 (UTC) Original-Received: from [192.168.178.41] (port-92-196-103-231.dynamic.as20676.net [92.196.103.231]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4Sxh5G2j0DzHnHf; Fri, 22 Dec 2023 21:58:39 +0000 (UTC) Content-Language: de-DE-frami, en-US In-Reply-To: <83frzufo9x.fsf@gnu.org> X-purgate-type: clean X-purgate: clean X-purgate-size: 2970 X-purgate-ID: 155817::1703282331-377FF693-180F8272/0/0 Received-SPF: pass client-ip=145.253.228.164; envelope-from=jschmidt4gnu@vodafonemail.de; helo=mr4.vodafonemail.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:314086 Archived-At: On 2023-12-22 12:51, Eli Zaretskii wrote: >> From: Stefan Kangas >> Date: Fri, 22 Dec 2023 02:00:38 -0800 >> >> Karl Fogel writes: >> >>> What do people think of the attached behavior change? >> >> It would be useful, yes. I'm not bit by this often, but it happened to >> me this week, and it's pretty frustrating. The only workaround I know >> of is to manually type in the information into some other program. > > I agree that it could be useful in some cases. Andreas suggested a > special command to show this information -- do you think this would be > a good solution for this situation? I share Karl's opinion here that this could be too complex for the problem at hand. How about the following variation of Karl's patch, which hopefully meets his request for simplicity and hopefully also these requests of yours (as long as you do not count the additional multiple choice option as something that must be revertable by option): > It must be optional, probably off by default, and if it's on by > default, there must be a way to get back old behavior. diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el index 09f7ac52537..27107edc1c5 100644 --- a/lisp/net/nsm.el +++ b/lisp/net/nsm.el @@ -825,6 +825,7 @@ nsm-query-user (?f "forward page" "See next page") (?n "next" "Next certificate") (?p "previous" "Previous certificate") + (?k "keep" "Keep certificate details for further inspection") (?q "quit" "Quit details view"))) (done nil)) (save-window-excursion @@ -916,7 +917,28 @@ nsm-query-user (setq cert-index (mod (1- cert-index) (length pems))) (insert (nth cert-index pems)) (goto-char (point-min)) - (read-only-mode))))) + (read-only-mode))) + + (?k + ;; Keep certificate details. + (let ((bufname + (format "*Certificate Details for %s*" + (nsm-certificate-part + (plist-get (car certs) :subject) "CN" t))) + begin) + (with-current-buffer (get-buffer-create bufname) + (read-only-mode -1) + (goto-char (point-max)) + (setq begin (point)) + (dolist (cert certs) + (insert (gnutls-format-certificate + (plist-get cert :pem))) + (ensure-empty-lines 1)) + (goto-char begin) + (read-only-mode)) + (message "Details appended to buffer %s" bufname) + (sit-for 2))))) + ;; Return the answer. (cadr answer)) (kill-buffer cert-buffer)