GNU bug report logs - #36101
26.1; epg--status-*SIG does not always precent decode

Previous Next

Package: emacs;

Reported by: Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>

Date: Wed, 5 Jun 2019 14:11:01 UTC

Severity: normal

Tags: fixed, moreinfo

Found in version 26.1

Fixed in version 27.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 36101 in the body.
You can then email your comments to 36101 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#36101; Package emacs. (Wed, 05 Jun 2019 14:11:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 05 Jun 2019 14:11:01 GMT) Full text and rfc822 format available.

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

From: Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 26.1; epg--status-*SIG does not always precent decode
Date: Wed, 5 Jun 2019 14:09:55 +0000
Hi,

I received a message with a S/MIME signature that verified correctly (using gpgsm).  However, the button has undecoded percent escapes.  It turns out that the culprit is the function `epg--status-*SIG' which, when (epg-context-protocol context) is 'CMS and `epg-dn-from-string' triggers an error, does not perform the decoding of percent escapes.

If, in the body of `epg-dn-from-string', one changes

	(condition-case nil
	    (if (eq (epg-context-protocol context) 'CMS)
		(setq user-id (epg-dn-from-string user-id))
	      (setq user-id (epg--decode-percent-escape user-id)))
	  (error))

into

	(condition-case nil
	    (if (eq (epg-context-protocol context) 'CMS)
		(setq user-id (epg-dn-from-string user-id)))
	  (error))
	(setq user-id (epg--decode-percent-escape user-id))

it works (provided http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36098 has been fixed first).  I do not think `epg--decode-percent-escape' can trigger `error' but it is protected everywhere it is used so maybe one should write

	(ignore-errors
          (setq user-id (epg--decode-percent-escape user-id)))

Best,
C.



In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.4)
 of 2019-02-03, modified by Debian built on zam904
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description:	Debian GNU/Linux 10 (buster)

Recent messages:
Undo! [3 times]
Type C-x 1 to delete the help window.
Mark set
[mu4e] Found 270 matching messages
Learned tokens from 1 message(s) (1 message(s) examined)
Type C-x 1 to delete the help window.
Mark set
Mark saved where search started
Undo!
Mark set

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --enable-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --build
 x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd
 --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --with-x=yes
 --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs-26.1+1=. -fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2

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

Major mode: mu4e:view

Minor modes in effect:
  visual-fill-column-mode: t
  TeX-PDF-mode: t
  global-magit-file-mode: t
  diff-auto-refine-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  desktop-save-mode: t
  show-paren-mode: t
  global-edit-server-edit-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Load-path shadows:
~/software/OCaml/dune/editor-integration/emacs/dune-flymake hides /home/trch/.opam/4.07.1/share/emacs/site-lisp/dune-flymake
~/software/OCaml/dune/editor-integration/emacs/dune hides /home/trch/.opam/4.07.1/share/emacs/site-lisp/dune
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/deb-view hides /usr/share/emacs/site-lisp/elpa/debian-el-37/deb-view
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-bug hides /usr/share/emacs/site-lisp/elpa/debian-el-37/debian-bug
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/apt-utils hides /usr/share/emacs/site-lisp/elpa/debian-el-37/apt-utils
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/preseed hides /usr/share/emacs/site-lisp/elpa/debian-el-37/preseed
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/apt-sources hides /usr/share/emacs/site-lisp/elpa/debian-el-37/apt-sources
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-autoloads hides /usr/share/emacs/site-lisp/elpa/debian-el-37/debian-autoloads
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-el hides /usr/share/emacs/site-lisp/elpa/debian-el-37/debian-el
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-el-autoloads hides /usr/share/emacs/site-lisp/elpa/debian-el-37/debian-el-autoloads
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/gnus-BTS hides /usr/share/emacs/site-lisp/elpa/debian-el-37/gnus-BTS
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-el-pkg hides /usr/share/emacs/site-lisp/elpa/debian-el-37/debian-el-pkg
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/deb-view hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/deb-view
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/apt-utils hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/apt-utils
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/preseed hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/preseed
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-bug hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/debian-bug
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/apt-sources hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/apt-sources
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-autoloads hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/debian-autoloads
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-el hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/debian-el
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-el-autoloads hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/debian-el-autoloads
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/gnus-BTS hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/gnus-BTS
/home/trch/.emacs.d/elpa/debian-el-20181020.1513/debian-el-pkg hides /usr/share/emacs/site-lisp/elpa-src/debian-el-37/debian-el-pkg
/usr/share/emacs/site-lisp/rst hides /usr/share/emacs/26.1/lisp/textmodes/rst

Features:
(magit-patch magit-subtree magit-ediff ediff-merg ediff-wind ediff-diff
ediff-mult ediff-help ediff-init ediff-util ediff shadow emacsbug rect
debug find-dired sh-script executable bug-reference magit-extras tabify
man reftex-sel cursor-sensor reftex-ref reftex-toc ibuf-ext ibuffer
ibuffer-loaddefs markdown-mode dabbrev cus-edit cus-start cus-load
cl-print mhtml-mode css-mode eww mm-url url-queue url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf js
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs sgml-mode view cal-china lunar solar cal-dst cal-islam
holidays hol-loaddefs cal-move network-stream nsm starttls mailalias
reftex-parse timezone sort gnus-cite smiley shr-color color url-util shr
svg dom mm-archive mail-extr qp grep eieio-opt help-fns radix-tree
misearch multi-isearch visual-fill-column face-remap texmathp latexenc
org-rmail org-mhe org-irc org-info org-gnus nnir org-docview org-bibtex
org-bbdb org-w3m merlin-ac auto-complete popup tuareg caml-help
find-file flycheck json map elec-pair vc-git reftex-auc preview
prv-emacs tex-buf reftex-dcr reftex reftex-loaddefs reftex-vars flyspell
ispell latex latex-flymake tex-ispell tex-style tex-mode font-latex tex
dbus xml bibtex dune-flymake flymake-proc flymake compile warnings dune
skeleton smie utop utop-minor-mode pcase merlin-cap merlin caml-types
caml-emacs magit-submodule magit-obsolete magit-blame magit-stash
magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone
magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-tag magit-merge magit-branch magit-reset magit-files magit-refs
magit-status magit magit-repos magit-apply magit-wip magit-log
which-func imenu magit-diff smerge-mode diff-mode magit-core
magit-autorevert magit-margin magit-transient magit-process magit-mode
transient git-commit magit-git magit-section magit-utils crm log-edit
pcvs-util add-log with-editor cl-extra async-bytecomp async shell subr-x
dash erc-goodies erc erc-backend erc-compat pp org-mu4e org-agenda
mu4e-icalendar gnus-icalendar org-capture mu4e-contrib mu4e desktop
frameset mu4e-speedbar speedbar sb-image ezimage dframe mu4e-main
mu4e-view thingatpt browse-url gnus-art mm-uu mml2015 mm-view mml-smime
smime dig mailcap gnus-sum gnus-group gnus-undo gnus-start gnus-cloud
nnimap nnmail mail-source tls gnutls utf7 netrc nnoo parse-time
gnus-spec gnus-int gnus-range gnus-win gnus nnheader wid-edit
mu4e-headers mu4e-compose mu4e-context mu4e-draft mu4e-actions ido
rfc2368 smtpmail sendmail mu4e-mark mu4e-message flow-fill mu4e-proc
mu4e-utils doc-view jka-compr image-mode mu4e-lists mu4e-vars message
rmc puny dired dired-loaddefs rfc822 mml mml-sec gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader hl-line
mu4e-meta adoc-mode tempo markup-faces org-element avl-tree generator
org org-macro org-footnote org-pcomplete pcomplete org-list org-faces
org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob
ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint comint
ansi-color ring ob-core ob-eval org-compat org-macs org-loaddefs
format-spec find-func epa-file epa derived epg cl quail help-mode
mm-util mail-prsvr autorevert filenotify edmacro kmacro paren icalendar
diary-lib diary-loaddefs cal-menu calendar cal-loaddefs edit-server
advice server finder-inf tex-site debian-el gh-common marshal
eieio-compat rx info package easymenu epg-config url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv
cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame 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 minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 858606 153098)
 (symbols 48 68811 3)
 (miscs 40 5188 2572)
 (strings 32 251487 23979)
 (string-bytes 1 7584683)
 (vectors 16 91324)
 (vector-slots 8 2361439 108322)
 (floats 8 1358 773)
 (intervals 56 20803 4040)
 (buffers 992 1462))

Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 26 Jun 2019 02:25:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36101; Package emacs. (Fri, 30 Aug 2019 10:31:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>
Cc: 36101 <at> debbugs.gnu.org, Noam Postavsky <npostavs <at> gmail.com>
Subject: Re: bug#36101: 26.1; epg--status-*SIG does not always precent decode
Date: Fri, 30 Aug 2019 12:30:03 +0200
Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be> writes:

> If, in the body of `epg-dn-from-string', one changes
>
> 	(condition-case nil
> 	    (if (eq (epg-context-protocol context) 'CMS)
> 		(setq user-id (epg-dn-from-string user-id))
> 	      (setq user-id (epg--decode-percent-escape user-id)))
> 	  (error))
>
> into
>
> 	(condition-case nil
> 	    (if (eq (epg-context-protocol context) 'CMS)
> 		(setq user-id (epg-dn-from-string user-id)))
> 	  (error))
> 	(setq user-id (epg--decode-percent-escape user-id))
>
> it works 

Noam changed the status of this bug to "fixed" three weeks after it was
reported (but not closed), but as far as I can tell, a change like the
one proposes wasn't done.

Was this fixed in some other way, or was the "fixed" control message in
error?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36101; Package emacs. (Sun, 01 Sep 2019 15:32:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 36101 <at> debbugs.gnu.org,
 Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>
Subject: Re: bug#36101: 26.1; epg--status-*SIG does not always precent decode
Date: Sun, 01 Sep 2019 11:31:06 -0400
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Noam changed the status of this bug to "fixed" three weeks after it was
> reported (but not closed), but as far as I can tell, a change like the
> one proposes wasn't done.
>
> Was this fixed in some other way, or was the "fixed" control message in
> error?

Hmm, I don't remember why I did that.  Might have been a mistake, or
misunderstanding of what the bug is about.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36101; Package emacs. (Wed, 04 Sep 2019 13:30:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>
Cc: 36101 <at> debbugs.gnu.org
Subject: Re: bug#36101: 26.1; epg--status-*SIG does not always precent decode
Date: Wed, 04 Sep 2019 15:29:24 +0200
Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be> writes:

> If, in the body of `epg-dn-from-string', one changes
>
> 	(condition-case nil
> 	    (if (eq (epg-context-protocol context) 'CMS)
> 		(setq user-id (epg-dn-from-string user-id))
> 	      (setq user-id (epg--decode-percent-escape user-id)))
> 	  (error))
>
> into
>
> 	(condition-case nil
> 	    (if (eq (epg-context-protocol context) 'CMS)
> 		(setq user-id (epg-dn-from-string user-id)))
> 	  (error))
> 	(setq user-id (epg--decode-percent-escape user-id))
>
> it works

Hm.  Reading the code a bit more, I don't think that looks correct?
`epg-dn-from-string' returns an alist, and epg--decode-percent-escape
expects a string.

So I don't understand how that code cold work if
(eq (epg-context-protocol context) 'CMS)...

(defun epg-dn-from-string (string)
  "Parse STRING as LADPv3 Distinguished Names (RFC2253).
The return value is an alist mapping from types to values."

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36101; Package emacs. (Tue, 22 Oct 2019 14:50:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>
Cc: 36101 <at> debbugs.gnu.org
Subject: Re: bug#36101: 26.1; epg--status-*SIG does not always precent decode
Date: Tue, 22 Oct 2019 16:49:19 +0200
Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be> writes:

> I received a message with a S/MIME signature that verified correctly (using gpgsm).  However, the button has undecoded percent escapes.  It turns out that the culprit is the function `epg--status-*SIG' which, when (epg-context-protocol context) is 'CMS and `epg-dn-from-string' triggers an error, does not perform the decoding of percent escapes.
>
> If, in the body of `epg-dn-from-string', one changes
>
> 	(condition-case nil
> 	    (if (eq (epg-context-protocol context) 'CMS)
> 		(setq user-id (epg-dn-from-string user-id))
> 	      (setq user-id (epg--decode-percent-escape user-id)))
> 	  (error))
>
> into
>
> 	(condition-case nil
> 	    (if (eq (epg-context-protocol context) 'CMS)
> 		(setq user-id (epg-dn-from-string user-id)))
> 	  (error))
> 	(setq user-id (epg--decode-percent-escape user-id))
>
> it works (provided http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36098 has been fixed first).  I do not think `epg--decode-percent-escape' can trigger `error' but it is protected everywhere it is used so maybe one should write

Do you have an example here to display the bug?

(epg-dn-from-string "CN=Steve Kille,O=Isode Limited,C=GB")
=> (("CN" . "Steve Kille") ("O" . "Isode Limited") ("C" . "GB"))

so we can't run the output of that from epg--decode-percent-escape.  So
in your case, what are the parameters to epg--status-*SIG?  I.e., the
STRING?

-- 
(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. (Tue, 22 Oct 2019 14:50:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36101; Package emacs. (Wed, 23 Oct 2019 08:26:01 GMT) Full text and rfc822 format available.

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

From: Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: "36101 <at> debbugs.gnu.org" <36101 <at> debbugs.gnu.org>
Subject: Re: bug#36101: 26.1; epg--status-*SIG does not always precent decode
Date: Wed, 23 Oct 2019 08:25:21 +0000
[Message part 1 (text/plain, inline)]
Hi,

On 22 October 2019 at 16:49 CEST, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>
> Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be> writes:
>
>> I received a message with a S/MIME signature that verified correctly (using gpgsm).  However, the button has undecoded percent escapes.  It turns out that the culprit is the function `epg--status-*SIG' which, when (epg-context-protocol context) is 'CMS and `epg-dn-from-string' triggers an error, does not perform the decoding of percent escapes.
>>
>> If, in the body of `epg-dn-from-string', one changes
>>
>> 	(condition-case nil
>> 	    (if (eq (epg-context-protocol context) 'CMS)
>> 		(setq user-id (epg-dn-from-string user-id))
>> 	      (setq user-id (epg--decode-percent-escape user-id)))
>> 	  (error))
>>
>> into
>>
>> 	(condition-case nil
>> 	    (if (eq (epg-context-protocol context) 'CMS)
>> 		(setq user-id (epg-dn-from-string user-id)))
>> 	  (error))
>> 	(setq user-id (epg--decode-percent-escape user-id))
>>
>> it works (provided http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36098 has been fixed first).  I do not think `epg--decode-percent-escape' can trigger `error' but it is protected everywhere it is used so maybe one should write
>
> Do you have an example here to display the bug?

I had a look to the code and it changed since this report.  IIRC, verifying my signature (with which I sign this message) used to display this problem.

Best,
C.
[smime.p7s (application/pkcs7-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36101; Package emacs. (Wed, 23 Oct 2019 08:28:02 GMT) Full text and rfc822 format available.

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

From: Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: "36101 <at> debbugs.gnu.org" <36101 <at> debbugs.gnu.org>
Subject: Re: bug#36101: 26.1; epg--status-*SIG does not always precent decode
Date: Wed, 23 Oct 2019 08:27:15 +0000
[Message part 1 (text/plain, inline)]
On 23 October 2019 at 10:25 CEST, Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be> wrote:
>
> On 22 October 2019 at 16:49 CEST, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>>
>> Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be> writes:
>>
>>> I received a message with a S/MIME signature that verified correctly (using gpgsm).  However, the button has undecoded percent escapes.  It turns out that the culprit is the function `epg--status-*SIG' which, when (epg-context-protocol context) is 'CMS and `epg-dn-from-string' triggers an error, does not perform the decoding of percent escapes.
>>>
>>> If, in the body of `epg-dn-from-string', one changes
>>>
>>> 	(condition-case nil
>>> 	    (if (eq (epg-context-protocol context) 'CMS)
>>> 		(setq user-id (epg-dn-from-string user-id))
>>> 	      (setq user-id (epg--decode-percent-escape user-id)))
>>> 	  (error))
>>>
>>> into
>>>
>>> 	(condition-case nil
>>> 	    (if (eq (epg-context-protocol context) 'CMS)
>>> 		(setq user-id (epg-dn-from-string user-id)))
>>> 	  (error))
>>> 	(setq user-id (epg--decode-percent-escape user-id))
>>>
>>> it works (provided http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36098 has been fixed first).  I do not think `epg--decode-percent-escape' can trigger `error' but it is protected everywhere it is used so maybe one should write
>>
>> Do you have an example here to display the bug?

You should see

[[S/MIME Signed Part:Good signature from D72B00C1DE9C6D57284FCEE40C40B1A22B2BBC5B /CN=Christophe Troestler/OU=Service d'Analyse Num%C3%A9rique/O=Universit%C3%A9 de Mons/L=Mons/C=BE (trust full)]]

while “Num%C3%A9rique/O=Universit%C3%A9” should be “Numérique/O=Université”.

Best,
C.
[smime.p7s (application/pkcs7-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36101; Package emacs. (Wed, 23 Oct 2019 08:52:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>
Cc: "36101 <at> debbugs.gnu.org" <36101 <at> debbugs.gnu.org>
Subject: Re: bug#36101: 26.1; epg--status-*SIG does not always precent decode
Date: Wed, 23 Oct 2019 10:51:21 +0200
Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be> writes:

> You should see
>
> [[S/MIME Signed Part:Good signature from
> D72B00C1DE9C6D57284FCEE40C40B1A22B2BBC5B /CN=Christophe
> Troestler/OU=Service d'Analyse Num%C3%A9rique/O=Universit%C3%A9 de
> Mons/L=Mons/C=BE (trust full)]]
>
> while “Num%C3%A9rique/O=Universit%C3%A9” should be “Numérique/O=Université”.

Thanks; with that test case I chased down the error to
epg-signature-to-string, which I've now fixed.

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




bug marked as fixed in version 27.1, send any further explanations to 36101 <at> debbugs.gnu.org and Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 23 Oct 2019 08:52:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36101; Package emacs. (Wed, 23 Oct 2019 11:01:01 GMT) Full text and rfc822 format available.

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

From: Christophe TROESTLER <Christophe.TROESTLER <at> umons.ac.be>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: "36101 <at> debbugs.gnu.org" <36101 <at> debbugs.gnu.org>
Subject: Re: bug#36101: 26.1; epg--status-*SIG does not always precent decode
Date: Wed, 23 Oct 2019 11:00:48 +0000
On 23 October 2019 at 10:51 CEST, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>
> […] I chased down the error to epg-signature-to-string, which I've now fixed.

Thanks.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 20 Nov 2019 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 207 days ago.

Previous Next


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