GNU bug report logs - #45916
28.0.50; Inconsistent EasyPG behaviour when encrypting .gpg files

Previous Next

Package: emacs;

Reported by: Pankaj Jangid <pankaj <at> codeisgreat.org>

Date: Sat, 16 Jan 2021 08:06:01 UTC

Severity: normal

Tags: moreinfo, unreproducible

Found in version 28.0.50

Done: Pankaj Jangid <pankaj <at> codeisgreat.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 45916 in the body.
You can then email your comments to 45916 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#45916; Package emacs. (Sat, 16 Jan 2021 08:06:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pankaj Jangid <pankaj <at> codeisgreat.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 16 Jan 2021 08:06:01 GMT) Full text and rfc822 format available.

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

From: Pankaj Jangid <pankaj <at> codeisgreat.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; Inconsistent EasyPG behaviour when encrypting .gpg files
Date: Sat, 16 Jan 2021 13:35:33 +0530
It used to work until 1-2 months back. Sorry for reporting lated.

1. emacs -Q

2. eval ‘(defvar epg-pinentry-mode 'loopback)’

3. C-c C-f ~/x.gpg RET

4. Write some text

5. C-x C-s ; this prompts for selecting key and saves using that.

6. C-x k ;

7. C-c C-f ~/x.gpg RET ; open again

8. make some changes

9. C-x C-s ; asks for passphrase for symmetric key encryption

This, I think is a bug.

Behaviour in step 5 and 9 should be same. _Or_ if the file was already
saved encrypted with a public-key then it should use the same key again.

I am on macOS at present, but I noticed similar behaviour on Debian last
week.


In GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin20.2.0, NS appkit-2022.20 Version 11.1 (Build 20C69))
 of 2021-01-16 built on mb2.local
Repository revision: f45be48ddbde00610e1e08fca6590dcf24a4e1b5
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2022
System Description:  macOS 11.1

Configured features:
ACL DBUS GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY
KQUEUE NS PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS XIM ZLIB

Important settings:
  value of $LC_CTYPE: UTF-8
  value of $LANG: en_US
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml easymenu mml-sec gnus-util rmail rmail-loaddefs auth-source
cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map
text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils seq byte-opt gv bytecomp byte-compile
cconv epa-file epa derived epg epg-config time-date subr-x cl-loaddefs
cl-lib iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind kqueue cocoa ns
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 52551 9056)
 (symbols 48 6820 1)
 (strings 32 18053 2283)
 (string-bytes 1 596654)
 (vectors 16 12513)
 (vector-slots 8 170100 10014)
 (floats 8 21 33)
 (intervals 56 214 0)
 (buffers 984 11))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45916; Package emacs. (Sat, 16 Jan 2021 09:41:02 GMT) Full text and rfc822 format available.

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

From: Pankaj Jangid <pankaj <at> codeisgreat.org>
To: 45916 <at> debbugs.gnu.org
Subject: Re: bug#45916: 28.0.50; Inconsistent EasyPG behaviour when
 encrypting .gpg files
Date: Sat, 16 Jan 2021 15:10:44 +0530
> 1. emacs -Q
> 2. eval ‘(defvar epg-pinentry-mode 'loopback)’
> 3. C-c C-f ~/x.gpg RET
> 4. Write some text
> 5. C-x C-s ; this prompts for selecting key and saves using that.
> 6. C-x k ;
> 7. C-c C-f ~/x.gpg RET ; open again
> 8. make some changes
> 9. C-x C-s ; asks for passphrase for symmetric key encryption

> Behaviour in step 5 and 9 should be same. _Or_ if the file was already
> saved encrypted with a public-key then it should use the same key again.

More info (it is fixed after invoking ‘M-x epa-file-select-keys’)

Now I opened ~/x.gpg again and invoke ‘M-x epa-file-select-keys’ and
selected the desired public key and saved (C-x C-s). Now it saved the
file using the public key.

I see that, when I open a .gpg file it sets a buffer-local variable
‘epa-file-encrypt-to’. Which makes it automatically use the public key
because the value of ‘epa-file-select-keys’ is nil (default).

And after I invoked ‘M-x epa-file-select-keys’, it is consistently
behaving as described in the manuals i.e. Step (9) is not asking for
symmetric key encryption passphrase any more.

Probably the ‘epa-file-encrypt-to’ was not being set earlier after
opening a .gpg file.

My question is - does invoking ‘M-x epa-file-select-keys’ save the
information somewhere on the filesystem? Only after invoking this the
behaviour got fixed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45916; Package emacs. (Mon, 09 May 2022 14:24:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Pankaj Jangid <pankaj <at> codeisgreat.org>
Cc: 45916 <at> debbugs.gnu.org
Subject: Re: bug#45916: 28.0.50; Inconsistent EasyPG behaviour when
 encrypting .gpg files
Date: Mon, 09 May 2022 16:23:49 +0200
Pankaj Jangid <pankaj <at> codeisgreat.org> writes:

>> 1. emacs -Q
>> 2. eval ‘(defvar epg-pinentry-mode 'loopback)’
>> 3. C-c C-f ~/x.gpg RET
>> 4. Write some text
>> 5. C-x C-s ; this prompts for selecting key and saves using that.
>> 6. C-x k ;
>> 7. C-c C-f ~/x.gpg RET ; open again
>> 8. make some changes
>> 9. C-x C-s ; asks for passphrase for symmetric key encryption
>
>> Behaviour in step 5 and 9 should be same. _Or_ if the file was already
>> saved encrypted with a public-key then it should use the same key again.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I was unable to reproduce the bug in Emacs 29.

> My question is - does invoking ‘M-x epa-file-select-keys’ save the
> information somewhere on the filesystem? Only after invoking this the
> behaviour got fixed.

Not that I can see...

Are you still seeing any issues in this area in recent Emacs versions?
There's been quite a few bug fixes in this area over the last year, if I
remember correctly.

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




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 09 May 2022 14:25:02 GMT) Full text and rfc822 format available.

Added tag(s) unreproducible. Request was from Pankaj Jangid <pankaj <at> codeisgreat.org> to control <at> debbugs.gnu.org. (Fri, 20 May 2022 17:28:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 45916 <at> debbugs.gnu.org and Pankaj Jangid <pankaj <at> codeisgreat.org> Request was from Pankaj Jangid <pankaj <at> codeisgreat.org> to control <at> debbugs.gnu.org. (Fri, 20 May 2022 17:28:03 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. (Sat, 18 Jun 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 1 day ago.

Previous Next


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