emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8c4cb2f 1/2: Fix problems with non-ASCII non-encoded PGP names


From: Lars Ingebrigtsen
Subject: master 8c4cb2f 1/2: Fix problems with non-ASCII non-encoded PGP names
Date: Tue, 21 Sep 2021 01:16:50 -0400 (EDT)

branch: master
commit 8c4cb2fe069ff1bc1ab8b2166e2d6dbafe96048c
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/epg.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/epg.el b/lisp/epg.el
index a461afa..1d37cbc 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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]