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)
;; error response from it. Set it here.
(unless (epg-context-result-for epg-context 'error)
(if (string-match "\\`exited abnormally with code \\(.*\\)\n" status)
- (epg-context-result-for
+ (epg-context-set-result-for
epg-context 'error
(list (cons 'exit (string-to-number (match-string 1 status)))))
- (epg-context-result-for epg-context 'error
+ (epg-context-set-result-for epg-context 'error
(list (cons 'signal status))))))))
(defun epg-read-output (context)
(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)))
+ (if (epg-context-result-for context 'sign)
+ (if (epg-context-result-for context 'error)
+ (message "Sign warning: %S"
+ (epg-context-result-for context 'error)))
+ (if (epg-context-result-for context 'error)
+ (error "Sign failed: %S"
+ (epg-context-result-for context 'error))
+ (error "Sign failed")))
(unless signature
(epg-read-output context)))
(unless 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)))
+ (if (epg-context-result-for context 'sign)
+ (if (epg-context-result-for context 'error)
+ (message "Sign warning: %S"
+ (epg-context-result-for context 'error)))
+ (if (epg-context-result-for context 'error)
+ (error "Sign failed: %S"
+ (epg-context-result-for context 'error))
+ (error "Sign failed")))
(epg-read-output context))
(epg-delete-output-file context)
(epg-reset context)))
(epg-start-encrypt context (epg-make-data-from-file plain)
recipients sign always-trust)
(epg-wait-for-completion context)
+ (if sign
+ (if (epg-context-result-for context 'sign)
+ (if (epg-context-result-for context 'error)
+ (message "Sign warning: %S"
+ (epg-context-result-for context 'error)))
+ (if (epg-context-result-for context 'error)
+ (error "Sign failed: %S"
+ (epg-context-result-for context 'error))
+ (error "Sign failed"))))
(if (epg-context-result-for context 'error)
(error "Encrypt failed: %S"
(epg-context-result-for context 'error)))
recipients sign always-trust)
(epg-flush context)
(epg-wait-for-completion context)
+ (if sign
+ (if (epg-context-result-for context 'sign)
+ (if (epg-context-result-for context 'error)
+ (message "Sign warning: %S"
+ (epg-context-result-for context 'error)))
+ (if (epg-context-result-for context 'error)
+ (error "Sign failed: %S"
+ (epg-context-result-for context 'error))
+ (error "Sign failed"))))
(if (epg-context-result-for context 'error)
(error "Encrypt failed: %S"
(epg-context-result-for context 'error)))