[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems importing keys via epa-search-keys

From: Filipp Gunbin
Subject: Re: problems importing keys via epa-search-keys
Date: Sat, 11 Mar 2023 01:58:43 +0300
User-agent: Gnus/5.13 (Gnus v5.13)

On 09/03/2023 08:14 +0100, Giovanni Biscuolo wrote:

> Hello,
> (please if you reply include me in Cc: since I'm not subscribed)
> if I "M-x epa-search-keys" and try to fetch a key with =f= and then =x=
> in =Key search= buffer, I get this in *Messages*:
> Searching keys...
> Press ‘f’ to mark a key, ‘x’ to fetch all marked keys.
> Contacting host:
> but the key is never imported in my gnupg keyring.



Yes, broken since 23b6cd41f55b833e8a562c51642d36b5211a510b, the patch is

Eli, would this be OK for emacs-29?  This is clearly a regression.


diff --git a/lisp/epa-ks.el b/lisp/epa-ks.el
index 77d896fa438..2ab550cb9b1 100644
--- a/lisp/epa-ks.el
+++ b/lisp/epa-ks.el
@@ -140,8 +140,8 @@ epa-ks-do-key-to-fetch
           (epa-ks--fetch-key id)))))
-(defun epa-ks--query-url (query exact)
-  "Return URL for QUERY.
+(defun epa-ks--query-url (query operation exact)
+  "Return URL for QUERY and OPERATION.
 If EXACT is non-nil, don't accept approximate matches."
   (format "https://%s/pks/lookup?%s";
           (cond ((null epa-keyserver)
@@ -154,13 +154,13 @@ epa-ks--query-url
            (append `(("search" ,query)
                      ("options" "mr")
-                     ("op" "index"))
+                     ("op" ,operation))
                    (and exact '(("exact" "on")))))))
 (defun epa-ks--fetch-key (id)
   "Send request to import key with specified ID."
-   (epa-ks--query-url (concat "0x" (url-hexify-string id)) t)
+   (epa-ks--query-url (concat "0x" (url-hexify-string id)) "get" t)
    (lambda (status)
      (when (plist-get status :error)
        (error "Request failed: %s"
@@ -236,7 +236,7 @@ epa-search-keys
-     (epa-ks--query-url query exact)
+     (epa-ks--query-url query "index" exact)
      (lambda (status)
        (when (plist-get status :error)
          (when buf

reply via email to

[Prev in Thread] Current Thread [Next in Thread]