]> git.eshelyaron.com Git - emacs.git/commitdiff
Signal an error in the user clicks "cancel" when signing in epg
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 2 Aug 2020 09:32:35 +0000 (11:32 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 2 Aug 2020 09:32:35 +0000 (11:32 +0200)
* lisp/epg.el (epg-sign-string): If the user clicks "cancel" on
the pinentry, then we don't have an error from gpg(sm), but
instead nothing (bug#39058).  Signal an error in that case.

lisp/epg.el

index 222fd913e1747725e41d050b74d0d0f20f996437..5b90bc290abdd3efca1aecf4fb06511cf43ea003 100644 (file)
@@ -1683,7 +1683,8 @@ Otherwise, it makes a cleartext signature."
            (if (epg-context-result-for context 'error)
                (let ((errors (epg-context-result-for context 'error)))
                  (signal 'epg-error
-                         (list "Sign failed" (epg-errors-to-string errors))))))
+                         (list "Sign failed" (epg-errors-to-string errors))))
+              (signal 'epg-error '("Signing failed (unknown reason)"))))
          (epg-read-output context))
       (epg-delete-output-file context)
       (if input-file