X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=epg.el;h=b32d57a64205ed5f928fe3bae83847df7db73db2;hb=7dd310a5477089fc298a838e5676fbed2892e282;hp=0deb04aa84c3b33ff792ca6e5139fe185ce9a42d;hpb=a128ab5a906aa28687814aea3073f32ab0427188;p=elisp%2Fepg.git diff --git a/epg.el b/epg.el index 0deb04a..b32d57a 100644 --- a/epg.el +++ b/epg.el @@ -485,7 +485,7 @@ This function is for internal use only." args))) (set-default-file-modes orig-mode)) (set-process-filter process #'epg-process-filter) - (set-process-filter process #'epg-process-sentinel) + (set-process-sentinel process #'epg-process-sentinel) (epg-context-set-process context process))) (defun epg-process-filter (process input) @@ -1235,9 +1235,9 @@ Otherwise, it makes a normal signature." (epg-make-temp-file "epg-output"))) (epg-start-sign context (epg-make-data-from-file plain) mode) (epg-wait-for-completion context) - (if (epg-context-result-for context 'error) - (error "Sign failed: %S" - (epg-context-result-for context 'error))) + (unless (epg-context-result-for context 'sign) + (error "Sign failed: %S" + (epg-context-result-for context 'error))) (unless signature (epg-read-output context))) (unless signature @@ -1257,9 +1257,9 @@ Otherwise, it makes a normal signature." (epg-start-sign context (epg-make-data-from-string plain) mode) (epg-flush context) (epg-wait-for-completion context) - (if (epg-context-result-for context 'error) - (error "Sign failed: %S" - (epg-context-result-for context 'error))) + (unless (epg-context-result-for context 'sign) + (error "Sign failed: %S" + (epg-context-result-for context 'error))) (epg-read-output context)) (epg-delete-output-file context) (epg-reset context))) @@ -1320,6 +1320,10 @@ If RECIPIENTS is nil, it performs symmetric encryption." (epg-start-encrypt context (epg-make-data-from-file plain) recipients sign always-trust) (epg-wait-for-completion context) + (if (and sign + (not (epg-context-result-for context 'sign))) + (error "Sign encrypt failed: %S" + (epg-context-result-for context 'error))) (if (epg-context-result-for context 'error) (error "Encrypt failed: %S" (epg-context-result-for context 'error))) @@ -1342,6 +1346,10 @@ If RECIPIENTS is nil, it performs symmetric encryption." recipients sign always-trust) (epg-flush context) (epg-wait-for-completion context) + (if (and sign + (not (epg-context-result-for context 'sign))) + (error "Sign encrypt failed: %S" + (epg-context-result-for context 'error))) (if (epg-context-result-for context 'error) (error "Encrypt failed: %S" (epg-context-result-for context 'error)))