GNU bug report logs - #19960
epg: allow passing --keyring values via new epg-context-keyrings

Previous Next

Package: emacs;

Reported by: Ivan Shmakov <ivan <at> siamics.net>

Date: Fri, 27 Feb 2015 16:14:02 UTC

Severity: wishlist

Tags: patch, wontfix

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 19960 in the body.
You can then email your comments to 19960 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#19960; Package emacs. (Fri, 27 Feb 2015 16:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ivan Shmakov <ivan <at> siamics.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 27 Feb 2015 16:14:02 GMT) Full text and rfc822 format available.

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

From: Ivan Shmakov <ivan <at> siamics.net>
To: submit <at> debbugs.gnu.org
Subject: epg: allow passing --keyring values via new epg-context-keyrings 
Date: Fri, 27 Feb 2015 16:12:49 +0000
[Message part 1 (text/plain, inline)]
Package:  emacs
Severity: wishlist
Tags: patch

	Please consider the patch MIMEd.

	* lisp/epg.el (epg-context): New slot: keyrings.
	(epg--start): Use it.
	(epg--list-keys-1): Likewise.  (Bug#???)

	An example code making use of this change (assuming that the
	extra keyring is available at the location usual to Debian
	Jessie) is also MIMEd.

	(Tested on 619fc5c197eb, 2015-02-26 18:09:48 UTC.)

-- 
FSF associate member #7257  np. Gates of Tomorrow — Iron Maiden   … 230E 334A
[Message part 2 (text/diff, inline)]
diff --git a/lisp/epg.el b/lisp/epg.el
index f665453..0768697 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -197,6 +197,7 @@ cl-defstruct epg-context
   protocol
   program
   (home-directory epg-gpg-home-directory)
+  keyrings
   armor
   textmode
   include-certs
@@ -570,6 +571,11 @@ defun epg--start (context args)
 		       (if (epg-context-home-directory context)
 			   (list "--homedir"
 				 (epg-context-home-directory context)))
+		       (if (epg-context-keyrings context)
+			   (apply #'nconc
+				  (mapcar (lambda (elt)
+					    (list "--keyring" elt))
+					  (epg-context-keyrings context))))
 		       (unless (eq (epg-context-protocol context) 'CMS)
 			 '("--command-fd" "0"))
 		       (if (epg-context-armor context) '("--armor"))
@@ -1263,6 +1269,11 @@ defun epg--list-keys-1 (context name mode)
   (let ((args (append (if (epg-context-home-directory context)
 			  (list "--homedir"
 				(epg-context-home-directory context)))
+		       (if (epg-context-keyrings context)
+			   (apply #'nconc
+				  (mapcar (lambda (elt)
+					    (list "--keyring" elt))
+					  (epg-context-keyrings context))))
 		      '("--with-colons" "--no-greeting" "--batch"
 			"--with-fingerprint" "--with-fingerprint")
 		      (unless (eq (epg-context-protocol context) 'CMS)
[Message part 3 (text/emacs-lisp, inline)]
(let ((cx (epg-make-context 'OpenPGP))
      (s  (with-current-buffer
              (url-retrieve-synchronously
               "http://snapshot.debian.org/archive/debian/20140501T070413Z/dists/jessie/InRelease")
            (buffer-substring-no-properties
             url-http-end-of-headers (point-max))))
      a b)
  (setq a (progn
            (epg-verify-string cx s)
            (epg-context-result-for cx 'verify)))
  (push "/etc/apt/trusted.gpg.d/debian-archive-wheezy-automatic.gpg"
        (epg-context-keyrings cx))
  (setq b (progn
            (epg-verify-string cx s)
            (epg-context-result-for cx 'verify)))
  ;; .
  (list a b))
;; Expected result:
; (([cl-struct-epg-signature
;    no-pubkey "8B48AD6246925553" nil nil
;    (21345 . 47158) nil 1 8 1 nil nil])
;  ([cl-struct-epg-signature
;    good "8B48AD6246925553" undefined
;    "A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553"
;    (21345 . 47158) nil 1 8 1 4 nil]))

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19960; Package emacs. (Mon, 20 Apr 2015 22:26:02 GMT) Full text and rfc822 format available.

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

From: Ted Zlatanov <tzz <at> lifelogs.com>
To: Ivan Shmakov <ivan <at> siamics.net>
Cc: Daiki Ueno <ueno <at> unixuser.org>, 19960 <at> debbugs.gnu.org
Subject: Re: bug#19960: epg: allow passing --keyring values via new
 epg-context-keyrings
Date: Mon, 20 Apr 2015 18:25:29 -0400
On Fri, 27 Feb 2015 16:12:49 +0000 Ivan Shmakov <ivan <at> siamics.net> wrote: 

IS> Package:  emacs
IS> Severity: wishlist
IS> Tags: patch

IS> 	Please consider the patch MIMEd.

IS> 	* lisp/epg.el (epg-context): New slot: keyrings.
IS> 	(epg--start): Use it.
IS> 	(epg--list-keys-1): Likewise.  (Bug#???)

IS> 	An example code making use of this change (assuming that the
IS> 	extra keyring is available at the location usual to Debian
IS> 	Jessie) is also MIMEd.

IS> 	(Tested on 619fc5c197eb, 2015-02-26 18:09:48 UTC.)

I'd find that useful but don't know if Daiki Ueno agrees.

Ted




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19960; Package emacs. (Tue, 21 Apr 2015 01:41:02 GMT) Full text and rfc822 format available.

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

From: Daiki Ueno <ueno <at> gnu.org>
To: Ivan Shmakov <ivan <at> siamics.net>
Cc: Werner Koch <wk <at> gnupg.org>, 19960 <at> debbugs.gnu.org
Subject: Re: bug#19960: epg: allow passing --keyring values via new
 epg-context-keyrings
Date: Tue, 21 Apr 2015 10:40:11 +0900
Ted Zlatanov <tzz <at> lifelogs.com> writes:

> On Fri, 27 Feb 2015 16:12:49 +0000 Ivan Shmakov <ivan <at> siamics.net> wrote: 
>
> IS> Package:  emacs
> IS> Severity: wishlist
> IS> Tags: patch
>
> IS> 	Please consider the patch MIMEd.
>
> IS> 	* lisp/epg.el (epg-context): New slot: keyrings.
> IS> 	(epg--start): Use it.
> IS> 	(epg--list-keys-1): Likewise.  (Bug#???)
>
> IS> 	An example code making use of this change (assuming that the
> IS> 	extra keyring is available at the location usual to Debian
> IS> 	Jessie) is also MIMEd.
>
> IS> 	(Tested on 619fc5c197eb, 2015-02-26 18:09:48 UTC.)
>
> I'd find that useful but don't know if Daiki Ueno agrees.

Yes, I agree.  One concern is that GPGME doesn't provide the API either,
while the --keyring option has been there for a long time.  Perhaps that
might be on purpose.  Werner, do you have any comments?

Thanks,
-- 
Daiki Ueno





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19960; Package emacs. (Tue, 21 Apr 2015 11:17:02 GMT) Full text and rfc822 format available.

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

From: Daiki Ueno <ueno <at> gnu.org>
To: Werner Koch <wk <at> gnupg.org>
Cc: 19960 <at> debbugs.gnu.org, Ivan Shmakov <ivan <at> siamics.net>
Subject: Re: bug#19960: epg: allow passing --keyring values via new
 epg-context-keyrings
Date: Tue, 21 Apr 2015 20:16:32 +0900
Werner Koch <wk <at> gnupg.org> writes:

> Using a different keyring may result in some surprising behaviour and
> thus I consider it is better to use use a different GNUPGHOME for a
> different configuration.

Thanks, I was expecting so.  Considering that, I'd suggest to make the
patch less generic.  That is, assuming that the main use-case of an
external keyring is signature verification, add an optional argument
KEYRING to epg-verify-*, instead of extending epg-context.

Regards,
-- 
Daiki Ueno




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19960; Package emacs. (Tue, 21 Apr 2015 11:38:02 GMT) Full text and rfc822 format available.

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

From: Ted Zlatanov <tzz <at> lifelogs.com>
To: Daiki Ueno <ueno <at> gnu.org>
Cc: Werner Koch <wk <at> gnupg.org>, 19960 <at> debbugs.gnu.org,
 Ivan Shmakov <ivan <at> siamics.net>
Subject: Re: bug#19960: epg: allow passing --keyring values via new
 epg-context-keyrings
Date: Tue, 21 Apr 2015 07:37:24 -0400
On Tue, 21 Apr 2015 20:16:32 +0900 Daiki Ueno <ueno <at> gnu.org> wrote: 

DU> Werner Koch <wk <at> gnupg.org> writes:
>> Using a different keyring may result in some surprising behaviour and
>> thus I consider it is better to use use a different GNUPGHOME for a
>> different configuration.

DU> Thanks, I was expecting so.  Considering that, I'd suggest to make the
DU> patch less generic.  That is, assuming that the main use-case of an
DU> external keyring is signature verification, add an optional argument
DU> KEYRING to epg-verify-*, instead of extending epg-context.

I actively use GnuPG with two separate keyrings for file encryption and
decryption, that's why I thought this was useful. I'd like to keep both
keyrings in one place instead of overriding GPGHOME. But I don't feel
strongly about it and can adapt, if there are downsides I wasn't aware
existed.

Thanks!
Ted




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19960; Package emacs. (Tue, 21 Apr 2015 15:32:03 GMT) Full text and rfc822 format available.

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

From: Werner Koch <wk <at> gnupg.org>
To: Daiki Ueno <ueno <at> gnu.org>
Cc: 19960 <at> debbugs.gnu.org, Ivan Shmakov <ivan <at> siamics.net>
Subject: Re: bug#19960: epg: allow passing --keyring values via new
 epg-context-keyrings
Date: Tue, 21 Apr 2015 12:04:12 +0200
On Tue, 21 Apr 2015 03:40, ueno <at> gnu.org said:

> Yes, I agree.  One concern is that GPGME doesn't provide the API either,
> while the --keyring option has been there for a long time.  Perhaps that
> might be on purpose.  Werner, do you have any comments?

It is called GnuPG Made Easy and more esoteric workflows would not match
that name.  Using a different keyring may result in some surprising
behaviour and thus I consider it is better to use use a different
GNUPGHOME for a different configuration.  GPMGE has an API to change
this.


Shalom-Salam,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.





Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 23 Feb 2016 11:01:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 19960 <at> debbugs.gnu.org and Ivan Shmakov <ivan <at> siamics.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 23 Feb 2016 11:01:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 22 Mar 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 86 days ago.

Previous Next


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