From: yamaoka Date: Tue, 13 Nov 2001 00:03:45 +0000 (+0000) Subject: Synch with Oort Gnus. X-Git-Tag: t-gnus-6_15_4-08-quimby-last-~14 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6fa691b4d93b80db6fddbd6a98d543889a2ba9e;p=elisp%2Fgnus.git- Synch with Oort Gnus. --- diff --git a/GNUS-NEWS b/GNUS-NEWS index 50ff9b9..8c8c7bc 100644 --- a/GNUS-NEWS +++ b/GNUS-NEWS @@ -51,7 +51,8 @@ variables should change those regexps accordingly. For example: ("^han\\>" euc-kr) -> ("\\(^\\|:\\)han\\>" euc-kr) -** Gnus now supports PGP-MIME (RFC2015) and SMIME. +** Gnus now supports PGP (RFC 1991), PGP-MIME (RFC 2015/3156) and +SMIME. ** Gnus inlines external parts (message/external). diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 17a7a9e..4fbe112 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,30 @@ +2001-11-12 Simon Josefsson + + * mml1991.el (mml1991-use, mml1991-function-alist): New variables. + (mml1991-gpg-sign, mml1991-gpg-encrypt): Renamed, from + `mml1991-sign' and `mml1991-encrypt'. + (mml1991-encrypt, mml1991-sign): New glue functions. + (mml1991-mailcrypt-sign, mml1991-mailcrypt-encrypt): New functions. + + * mml.el (mml-mode-map): `C-c RET o' map for PGP. + (mml-menu): Add PGP to menu. + + * mml-sec.el (top-level): Require mml1991. Don't require smime. + (mml-sign-alist, mml-encrypt-alist): Add "pgp". + (mml-pgp-sign-buffer, mml-pgp-encrypt-buffer) + (mml-secure-sign-pgp, mml-secure-encrypt-pgp): New glue functions. + + * mml2015.el: Mention RFC 3156. + + * mml1991.el: New file. From Sascha L,A|(Bdecke . + +2001-11-12 13:00:00 ShengHuo ZHU + + * gnus-start.el (gnus-auto-subscribed-groups): Use ^nnml. + + * gnus-sum.el (gnus-summary-move-article): Use number-to-string. + From + 2001-11-11 Simon Josefsson * message.el (top-level): Autoload sha1. diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index 4f489e4..70e5f46 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -311,7 +311,7 @@ hierarchy in its entirety." :type 'boolean) (defcustom gnus-auto-subscribed-groups - "nnml\\|^nnfolder\\|^nnmbox\\|^nnmh\\|^nnbabyl" + "^nnml\\|^nnfolder\\|^nnmbox\\|^nnmh\\|^nnbabyl" "*All new groups that match this regexp will be subscribed automatically. Note that this variable only deals with new groups. It has no effect whatsoever on old groups. diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index d515562..d29328b 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -8225,7 +8225,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'." (mail-header-xref (gnus-summary-article-header article)) " "))) (setq new-xref (concat (gnus-group-real-name gnus-newsgroup-name) - ":" article)) + ":" (number-to-string article))) (unless xref (setq xref (list (system-name)))) (setq new-xref @@ -8242,7 +8242,8 @@ ACTION can be either `move' (the default), `crosspost' or `copy'." (gnus-request-accept-article to-newsgroup select-method (not articles)))) (setq new-xref (concat new-xref " " (car art-group) - ":" (cdr art-group))) + ":" + (number-to-string (cdr art-group)))) ;; Now we have the new Xrefs header, so we insert ;; it and replace the new article. (nnheader-replace-header "Xref" new-xref) diff --git a/lisp/mml-sec.el b/lisp/mml-sec.el index fbd92c7..3d30602 100644 --- a/lisp/mml-sec.el +++ b/lisp/mml-sec.el @@ -23,13 +23,14 @@ ;;; Code: -(require 'smime) (require 'mml2015) +(require 'mml1991) (require 'mml-smime) (eval-when-compile (require 'cl)) (defvar mml-sign-alist '(("smime" mml-smime-sign-buffer mml-smime-sign-query) + ("pgp" mml-pgp-sign-buffer list) ("pgpmime" mml-pgpmime-sign-buffer list)) "Alist of MIME signer functions.") @@ -38,6 +39,7 @@ (defvar mml-encrypt-alist '(("smime" mml-smime-encrypt-buffer mml-smime-encrypt-query) + ("pgp" mml-pgp-encrypt-buffer list) ("pgpmime" mml-pgpmime-encrypt-buffer list)) "Alist of MIME encryption functions.") @@ -54,6 +56,14 @@ (or (mml-smime-encrypt cont) (error "Encryption failed... inspect message logs for errors"))) +(defun mml-pgp-sign-buffer (cont) + (or (mml1991-sign cont) + (error "Signing failed... inspect message logs for errors"))) + +(defun mml-pgp-encrypt-buffer (cont) + (or (mml1991-encrypt cont) + (error "Encryption failed... inspect message logs for errors"))) + (defun mml-pgpmime-sign-buffer (cont) (or (mml2015-sign cont) (error "Signing failed... inspect message logs for errors"))) @@ -87,6 +97,11 @@ (cons method tags)))) (t (error "The message is corrupted. No mail header separator")))))) +(defun mml-secure-sign-pgp () + "Add MML tags to PGP sign this MML part." + (interactive) + (mml-secure-part "pgp" 'sign)) + (defun mml-secure-sign-pgpmime () "Add MML tags to PGP/MIME sign this MML part." (interactive) @@ -97,6 +112,11 @@ (interactive) (mml-secure-part "smime" 'sign)) +(defun mml-secure-encrypt-pgp () + "Add MML tags to PGP encrypt this MML part." + (interactive) + (mml-secure-part "pgp")) + (defun mml-secure-encrypt-pgpmime () "Add MML tags to PGP/MIME encrypt this MML part." (interactive) diff --git a/lisp/mml.el b/lisp/mml.el index 71abcda..fba7fe8 100644 --- a/lisp/mml.el +++ b/lisp/mml.el @@ -705,8 +705,10 @@ If HANDLES is non-nil, use it instead reparsing the buffer." (map (make-sparse-keymap)) (main (make-sparse-keymap))) (define-key sign "p" 'mml-secure-sign-pgpmime) + (define-key sign "o" 'mml-secure-sign-pgp) (define-key sign "s" 'mml-secure-sign-smime) (define-key encrypt "p" 'mml-secure-encrypt-pgpmime) + (define-key encrypt "o" 'mml-secure-encrypt-pgp) (define-key encrypt "s" 'mml-secure-encrypt-smime) (define-key map "f" 'mml-attach-file) (define-key map "b" 'mml-attach-buffer) @@ -734,6 +736,8 @@ If HANDLES is non-nil, use it instead reparsing the buffer." ["Insert Multipart" mml-insert-multipart t] ["PGP/MIME Sign" mml-secure-sign-pgpmime t] ["PGP/MIME Encrypt" mml-secure-encrypt-pgpmime t] + ["PGP Sign" mml-secure-sign-pgp t] + ["PGP Encrypt" mml-secure-encrypt-pgp t] ["S/MIME Sign" mml-secure-sign-smime t] ["S/MIME Encrypt" mml-secure-encrypt-smime t] ;;["Narrow" mml-narrow-to-part t] diff --git a/lisp/mml1991.el b/lisp/mml1991.el new file mode 100644 index 0000000..5eb0926 --- /dev/null +++ b/lisp/mml1991.el @@ -0,0 +1,213 @@ +;;; mml-gpg-old.el --- Old PGP message format (RFC 1991) support for MML +;; Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + +;; Author: Sascha Lüdecke , +;; Simon Josefsson (Mailcrypt interface, Gnus glue) +;; Keywords PGP + +;; This file is (not yet) part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; RCS: $Id: mml1991.el,v 1.1.2.1 2001-11-13 00:03:29 yamaoka Exp $ + +;;; Code: + +(defvar mml1991-use mml2015-use + "The package used for PGP.") + +(defvar mml1991-function-alist + '((mailcrypt mml1991-mailcrypt-sign + mml1991-mailcrypt-encrypt) + (gpg mml1991-gpg-sign + mml1991-gpg-encrypt)) + "Alist of PGP/MIME functions.") + +;;; mailcrypt wrapper + +(eval-and-compile + (autoload 'mc-sign-generic "mc-toplev")) + +(defvar mml1991-decrypt-function 'mailcrypt-decrypt) +(defvar mml1991-verify-function 'mailcrypt-verify) + +(defun mml1991-mailcrypt-sign (cont) + (let ((text (current-buffer)) + headers signature + (result-buffer (get-buffer-create "*GPG Result*"))) + ;; Save MIME Content[^ ]+: headers from signing + (goto-char (point-min)) + (while (looking-at "^Content[^ ]+:") (forward-line)) + (if (> (point) (point-min)) + (progn + (setq headers (buffer-substring (point-min) (point))) + (kill-region (point-min) (point)))) + (goto-char (point-max)) + (unless (bolp) + (insert "\n")) + (quoted-printable-decode-region (point-min) (point-max)) + (with-temp-buffer + (setq signature (current-buffer)) + (insert-buffer text) + (unless (mc-sign-generic (message-options-get 'message-sender) + nil nil nil nil) + (unless (> (point-max) (point-min)) + (pop-to-buffer result-buffer) + (error "Sign error"))) + (goto-char (point-min)) + (while (re-search-forward "\r+$" nil t) + (replace-match "" t t)) + (quoted-printable-encode-region (point-min) (point-max)) + (set-buffer text) + (kill-region (point-min) (point-max)) + (if headers (insert headers)) + (insert "\n") + (insert-buffer signature) + (goto-char (point-max))))) + +(defun mml1991-mailcrypt-encrypt (cont) + (let ((text (current-buffer)) + cipher + (result-buffer (get-buffer-create "*GPG Result*"))) + ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED + (goto-char (point-min)) + (while (looking-at "^Content[^ ]+:") (forward-line)) + (if (> (point) (point-min)) + (progn + (kill-region (point-min) (point)))) + (mm-with-unibyte-current-buffer-mule4 + (with-temp-buffer + (setq cipher (current-buffer)) + (insert-buffer text) + (unless (mc-encrypt-generic + (or + (message-options-get 'message-recipients) + (message-options-set 'message-recipients + (read-string "Recipients: "))) + nil + (point-min) (point-max) + (message-options-get 'message-sender) + 'sign) + (unless (> (point-max) (point-min)) + (pop-to-buffer result-buffer) + (error "Encrypt error"))) + (goto-char (point-min)) + (while (re-search-forward "\r+$" nil t) + (replace-match "" t t)) + (set-buffer text) + (kill-region (point-min) (point-max)) + ;;(insert "Content-Type: application/pgp-encrypted\n\n") + ;;(insert "Version: 1\n\n") + (insert "\n") + (insert-buffer cipher) + (goto-char (point-max)))))) + +;;; gpg wrapper + +(eval-and-compile + (autoload 'gpg-sign-cleartext "gpg")) + +(defun mml1991-gpg-sign (cont) + (let ((text (current-buffer)) + headers signature + (result-buffer (get-buffer-create "*GPG Result*"))) + ;; Save MIME Content[^ ]+: headers from signing + (goto-char (point-min)) + (while (looking-at "^Content[^ ]+:") (forward-line)) + (if (> (point) (point-min)) + (progn + (setq headers (buffer-substring (point-min) (point))) + (kill-region (point-min) (point)))) + (goto-char (point-max)) + (unless (bolp) + (insert "\n")) + (quoted-printable-decode-region (point-min) (point-max)) + (with-temp-buffer + (unless (gpg-sign-cleartext text (setq signature (current-buffer)) + result-buffer + nil + (message-options-get 'message-sender)) + (unless (> (point-max) (point-min)) + (pop-to-buffer result-buffer) + (error "Sign error"))) + (goto-char (point-min)) + (while (re-search-forward "\r+$" nil t) + (replace-match "" t t)) + (quoted-printable-encode-region (point-min) (point-max)) + (set-buffer text) + (kill-region (point-min) (point-max)) + (if headers (insert headers)) + (insert "\n") + (insert-buffer signature) + (goto-char (point-max))))) + +(defun mml1991-gpg-encrypt (cont) + (let ((text (current-buffer)) + cipher + (result-buffer (get-buffer-create "*GPG Result*"))) + ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED + (goto-char (point-min)) + (while (looking-at "^Content[^ ]+:") (forward-line)) + (if (> (point) (point-min)) + (progn + (kill-region (point-min) (point)))) + (mm-with-unibyte-current-buffer-mule4 + (with-temp-buffer + (unless (gpg-sign-encrypt + text (setq cipher (current-buffer)) + result-buffer + (split-string + (or + (message-options-get 'message-recipients) + (message-options-set 'message-recipients + (read-string "Recipients: "))) + "[ \f\t\n\r\v,]+") + nil + (message-options-get 'message-sender) + t t) ; armor & textmode + (unless (> (point-max) (point-min)) + (pop-to-buffer result-buffer) + (error "Encrypt error"))) + (goto-char (point-min)) + (while (re-search-forward "\r+$" nil t) + (replace-match "" t t)) + (set-buffer text) + (kill-region (point-min) (point-max)) + ;;(insert "Content-Type: application/pgp-encrypted\n\n") + ;;(insert "Version: 1\n\n") + (insert "\n") + (insert-buffer cipher) + (goto-char (point-max)))))) + +;;;###autoload +(defun mml1991-encrypt (cont) + (let ((func (nth 2 (assq mml1991-use mml1991-function-alist)))) + (if func + (funcall func cont) + (error "Cannot find encrypt function")))) + +;;;###autoload +(defun mml1991-sign (cont) + (let ((func (nth 1 (assq mml1991-use mml1991-function-alist)))) + (if func + (funcall func cont) + (error "Cannot find sign function")))) + +(provide 'mml1991) + +;;; mml1991.el ends here diff --git a/lisp/mml2015.el b/lisp/mml2015.el index f547cd1..4654ae4 100644 --- a/lisp/mml2015.el +++ b/lisp/mml2015.el @@ -23,6 +23,9 @@ ;;; Commentary: +;; RFC 2015 is updated by RFC 3156, this file should be compatible +;; with both. + ;;; Code: (eval-when-compile (require 'cl)) diff --git a/texi/ChangeLog b/texi/ChangeLog index abd3f70..6d69d77 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,9 @@ +2001-11-12 Simon Josefsson + + * gnus.texi (Security, Using GPG): + * message.texi (Security): + * emacs-mime.texi (MML Definition): Add PGP. + 2001-11-09 Kai Gro,A_(Bjohann * message.texi (Movement): message-beginning-of-line. diff --git a/texi/emacs-mime.texi b/texi/emacs-mime.texi index d2bed12..6039ff8 100644 --- a/texi/emacs-mime.texi +++ b/texi/emacs-mime.texi @@ -1203,12 +1203,12 @@ RFC822 date when the part was read (@code{Content-Disposition}). The size (in octets) of the part (@code{Content-Disposition}). @item sign -What technology to sign this MML part with (@code{smime} or -@code{pgpmime}) +What technology to sign this MML part with (@code{smime}, @code{pgp} +or @code{pgpmime}) @item encrypt -What technology to encrypt this MML part with (@code{smime} or -@code{pgpmime}) +What technology to encrypt this MML part with (@code{smime}, +@code{pgp} or @code{pgpmime}) @end table diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index fab2b69..5e8b9b7 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -9177,8 +9177,9 @@ Gnus $B$K$$$D$G$b@5$7$$(B @code{Xref} $B$r