From: Lars Ingebrigtsen Date: Tue, 21 Sep 2021 05:12:35 +0000 (+0200) Subject: Fix problems with non-ASCII non-encoded PGP names X-Git-Tag: emacs-28.0.90~798 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8c4cb2fe069ff1bc1ab8b2166e2d6dbafe96048c;p=emacs.git Fix problems with non-ASCII non-encoded PGP names * lisp/epg.el (epg-signature-to-string): User IDs may be non-encoded, non-ASCII (bug#50706). --- diff --git a/lisp/epg.el b/lisp/epg.el index a461afac34b..1d37cbcfb57 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -433,7 +433,11 @@ callback data (if any)." (and user-id (concat " " (if (stringp user-id) - (rfc6068-unhexify-string user-id) + (if (= (length user-id) (string-bytes user-id)) + ;; This is ASCII, possibly %-encoded. + (rfc6068-unhexify-string user-id) + ;; Non-ASCII, return as is. + user-id) (epg-decode-dn user-id)))) (and (epg-signature-validity signature) (format " (trust %s)" (epg-signature-validity signature)))