GNU bug report logs - #39886
[PATCH] Add EPA keyserver client

Previous Next

Package: emacs;

Reported by: Philip K <philip <at> warpmail.net>

Date: Tue, 3 Mar 2020 16:25:01 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39886 in the body.
You can then email your comments to 39886 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Tue, 03 Mar 2020 16:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Philip K <philip <at> warpmail.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 03 Mar 2020 16:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Philip K <philip <at> warpmail.net>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add EPA keyserver client
Date: Tue,  3 Mar 2020 17:23:59 +0100
This is a pure-elisp implementation of a keyserver client, as
specified by https://tools.ietf.org/html/draft-shaw-openpgp-hkp-00.

The current feature-set includes:
- searching for keys (inexact search by default)
- generate a interactive list of keys using tabulated-list-mode
- import selected keys using epa

The keyserver to use is set by epa-keyserver, and the customize
interface already contains a few sensible defaults to choose from.
---
 lisp/epa-ks.el | 325 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 325 insertions(+)
 create mode 100644 lisp/epa-ks.el

diff --git a/lisp/epa-ks.el b/lisp/epa-ks.el
new file mode 100644
index 0000000000..a798eec72f
--- /dev/null
+++ b/lisp/epa-ks.el
@@ -0,0 +1,325 @@
+;;; epa-ks.el --- the EasyPG Assistant -*- lexical-binding: t -*-
+
+;; Copyright (C) 2020 Free Software Foundation, Inc.
+
+;; Author: Philip K. <philip <at> warpmail.net>
+;; Keywords: PGP, GnuPG
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Keyserver client in Emacs.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'epa)
+(require 'subr-x)
+(require 'tabulated-list)
+(require 'url)
+(require 'url-http)
+
+(defgroup epa-ks nil
+  "The EasyPG Assistant Keyserver client."
+  :version "27.1"
+  :group 'epa)
+
+(defcustom epa-keyserver "keys.gnupg.net"
+  "Domain of keyserver.
+
+This is used by `epa-ks-lookup-key', for looking up public keys."
+  :type '(choice :tag "Keyserver"
+                 (const random)
+                 (const "keyring.debian.org")
+                 (const "keys.gnupg.net")
+                 (const "keyserver.ubuntu.com")
+                 (const "pgp.mit.edu")
+                 (const "pool.sks-keyservers.net")
+                 (const "zimmermann.mayfirst.org")
+                 (string :tag "Custom keyserver")))
+
+(cl-defstruct epa-ks-key
+  "Structure to hold key data."
+  id algo len created expires names flags)
+
+(cl-defstruct epa-ks-name
+  "Structure to hold user associated with keys data."
+  uid created expires flags)
+
+(defvar epa-ks-last-query nil
+  "List of arguments to pass to `epa-ks-search-keys', when
+  reverting a buffer to restart search.")
+
+(defvar epa-ks-search-mode-map
+  (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
+    (define-key map (kbd "f") #'epa-ks--mark-key-to-fetch)
+    (define-key map (kbd "i") #'epa-ks--inspect-key-to-fetch)
+    (define-key map (kbd "u") #'epa-ks--unmark-key-to-fetch)
+    (define-key map (kbd "x") #'epa-ks-do-key-to-fetch)
+    map))
+
+(define-derived-mode epa-ks-search-mode tabulated-list-mode "Keyserver"
+  "Major mode for listing public key search results."
+  (buffer-disable-undo)
+  (setq tabulated-list-format [("ID" 8 t)
+                               ("Algo." 5 nil)
+                               ("Created" 10 t)
+                               ("Expires" 10 t)
+                               ("User" 0 t)]
+        tabulated-list-sort-key '("User" . nil)
+        tabulated-list-padding 2)
+  (add-hook 'tabulated-list-revert-hook
+            #'epa-ks--restart-search
+            nil t)
+  (tabulated-list-init-header))
+
+(defun epa-ks--inspect-key-to-fetch ()
+  "Display full ID of key under point in the minibuffer."
+  (interactive)
+  (message "Full ID: %s" (epa-ks-key-id (car (tabulated-list-get-id)))))
+
+(defun epa-ks--unmark-key-to-fetch ()
+  "Remove fetch mark for key under point.
+
+If a region is active, unmark all keys in active region."
+  (interactive)
+  (epa-ks--mark-key-to-fetch ""))
+
+(defun epa-ks--mark-key-to-fetch (tag)
+  "Add fetch-mark to key under point.
+
+If a region is active, mark all keys in active region.
+
+When all keys have been selected, use \\[epa-ks-do-key-to-fetch] to
+actually import the keys.
+
+When called interactively, `epa-ks--mark-key-to-fetch' will always
+add a \"F\" tag. Non-interactivly the tag must be specified by
+setting the TAG parameter."
+  (interactive (list "F"))
+  (if (region-active-p)
+      (save-mark-and-excursion
+        (save-restriction
+          (narrow-to-region (region-beginning) (1- (region-end)))
+          (goto-char (point-min))
+          (while (not (eobp))
+            (tabulated-list-put-tag tag t))))
+    (tabulated-list-put-tag tag t)))
+
+(defun epa-ks-do-key-to-fetch ()
+  "Fetch all marked keys from keyserver and import them.
+
+Keys are marked using `epa-ks--mark-key-to-fetch'."
+  (interactive)
+  (save-excursion
+    (let (keys)
+      (goto-char (point-min))
+      (while (not (eobp))
+        (when (looking-at-p (rx bol "F"))
+          (push (epa-ks-key-id (car (tabulated-list-get-id)))
+                keys))
+        (forward-line))
+      (when (yes-or-no-p (format "Proceed fetching all %d key(s)? "
+                                 (length keys))))
+      (dolist (id keys)
+        (epa-ks--fetch-key id))))
+  (tabulated-list-clear-all-tags))
+
+(defun epa-ks--fetch-key (id)
+  "Send request to import key with id ID."
+  (url-retrieve
+   (format "https://%s/pks/lookup?%s"
+           epa-keyserver
+           (url-build-query-string
+            `(("search" ,(concat "0x" (url-hexify-string id)))
+              ("options" "mr")
+              ("op" "get"))))
+   (lambda (status)
+     (when (plist-get status :error)
+       (error "Request failed: %s"
+           (caddr (assq (caddr (plist-get status :error))
+                        url-http-codes))))
+     (forward-paragraph)
+     (save-excursion
+       (goto-char (point-max))
+       (while (memq (char-before) '(?  ?
 ?\n))
+         (forward-char -1))
+       (delete-region (point) (point-max)))
+     (let ((epa-popup-info-window nil))
+       (epa-import-armor-in-region (point) (point-max)))
+     (kill-buffer))))
+
+(defun epa-ks--display-keys (buf keys)
+  "Prepare KEYS for `tabulated-list-mode', for buffer BUF.
+
+KEYS is a list of `epa-ks-key' structures, as parsed by
+`epa-ks-parse-result'."
+  (when (buffer-live-p buf)
+    (let (entries)
+      (dolist (key keys)
+        (dolist (name (epa-ks-key-names key))
+          (push (list (cons key name)
+                      (vector
+                       (substring (epa-ks-key-id key) -8)
+                       (cdr (epa-ks-key-algo key))
+                       (if (epa-ks-key-created key)
+                           (format-time-string "%F" (epa-ks-key-created key))
+                         "N/A")
+                       (if (epa-ks-key-expires key)
+                           (let* ((date (epa-ks-key-expires key))
+                                  (str (format-time-string "%F" date)))
+                             (when (< 0 (time-to-seconds (time-since date)))
+                               (setq str (propertize str 'face 'font-lock-warning-face)))
+                             str)
+                         (propertize "N/A" 'face 'shadow))
+                       (decode-coding-string
+                        (epa-ks-name-uid name)
+                        (select-safe-coding-system (epa-ks-name-uid name) nil 'utf-8))))
+                entries)))
+      (with-current-buffer buf
+        (setq tabulated-list-entries entries)
+        (tabulated-list-print t t))
+      (message "Press `f' to mark a key, `x' to fetch all marked keys."))))
+
+(defun epa-ks--restart-search ()
+  (when epa-ks-last-query
+    (apply #'epa-ks-search-keys epa-ks-last-query)))
+
+;;;###autoload
+(defun epa-ks-search-keys (query exact)
+  "Ask a keyserver for all keys matching QUERY.
+
+The keyserver to be used is specified by `epa-keyserver'.
+
+If EXACT is non-nil require exact matches.  Interactively, this
+can be provoked using a prefix argument.
+
+Note that the request may fail, is the query is not specific
+enough, since keyservers have strict timeout settings."
+  (interactive (list (read-string "Search for: ")
+                     current-prefix-arg))
+  (when (string-empty-p query)
+    (user-error "No query"))
+  (let ((buf (get-buffer-create "*Key search*")))
+    (with-current-buffer buf
+      (let ((inhibit-read-only t))
+        (erase-buffer))
+      (epa-ks-search-mode))
+    (url-retrieve
+     (format "https://%s/pks/lookup?%s"
+             epa-keyserver
+             (url-build-query-string
+              (append `(("search" ,query)
+                        ("options" "mr")
+                        ("op" "index"))
+                      (and exact '(("exact" "on"))))))
+     (lambda (status)
+       (when (plist-get status :error)
+         (when buf
+           (kill-buffer buf))
+         (error "Request failed: %s"
+                (caddr (assq (caddr (plist-get status :error))
+                             url-http-codes))))
+       (forward-paragraph)
+       (forward-line)
+       (save-match-data
+         ;; parse machine readable response according to
+         ;; https://tools.ietf.org/html/draft-shaw-openpgp-hkp-00#section-5.2
+         (when (looking-at (rx bol "info:" (group (+ digit))
+                               ":" (* digit) eol))
+           (unless (string= (match-string 1) "1")
+             (error "Unsupported keyserver version")))
+         (let (key keys)
+           (forward-line)
+           (while (not (or (looking-at-p (rx ?
 eol))
+                           (eobp)))
+             (cond ((looking-at (rx bol "pub:" (group (+ alnum))
+                                    ":" (group (* digit))
+                                    ":" (group (* digit))
+                                    ":" (group (* digit))
+                                    ":" (group (* digit))
+                                    ":" (group (* (any ?r ?d ?e)))
+                                    eol))
+                    (setq key
+                          (make-epa-ks-key
+                           :id (match-string 1)
+                           :algo
+                           (and (match-string 2)
+                                (not (string-empty-p (match-string 2)))
+                                (assoc (string-to-number (match-string 2))
+                                       epg-pubkey-algorithm-alist))
+                           :len
+                           (and (match-string 3)
+                                (not (string-empty-p (match-string 3)))
+                                (string-to-number (match-string 3)))
+                           :created
+                           (and  (match-string 4)
+                                 (not (string-empty-p (match-string 4)))
+                                 (seconds-to-time
+                                  (string-to-number (match-string 4))))
+                           :expires
+                           (and (match-string 5)
+                                (not (string-empty-p (match-string 5)))
+                                (seconds-to-time
+                                 (string-to-number (match-string 5))))
+                           :flags
+                           (mapcar (lambda (flag)
+                                     (cdr (assq flag '((?r revoked)
+                                                       (?d disabled)
+                                                       (?e expired)))))
+                                   (match-string 6))))
+                    (push key keys))
+                   ((looking-at (rx bol "uid:" (group (+ (not ":")))
+                                    ":" (group (* digit))
+                                    ":" (group (* digit))
+                                    ":" (group (* (any ?r ?d ?e)))
+                                    eol))
+                    (push (make-epa-ks-name
+                           :uid (url-unhex-string (match-string 1) t)
+                           :created
+                           (and (match-string 2)
+                                (not (string-empty-p (match-string 2)))
+                                (decode-time (seconds-to-time
+                                              (string-to-number (match-string 2)))))
+                           :expires
+                           (and (match-string 3)
+                                (not (string-empty-p (match-string 3)))
+                                (decode-time (seconds-to-time
+                                              (string-to-number (match-string 3)))))
+                           :flags
+                           (mapcar (lambda (flag)
+                                     (cdr (assq flag '((?r revoked)
+                                                       (?d disabled)
+                                                       (?e expired)))))
+                                   (match-string 4)))
+                          (epa-ks-key-names key)))
+                   ((looking-at-p (rx bol "uat:"))
+                    ;; user attribute fields are ignored
+                    nil)
+                   (t (error "Invalid server response")))
+             (forward-line))
+           (if buf (epa-ks--display-keys buf keys) keys)
+           (kill-buffer)))))
+    (pop-to-buffer buf)
+    (setq epa-ks-last-query (list query exact)))
+  (message "Searching keys..."))
+
+;;;###autoload
+(defalias 'epa-search-keys 'epa-ks-search-keys)
+
+;;; epa-ks.el ends here
-- 
2.20.1





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Tue, 19 May 2020 13:32:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: philip <at> warpmail.net (Philip K.)
To: Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Tue, 19 May 2020 12:08:17 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> Why do you think this should go to core rather than to GNU ELPA?

You're right, my mistake.

> How would you imagine that this will typically be used?

This was developed as part of an university project to work on
Cryptography in Email clients for Emacs. So the idea would be that this
would make it easier to find keys when sending or receiving a message
(we also developed an autocrypt[0] and openpgp.org client[1], but didn't
get around to officially submitting the latter anywhere).

The only "problem" would be, if it were admitted into ELPA, it would
require some more code to integrate it into various mail clients, as [0]
and [1] do.

[0]: https://melpa.org/#/autocrypt
[1]: https://wwwcip.cs.fau.de/~oj14ozun/src+etc/openpgp.el

-- 
	Philip K.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Tue, 19 May 2020 13:51:02 GMT) Full text and rfc822 format available.

Message #11 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 39886 <at> debbugs.gnu.org, "Philip K." <philip <at> warpmail.net>
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Tue, 19 May 2020 06:50:32 -0700
philip <at> warpmail.net (Philip K.) writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> Why do you think this should go to core rather than to GNU ELPA?
>
> You're right, my mistake.

Thanks.  Stefan M, could you help review this submission to GNU ELPA?

>> How would you imagine that this will typically be used?
>
> This was developed as part of an university project to work on
> Cryptography in Email clients for Emacs. So the idea would be that this
> would make it easier to find keys when sending or receiving a message
> (we also developed an autocrypt[0] and openpgp.org client[1], but didn't
> get around to officially submitting the latter anywhere).
>
> The only "problem" would be, if it were admitted into ELPA, it would
> require some more code to integrate it into various mail clients, as [0]
> and [1] do.
>
> [0]: https://melpa.org/#/autocrypt
> [1]: https://wwwcip.cs.fau.de/~oj14ozun/src+etc/openpgp.el

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Sat, 08 Aug 2020 14:00:02 GMT) Full text and rfc822 format available.

Message #14 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: philip <at> warpmail.net (Philip K.)
Cc: 39886 <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Sat, 08 Aug 2020 15:59:19 +0200
philip <at> warpmail.net (Philip K.) writes:

> This was developed as part of an university project to work on
> Cryptography in Email clients for Emacs. So the idea would be that this
> would make it easier to find keys when sending or receiving a message
> (we also developed an autocrypt[0] and openpgp.org client[1], but didn't
> get around to officially submitting the latter anywhere).
>
> The only "problem" would be, if it were admitted into ELPA, it would
> require some more code to integrate it into various mail clients, as [0]
> and [1] do.

I think this makes more sense in Emacs core than in ELPA, really -- it's
infrastructure that could help the Emacs mail clients navigate the key
servers, which would be helpful (because it's pretty opaque currently).

Any other opinions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Sat, 08 Aug 2020 14:43:02 GMT) Full text and rfc822 format available.

Message #17 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, "Philip K." <philip <at> warpmail.net>
Cc: 39886 <at> debbugs.gnu.org
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Sat, 8 Aug 2020 07:42:33 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I think this makes more sense in Emacs core than in ELPA, really -- it's
> infrastructure that could help the Emacs mail clients navigate the key
> servers, which would be helpful (because it's pretty opaque currently).

Makes sense to me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Sat, 08 Aug 2020 14:53:01 GMT) Full text and rfc822 format available.

Message #20 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Colin Baxter <m43cap <at> yandex.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: , 39886 <at> debbugs.gnu.org, "Philip K." <philip <at> warpmail.net>,
 Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Sat, 08 Aug 2020 15:51:55 +0100
>>>>> Lars Ingebrigtsen <larsi <at> gnus.org> writes:

    > philip <at> warpmail.net (Philip K.) writes:
    >> This was developed as part of an university project to work on
    >> Cryptography in Email clients for Emacs. So the idea would be
    >> that this would make it easier to find keys when sending or
    >> receiving a message (we also developed an autocrypt[0] and
    >> openpgp.org client[1], but didn't get around to officially
    >> submitting the latter anywhere).
    >> 
    >> The only "problem" would be, if it were admitted into ELPA, it
    >> would require some more code to integrate it into various mail
    >> clients, as [0] and [1] do.

    > I think this makes more sense in Emacs core than in ELPA, really
    > -- it's infrastructure that could help the Emacs mail clients
    > navigate the key servers, which would be helpful (because it's
    > pretty opaque currently).

    > Any other opinions?

The 'EasyPG Assistant Keyserver client' doesn't seem to pick the
keyserver from the gpg.conf file - right? I wonder why not.

Best wishes,

Colin Baxter.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Sat, 08 Aug 2020 17:21:02 GMT) Full text and rfc822 format available.

Message #23 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: "Philip K." <philipk <at> posteo.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 39886 <at> debbugs.gnu.org, stefan <at> marxist.se
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Sat, 08 Aug 2020 19:20:34 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> philip <at> warpmail.net (Philip K.) writes:
>
>> This was developed as part of an university project to work on
>> Cryptography in Email clients for Emacs. So the idea would be that this
>> would make it easier to find keys when sending or receiving a message
>> (we also developed an autocrypt[0] and openpgp.org client[1], but didn't
>> get around to officially submitting the latter anywhere).
>>
>> The only "problem" would be, if it were admitted into ELPA, it would
>> require some more code to integrate it into various mail clients, as [0]
>> and [1] do.
>
> I think this makes more sense in Emacs core than in ELPA, really -- it's
> infrastructure that could help the Emacs mail clients navigate the key
> servers, which would be helpful (because it's pretty opaque currently).
>
> Any other opinions?

I agree, submitting this as a core-patch was the wrong approach. What's
the procedure for submitting a ELPA package?

-- 
	Philip K.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Sun, 09 Aug 2020 09:53:01 GMT) Full text and rfc822 format available.

Message #26 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Philip K." <philipk <at> posteo.net>
Cc: 39886 <at> debbugs.gnu.org, stefan <at> marxist.se
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Sun, 09 Aug 2020 11:52:17 +0200
"Philip K." <philipk <at> posteo.net> writes:

> I agree, submitting this as a core-patch was the wrong approach. What's
> the procedure for submitting a ELPA package?

I was saying that submitting it to Emacs core was the right approach.
:-)

For instance, when a user clicks on a "verify this signed article"
button in Gnus/rmail, the key should be downloaded from a key server
automatically, and if I understand your package correctly, it allows
doing so?

But for this to work seamlessly, your package has to be in Emacs core,
otherwise Gnus/rmail can't rely on it as easily.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Sun, 09 Aug 2020 11:31:01 GMT) Full text and rfc822 format available.

Message #29 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: philipk <at> posteo.net (Philip K.)
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 39886 <at> debbugs.gnu.org, stefan <at> marxist.se
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Sun, 09 Aug 2020 13:28:11 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> "Philip K." <philipk <at> posteo.net> writes:
>
>> I agree, submitting this as a core-patch was the wrong approach. What's
>> the procedure for submitting a ELPA package?
>
> I was saying that submitting it to Emacs core was the right approach.
> :-)

Oh my, I misread your message. Sorry for that.

> For instance, when a user clicks on a "verify this signed article"
> button in Gnus/rmail, the key should be downloaded from a key server
> automatically, and if I understand your package correctly, it allows
> doing so?

Yes, it implements the protocol and a basic UI. My only issues is that I
wrote this before I dove in to the EPA source, and realized that it more
or les depends on GnuPG. And if GnuGP is alreay given, I could just as
well use it's build-in functionallity for querying the server, without
having to reimplement it in Elisp.

> But for this to work seamlessly, your package has to be in Emacs core,
> otherwise Gnus/rmail can't rely on it as easily.

Couldn't it extend Gnus/rmail externally? Or could Gnus/rmail check if
it's feature is available?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Sun, 09 Aug 2020 19:42:02 GMT) Full text and rfc822 format available.

Message #32 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: philipk <at> posteo.net (Philip K.)
Cc: 39886 <at> debbugs.gnu.org, stefan <at> marxist.se
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Sun, 09 Aug 2020 21:41:22 +0200
philipk <at> posteo.net (Philip K.) writes:

> Yes, it implements the protocol and a basic UI. My only issues is that I
> wrote this before I dove in to the EPA source, and realized that it more
> or les depends on GnuPG. And if GnuGP is alreay given, I could just as
> well use it's build-in functionallity for querying the server, without
> having to reimplement it in Elisp.

Hm, yes, that's true...

>> But for this to work seamlessly, your package has to be in Emacs core,
>> otherwise Gnus/rmail can't rely on it as easily.
>
> Couldn't it extend Gnus/rmail externally? Or could Gnus/rmail check if
> it's feature is available?

That's possible, but these things always turn out cleaner and less
breakable if "applications" (like rmail) call libraries, instead of the
libraries extending the "applications".

And checking is always possible, but the user interface is often better
and less fragile if the applications can just rely in the infrastructure
being there.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Wed, 12 May 2021 16:46:01 GMT) Full text and rfc822 format available.

Message #35 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: philipk <at> posteo.net (Philip K.)
Cc: 39886 <at> debbugs.gnu.org, stefan <at> marxist.se
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Wed, 12 May 2021 18:45:15 +0200
I've now added the library to Emacs 28 (with some changes for easier
testing).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 12 May 2021 16:46:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 39886 <at> debbugs.gnu.org and Philip K <philip <at> warpmail.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 12 May 2021 16:46:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Wed, 12 May 2021 16:53:02 GMT) Full text and rfc822 format available.

Message #42 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 39886 <at> debbugs.gnu.org, stefan <at> marxist.se
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Wed, 12 May 2021 16:52:46 +0000
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I've now added the library to Emacs 28 (with some changes for easier
> testing).

The email address should probably be updated, in case someone decides to
send me a message directly.

-- 
	Philip K.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Wed, 12 May 2021 16:58:02 GMT) Full text and rfc822 format available.

Message #45 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 39886 <at> debbugs.gnu.org, stefan <at> marxist.se
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Wed, 12 May 2021 18:57:23 +0200
Philip Kaludercic <philipk <at> posteo.net> writes:

> The email address should probably be updated, in case someone decides to
> send me a message directly.

OK; updated now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Wed, 12 May 2021 17:11:02 GMT) Full text and rfc822 format available.

Message #48 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 39886 <at> debbugs.gnu.org, philipk <at> posteo.net, stefan <at> marxist.se
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Wed, 12 May 2021 20:10:15 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Wed, 12 May 2021 18:45:15 +0200
> Cc: 39886 <at> debbugs.gnu.org, stefan <at> marxist.se
> 
> I've now added the library to Emacs 28 (with some changes for easier
> testing).

I see there an interactive function whose name includes "--".  Is that
intentional?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Wed, 12 May 2021 17:24:02 GMT) Full text and rfc822 format available.

Message #51 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 39886 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 stefan <at> marxist.se
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Wed, 12 May 2021 17:23:30 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Lars Ingebrigtsen <larsi <at> gnus.org>
>> Date: Wed, 12 May 2021 18:45:15 +0200
>> Cc: 39886 <at> debbugs.gnu.org, stefan <at> marxist.se
>> 
>> I've now added the library to Emacs 28 (with some changes for easier
>> testing).
>
> I see there an interactive function whose name includes "--".  Is that
> intentional?

No, that must have been a mistake. Should it fix it?

-- 
	Philip K.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Wed, 12 May 2021 17:25:01 GMT) Full text and rfc822 format available.

Message #54 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 39886 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, stefan <at> marxist.se
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Wed, 12 May 2021 19:24:31 +0200
Philip Kaludercic <philipk <at> posteo.net> writes:

> No, that must have been a mistake. Should it fix it?

Yes, a patch for that would be appreciated.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Wed, 12 May 2021 17:35:02 GMT) Full text and rfc822 format available.

Message #57 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 39886 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, stefan <at> marxist.se
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Wed, 12 May 2021 17:34:38 +0000
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Philip Kaludercic <philipk <at> posteo.net> writes:
>
>> No, that must have been a mistake. Should it fix it?
>
> Yes, a patch for that would be appreciated.

I requested access to the savannah repo a few months ago, if nobody
minds, I could also push the fixes directly (among other issues I have
also noticed).

-- 
	Philip K.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Wed, 12 May 2021 17:54:01 GMT) Full text and rfc822 format available.

Message #60 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 39886 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, stefan <at> marxist.se
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Wed, 12 May 2021 17:52:59 +0000
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Philip Kaludercic <philipk <at> posteo.net> writes:
>
>> No, that must have been a mistake. Should it fix it?
>
> Yes, a patch for that would be appreciated.

This should be more consistent:

-- 
	Philip K.

[0001-Don-t-mark-interactive-commands-as-internal-function.patch (text/x-diff, inline)]
From 6ef0a95dcd7f4344b563788a57abf9e504364c11 Mon Sep 17 00:00:00 2001
From: Philip K <philipk <at> posteo.net>
Date: Wed, 12 May 2021 19:27:54 +0200
Subject: [PATCH] Don't mark interactive commands as internal functions

---
 lisp/epa-ks.el | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lisp/epa-ks.el b/lisp/epa-ks.el
index af2398c128..a33025b112 100644
--- a/lisp/epa-ks.el
+++ b/lisp/epa-ks.el
@@ -68,9 +68,9 @@ epa-ks-last-query
 (defvar epa-ks-search-mode-map
   (let ((map (make-sparse-keymap)))
     (suppress-keymap map)
-    (define-key map (kbd "f") #'epa-ks--mark-key-to-fetch)
-    (define-key map (kbd "i") #'epa-ks--inspect-key-to-fetch)
-    (define-key map (kbd "u") #'epa-ks--unmark-key-to-fetch)
+    (define-key map (kbd "f") #'epa-ks-mark-key-to-fetch)
+    (define-key map (kbd "i") #'epa-ks-inspect-key-to-fetch)
+    (define-key map (kbd "u") #'epa-ks-unmark-key-to-fetch)
     (define-key map (kbd "x") #'epa-ks-do-key-to-fetch)
     map))
 
@@ -89,19 +89,19 @@ epa-ks-search-mode
             nil t)
   (tabulated-list-init-header))
 
-(defun epa-ks--inspect-key-to-fetch ()
+(defun epa-ks-inspect-key-to-fetch ()
   "Display full ID of key under point in the minibuffer."
   (interactive)
   (message "Full ID: %s" (epa-ks-key-id (car (tabulated-list-get-id)))))
 
-(defun epa-ks--unmark-key-to-fetch ()
+(defun epa-ks-unmark-key-to-fetch ()
   "Remove fetch mark for key under point.
 
 If a region is active, unmark all keys in active region."
   (interactive)
-  (epa-ks--mark-key-to-fetch ""))
+  (epa-ks-mark-key-to-fetch ""))
 
-(defun epa-ks--mark-key-to-fetch (tag)
+(defun epa-ks-mark-key-to-fetch (tag)
   "Add fetch-mark to key under point.
 
 If a region is active, mark all keys in active region.
@@ -109,7 +109,7 @@ epa-ks--mark-key-to-fetch
 When all keys have been selected, use \\[epa-ks-do-key-to-fetch] to
 actually import the keys.
 
-When called interactively, `epa-ks--mark-key-to-fetch' will always
+When called interactively, `epa-ks-mark-key-to-fetch' will always
 add a \"F\" tag.  Non-interactivly the tag must be specified by
 setting the TAG parameter."
   (interactive (list "F"))
@@ -125,7 +125,7 @@ epa-ks--mark-key-to-fetch
 (defun epa-ks-do-key-to-fetch ()
   "Fetch all marked keys from keyserver and import them.
 
-Keys are marked using `epa-ks--mark-key-to-fetch'."
+Keys are marked using `epa-ks-mark-key-to-fetch'."
   (interactive)
   (save-excursion
     (let (keys)
-- 
2.30.2


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39886; Package emacs. (Wed, 12 May 2021 18:01:02 GMT) Full text and rfc822 format available.

Message #63 received at 39886 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 39886 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, stefan <at> marxist.se
Subject: Re: bug#39886: [PATCH] Add EPA keyserver client
Date: Wed, 12 May 2021 20:00:27 +0200
Philip Kaludercic <philipk <at> posteo.net> writes:

>> Yes, a patch for that would be appreciated.
>
> This should be more consistent:

Thanks; applied now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 Jun 2021 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 320 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.