Subject: Re: bug#36101: 26.1; epg--status-*SIG does not always precent decode

From: Christophe TROESTLER <[email-masked]>
Date: Wed, 23 Oct 2019 08:27:15 +0000

On 23 October 2019 at 10:25 CEST, Christophe TROESTLER <[email-masked]> wrote:
>
> On 22 October 2019 at 16:49 CEST, Lars Ingebrigtsen <[email-masked]> wrote:
>>
>> Christophe TROESTLER <[email-masked]> 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.