(unless (setq child (mm-find-part-by-type
(cdr handle)
"application/octet-stream" nil t))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Corrupted")
+ (mm-sec-error 'gnus-info "Corrupted")
(throw 'error handle))
(with-temp-buffer
(mm-insert-part child)
(condition-case err
(funcall mml2015-decrypt-function)
(error
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details (mml2015-format-error err))
+ (mm-sec-error 'gnus-details (mml2015-format-error err))
nil)
(quit
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details "Quit.")
+ (mm-sec-error 'gnus-details "Quit.")
nil)))
(unless (car result)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Failed")
+ (mm-sec-error 'gnus-info "Failed")
(throw 'error handle))
(setq handles (mm-dissect-buffer t)))
(mm-destroy-parts handle)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info
+ (mm-sec-status
+ 'gnus-info
(concat "OK"
(let ((sig (with-current-buffer mml2015-result-buffer
(mml2015-gpg-extract-signature-details))))
(condition-case err
(funcall mml2015-decrypt-function)
(error
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details (mml2015-format-error err))
+ (mm-sec-error 'gnus-details (mml2015-format-error err))
nil)
(quit
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details "Quit.")
+ (mm-sec-error 'gnus-details "Quit.")
nil)))
(if (car result)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "OK")
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Failed"))))
+ (mm-sec-status 'gnus-info "OK")
+ (mm-sec-error 'gnus-info "Failed"))))
(defun mml2015-fix-micalg (alg)
(and alg
ctl 'protocol)
"application/pgp-signature")
t))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Corrupted")
+ (mm-sec-error 'gnus-info "Corrupted")
(throw 'error handle))
(with-temp-buffer
(insert "-----BEGIN PGP SIGNED MESSAGE-----\n")
(forward-line)))
(unless (setq part (mm-find-part-by-type
(cdr handle) "application/pgp-signature" nil t))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Corrupted")
+ (mm-sec-error 'gnus-info "Corrupted")
(throw 'error handle))
(save-restriction
(narrow-to-region (point) (point))
(prog1
(funcall mml2015-verify-function)
(if (get-buffer " *mailcrypt stderr temp")
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details
+ (mm-sec-error
+ 'gnus-details
(with-current-buffer " *mailcrypt stderr temp"
(buffer-string))))
(if (get-buffer " *mailcrypt stdout temp")
(if (get-buffer mc-gpg-debug-buffer)
(kill-buffer mc-gpg-debug-buffer)))
(error
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details (mml2015-format-error err))
+ (mm-sec-error 'gnus-details (mml2015-format-error err))
nil)
(quit
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details "Quit.")
+ (mm-sec-error 'gnus-details "Quit.")
nil))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Failed")
+ (mm-sec-error 'gnus-info "Failed")
(throw 'error handle))))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "OK")
+ (mm-sec-status 'gnus-info "OK")
handle)))
(defun mml2015-mailcrypt-clear-verify ()
(prog1
(funcall mml2015-verify-function)
(if (get-buffer " *mailcrypt stderr temp")
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details
+ (mm-sec-error
+ 'gnus-details
(with-current-buffer " *mailcrypt stderr temp"
(buffer-string))))
(if (get-buffer " *mailcrypt stdout temp")
(if (get-buffer mc-gpg-debug-buffer)
(kill-buffer mc-gpg-debug-buffer)))
(error
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details (mml2015-format-error err))
+ (mm-sec-error 'gnus-details (mml2015-format-error err))
nil)
(quit
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details "Quit.")
+ (mm-sec-error 'gnus-details "Quit.")
nil))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "OK")
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Failed")))
+ (mm-sec-status 'gnus-info "OK")
+ (mm-sec-error 'gnus-info "Failed")))
(mml2015-extract-cleartext-signature))
(defun mml2015-mailcrypt-sign (cont)
(unless (setq child (mm-find-part-by-type
(cdr handle)
"application/octet-stream" nil t))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Corrupted")
+ (mm-sec-error 'gnus-info "Corrupted")
(throw 'error handle))
(with-temp-buffer
(mm-insert-part child)
(setq decrypt-status
(with-current-buffer mml2015-result-buffer
(buffer-string)))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details
- decrypt-status))
+ (mm-sec-status 'gnus-details decrypt-status))
(error
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details (mml2015-format-error err))
+ (mm-sec-error 'gnus-details (mml2015-format-error err))
nil)
(quit
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details "Quit.")
+ (mm-sec-error 'gnus-details "Quit.")
nil))
(with-current-buffer pgg-output-buffer
(goto-char (point-min))
(replace-match "\n" t t))
(setq handles (mm-dissect-buffer t))
(mm-destroy-parts handle)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "OK")
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details
- (concat decrypt-status
- (when (stringp (car handles))
- "\n" (mm-handle-multipart-ctl-parameter
- handles 'gnus-details))))
+ (mm-sec-status 'gnus-info "OK"
+ 'gnus-details
+ (concat decrypt-status
+ (when (stringp (car handles))
+ "\n" (mm-handle-multipart-ctl-parameter
+ handles 'gnus-details))))
(if (listp (car handles))
handles
(list handles)))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Failed")
+ (mm-sec-error 'gnus-info "Failed")
(throw 'error handle))))))
(defun mml2015-pgg-clear-decrypt ()
(let ((pgg-errors-buffer mml2015-result-buffer))
(if (prog1
(pgg-decrypt-region (point-min) (point-max))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details
+ (mm-sec-status
+ 'gnus-details
(with-current-buffer mml2015-result-buffer
(buffer-string))))
(progn
(goto-char (point-min))
(while (search-forward "\r\n" nil t)
(replace-match "\n" t t))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "OK"))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Failed"))))
+ (mm-sec-status 'gnus-info "OK"))
+ (mm-sec-error 'gnus-info "Failed"))))
(defun mml2015-pgg-verify (handle ctl)
(let ((pgg-errors-buffer mml2015-result-buffer)
ctl 'protocol)
"application/pgp-signature")
t)))
- (null (setq signature (mm-find-part-by-type
- (cdr handle) "application/pgp-signature" nil t))))
+ (null (setq signature
+ (mm-find-part-by-type
+ (cdr handle) "application/pgp-signature" nil t))))
(progn
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Corrupted")
+ (mm-sec-error 'gnus-info "Corrupted")
handle)
(with-temp-buffer
(insert part)
(goto-char (point-min))
(while (search-forward "\r\n" nil t)
(replace-match "\n" t t))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details
+ (mm-sec-status
+ 'gnus-details
(concat (with-current-buffer pgg-output-buffer
(buffer-string))
(with-current-buffer pgg-errors-buffer
(buffer-string)))))
(error
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details (mml2015-format-error err))
+ (mm-sec-error 'gnus-details (mml2015-format-error err))
nil)
(quit
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details "Quit.")
+ (mm-sec-error 'gnus-details "Quit.")
nil))
(progn
(delete-file signature-file)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info
+ (mm-sec-error
+ 'gnus-info
(with-current-buffer pgg-errors-buffer
(mml2015-gpg-extract-signature-details))))
(delete-file signature-file)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Failed")))))
+ (mm-sec-error 'gnus-info "Failed")))))
handle)
(defun mml2015-pgg-clear-verify ()
(goto-char (point-min))
(while (search-forward "\r\n" nil t)
(replace-match "\n" t t))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details
+ (mm-sec-status
+ 'gnus-details
(concat (with-current-buffer pgg-output-buffer
(buffer-string))
(with-current-buffer pgg-errors-buffer
(buffer-string)))))
(error
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details (mml2015-format-error err))
+ (mm-sec-error 'gnus-details (mml2015-format-error err))
nil)
(quit
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details "Quit.")
+ (mm-sec-error 'gnus-details "Quit.")
nil))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info
+ (mm-sec-status
+ 'gnus-info
(with-current-buffer pgg-errors-buffer
(mml2015-gpg-extract-signature-details)))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Failed")))
+ (mm-sec-error 'gnus-info "Failed")))
(mml2015-extract-cleartext-signature))
(defun mml2015-pgg-sign (cont)
(unless (setq child (mm-find-part-by-type
(cdr handle)
"application/octet-stream" nil t))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Corrupted")
+ (mm-sec-error 'gnus-info "Corrupted")
(throw 'error handle))
(setq context (epg-make-context))
(if (or mml2015-cache-passphrase mml-secure-cache-passphrase)
mml-secure-secret-key-id-list nil)
(error
(mml-secure-clear-secret-key-id-list)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Failed")
+ (mm-sec-error 'gnus-info "Failed")
(if (eq (car error) 'quit)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details "Quit.")
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details (mml2015-format-error error)))
+ (mm-sec-status 'gnus-details "Quit.")
+ (mm-sec-status 'gnus-details (mml2015-format-error error)))
(throw 'error handle)))
(with-temp-buffer
(insert plain)
(setq handles (mm-dissect-buffer t))
(mm-destroy-parts handle)
(if (epg-context-result-for context 'verify)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info
+ (mm-sec-status
+ 'gnus-info
(concat "OK\n"
(mml2015-epg-verify-result-to-string
(epg-context-result-for context 'verify))))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "OK"))
+ (mm-sec-status 'gnus-info "OK"))
(if (stringp (car handles))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details
+ (mm-sec-status
+ 'gnus-details
(mm-handle-multipart-ctl-parameter handles 'gnus-details))))
(if (listp (car handles))
handles
mml-secure-secret-key-id-list nil)
(error
(mml-secure-clear-secret-key-id-list)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Failed")
+ (mm-sec-error 'gnus-info "Failed")
(if (eq (car error) 'quit)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details "Quit.")
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details (mml2015-format-error error)))))
+ (mm-sec-status 'gnus-details "Quit.")
+ (mm-sec-status 'gnus-details (mml2015-format-error error)))))
(when plain
(erase-buffer)
;; Treat data which epg returns as a unibyte string.
(goto-char (point-min))
(while (search-forward "\r\n" nil t)
(replace-match "\n" t t))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "OK")
+ (mm-sec-status 'gnus-info "OK")
(if (epg-context-result-for context 'verify)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details
+ (mm-sec-status
+ 'gnus-details
(mml2015-epg-verify-result-to-string
(epg-context-result-for context 'verify)))))))
(null (setq signature (mm-find-part-by-type
(cdr handle) "application/pgp-signature"
nil t))))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Corrupted")
+ (mm-sec-error 'gnus-info "Corrupted")
(throw 'error handle))
(setq part (replace-regexp-in-string "\n" "\r\n" part)
signature (mm-get-part signature)
(condition-case error
(setq plain (epg-verify-string context signature part))
(error
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Failed")
+ (mm-sec-error 'gnus-info "Failed")
(if (eq (car error) 'quit)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details "Quit.")
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details (mml2015-format-error error)))
+ (mm-sec-status 'gnus-details "Quit.")
+ (mm-sec-status 'gnus-details (mml2015-format-error error)))
(throw 'error handle)))
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info
+ (mm-sec-status 'gnus-info
(mml2015-epg-verify-result-to-string
(epg-context-result-for context 'verify)))
handle)))
(condition-case error
(setq plain (epg-verify-string context signature))
(error
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info "Failed")
+ (mm-sec-error 'gnus-info "Failed")
(if (eq (car error) 'quit)
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details "Quit.")
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-details (mml2015-format-error error)))))
+ (mm-sec-status 'gnus-details "Quit.")
+ (mm-sec-status 'gnus-details (mml2015-format-error error)))))
(if plain
(progn
- (mm-set-handle-multipart-parameter
- mm-security-handle 'gnus-info
+ (mm-sec-status
+ 'gnus-info
(mml2015-epg-verify-result-to-string
(epg-context-result-for context 'verify)))
(delete-region (point-min) (point-max))