(2 . "ZLIB")
(3 . "BZIP2")))
+(defconst epg-invalid-recipients-alist
+ '((0 . "No specific reason given")
+ (1 . "Not Found")
+ (2 . "Ambigious specification")
+ (3 . "Wrong key usage")
+ (4 . "Key revoked")
+ (5 . "Key expired")
+ (6 . "No CRL known")
+ (7 . "CRL too old")
+ (8 . "Policy mismatch")
+ (9 . "Not a secret key")
+ (10 . "Key not trusted")))
+
(defvar epg-key-validity-alist
'((?o . unknown)
(?i . invalid)
"Start `epg-gpg-program' in a subprocess with given ARGS."
(let* ((args (append (list "--no-tty"
"--status-fd" "1"
- "--command-fd" "0")
+ "--command-fd" "0"
+ "--yes")
(if (epg-context-armor context) '("--armor"))
(if (epg-context-textmode context) '("--textmode"))
(if (epg-context-output-file context)
(cons 'bad-armor
(epg-context-result-for epg-context 'error))))
+(defun epg-status-INV_RECP (process string)
+ (if (string-match "\\`\\([0-9]+\\) \\(.*\\)" string)
+ (epg-context-set-result-for
+ epg-context 'error
+ (cons (list 'invalid-recipient
+ (string-to-number (match-string 1 string))
+ (match-string 2 string))
+ (epg-context-result-for epg-context 'error)))))
+
+(defun epg-status-NO_RECP (process string)
+ (epg-context-set-result-for
+ epg-context 'error
+ (cons 'no-recipients
+ (epg-context-result-for epg-context 'error))))
+
(defun epg-passphrase-callback-function (key-id handback)
(read-passwd
(if (eq key-id 'SYM)
(epg-start-decrypt context (epg-make-data-from-file cipher))
(epg-wait-for-completion context)
(if (epg-context-result-for context 'error)
- (error "Decryption failed"))
+ (error "Decrypt failed: %S"
+ (epg-context-result-for context 'error)))
(unless plain
(epg-read-output context)))
(unless plain
(epg-start-decrypt context (epg-make-data-from-file input-file))
(epg-wait-for-completion context)
(if (epg-context-result-for context 'error)
- (error "Decryption failed"))
+ (error "Decrypt failed: %S"
+ (epg-context-result-for context 'error)))
(epg-read-output context))
(epg-delete-output-file context)
(if (file-exists-p input-file)
(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"))
+ (error "Sign failed: %S"
+ (epg-context-result-for context 'error)))
(unless signature
(epg-read-output context)))
(unless signature
(epg-start-sign context (epg-make-data-from-string plain) mode)
(epg-wait-for-completion context)
(if (epg-context-result-for context 'error)
- (error "Sign failed"))
+ (error "Sign failed: %S"
+ (epg-context-result-for context 'error)))
(epg-read-output context))
(epg-delete-output-file context)
(epg-reset context)))
recipients sign always-trust)
(epg-wait-for-completion context)
(if (epg-context-result-for context 'error)
- (error "Encrypt failed"))
+ (error "Encrypt failed: %S"
+ (epg-context-result-for context 'error)))
(unless cipher
(epg-read-output context)))
(unless cipher
recipients sign always-trust)
(epg-wait-for-completion context)
(if (epg-context-result-for context 'error)
- (error "Encrypt failed"))
+ (error "Encrypt failed: %S"
+ (epg-context-result-for context 'error)))
(epg-read-output context))
(epg-delete-output-file context)
(epg-reset context)))