* mml2015.el (mml2015-function-alist): Clear verify and decrypt.
* mm-uu.el: Reorganized. Add gnatsweb, pgp-signed, pgp-encrypted.
+ * mm-decode.el (mm-snarf-option): New.
2000-11-04 13:08:02 ShengHuo ZHU <zsh@cs.rochester.edu>
(item :tag "ask" nil))
:group 'gnus-article)
+(defcustom mm-snarf-option nil
+ "Option of snarfing PGP key.
+`never', not snarf; `always', always snarf;
+`known', only snarf known protocols. Otherwise, ask user."
+ :type '(choice (item always)
+ (item never)
+ (item :tag "only known protocols" known)
+ (item :tag "ask" nil))
+ :group 'gnus-article)
+
(defvar mm-viewer-completion-map
(let ((map (make-sparse-keymap 'mm-viewer-completion-map)))
(set-keymap-parent map minibuffer-local-completion-map)
"^-----END PGP MESSAGE-----"
mm-uu-pgp-encrypted-extract
nil
- mm-uu-pgp-encrypted-test)))
+ mm-uu-pgp-encrypted-test)
+ (pgp-key
+ "^-----BEGIN PGP PUBLIC KEY BLOCK-----"
+ "^-----END PGP PUBLIC KEY BLOCK-----"
+ mm-uu-pgp-key-extract
+ nil
+ mm-uu-pgp-key-test)))
(defcustom mm-uu-configure-list nil
"A list of mm-uu configuration.
(mm-make-handle buf
'("text/plain" (charset . gnus-decoded)))))
+(defun mm-uu-pgp-key-test ()
+ (and
+ mml2015-use
+ (mml2015-clear-snarf-function)
+ (cond
+ ((eq mm-snarf-option 'never) nil)
+ ((eq mm-snarf-option 'always) t)
+ ((eq mm-snarf-option 'known) t)
+ (t (y-or-n-p "Snarf pgp signed part?")))))
+
+(defun mm-uu-pgp-key-extract ()
+ (let ((buf (mm-uu-copy-to-buffer start-point end-point)))
+ (with-current-buffer buf
+ (funcall (mml2015-clear-snarf-function)))
+ (mm-make-handle buf
+ '("application/x-pgp-key"))))
+
;;;### autoload
(defun mm-uu-dissect ()
"Dissect the current buffer and return a list of uu handles."
mml2015-mailcrypt-verify
mml2015-mailcrypt-decrypt
mml2015-mailcrypt-clear-verify
- mml2015-mailcrypt-clear-decrypt)
+ mml2015-mailcrypt-clear-decrypt
+ mml2015-mailcrypt-clear-snarf)
(gpg mml2015-gpg-sign
mml2015-gpg-encrypt
mml2015-gpg-verify
mml2015-gpg-decrypt
nil
- mml2015-gpg-clear-decrypt))
+ mml2015-gpg-clear-decrypt
+ nil))
"Alist of PGP/MIME functions.")
(defvar mml2015-result-buffer nil)
(autoload 'mc-pgp-always-sign "mailcrypt")
(autoload 'mc-encrypt-generic "mc-toplev")
(autoload 'mc-cleanup-recipient-headers "mc-toplev")
- (autoload 'mc-sign-generic "mc-toplev"))
+ (autoload 'mc-sign-generic "mc-toplev")
+ (autoload 'mc-snarf-keys "mc-toplev"))
(eval-when-compile
(defvar mc-default-scheme)
(defvar mml2015-decrypt-function 'mailcrypt-decrypt)
(defvar mml2015-verify-function 'mailcrypt-verify)
+(defvar mml2015-snarf-function 'mc-snarf-keys)
(defun mml2015-mailcrypt-decrypt (handle ctl)
(let (child handles result)
(unless (funcall mml2015-verify-function)
(error "Verify error.")))
+(defun mml2015-mailcrypt-clear-snarf ()
+ (funcall mml2015-snarf-function))
+
(defun mml2015-mailcrypt-sign (cont)
(mc-sign-generic (message-options-get 'message-sender)
nil nil nil nil)
(gnus-get-buffer-create "*MML2015 Result*"))
nil))
+(defsubst mml2015-clear-snarf-function ()
+ (nth 7 (assq mml2015-use mml2015-function-alist)))
+
(defsubst mml2015-clear-decrypt-function ()
(nth 6 (assq mml2015-use mml2015-function-alist)))