+2000-02-07 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * mime-pgp.el: Fix doc string.
+ * pgg-def.el: Ditto.
+ * pgg-gpg.el: Ditto.
+ * pgg-parse.el: Ditto.
+ * pgg-pgp.el: Ditto.
+ * pgg-pgp5.el: Ditto.
+ * pgg.el: Ditto.
+
2000-02-02 Daiki Ueno <ueno@ueda.info.waseda.ac.jp>
* pgg.el (pgg-temp-buffer-show-function): Don't check if the
\f
1999-08-18 MORIOKA Tomohiko <tomo@m17n.org>
- * REMI: Version 1.13.2 (\e-DÒike-Ikoinomori)\e-A released.
+ * REMI: Version 1.13.2 (\e-D\ eR\ fike-Ikoinomori) released.
1999-08-17 Katsumi Yamaoka <yamaoka@jpl.org>
\f
1999-07-27 MORIOKA Tomohiko <tomo@m17n.org>
- * SEMI: Version 1.13.5 (Meih\e-Dò)\e-A released.
+ * SEMI: Version 1.13.5 (Meih\e-D\ er\ f) released.
1999-07-27 MORIOKA Tomohiko <tomo@m17n.org>
\f
1999-01-21 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * SEMI: Version 1.13.0 (Matt\e-Dò)\e-A released.
+ * SEMI: Version 1.13.0 (Matt\e-D\ er\ f) released.
1999-01-21 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-07-08 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * REMI: Version 1.8.3 (Ecch\e-Dþ-Nakagawa)\e-A released.
+ * REMI: Version 1.8.3 (Ecch\e-D\ e~\ f-Nakagawa) released.
* mime-play.el (mime-delq-null-situation): Add new optional
argument `ignored-value'.
\f
1998-07-08 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * REMI: Version 1.8.2 (N\e-Dòmachi)\e-A released.
+ * REMI: Version 1.8.2 (N\e-D\ er\ fmachi) released.
1998-07-07 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-06-28 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * REMI: Version 1.8.0 (Ecch\e-Dþ-Kokubu)\e-A released.
+ * REMI: Version 1.8.0 (Ecch\e-D\ e~\ f-Kokubu) released.
1998-06-26 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-06-04 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * SEMI: Version 1.5.0 (Nishi-Ny\e-Dþzen)\e-A released.
+ * SEMI: Version 1.5.0 (Nishi-Ny\e-D\ e~\ fzen) released.
* README.en (Required environment): Modify for FLIM 1.3.0.
\f
1998-06-01 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * SEMI: Version 1.4.6 (Ny\e-Dþzen)\e-A released.
+ * SEMI: Version 1.4.6 (Ny\e-D\ e~\ fzen) released.
1998-05-28 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-05-15 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * SEMI: Version 1.4.4 (Ecch\e-Dþ-Miyazaki)\e-A released.
+ * SEMI: Version 1.4.4 (Ecch\e-D\ e~\ f-Miyazaki) released.
* mime-play.el (mime-mailcap-method-filename-alist): New variable.
(mime-mailcap-method-sentinel): New function.
\f
1998-05-06 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * SEMI: Version 1.4.1 (\e-DÒmi)\e-A released.
+ * SEMI: Version 1.4.1 (\e-D\ eR\ fmi) released.
* README.en (Required environment): Modify for FLIM 1.2.0.
\f
1998-04-25 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * SEMI: Version 1.3.2 (N\e-Dò)\e-A was released.
+ * SEMI: Version 1.3.2 (N\e-D\ er\ f) was released.
* mime-edit.el (mime-edit-mode-entity-prefix): New variable.
(mime-edit-mode-entity-map): New variable.
\f
1998-03-13 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * SEMI: Version 1.0.2 (Nonoichi-K\e-Dòdaimae)\e-A was released.
+ * SEMI: Version 1.0.2 (Nonoichi-K\e-D\ er\ fdaimae) was released.
1998-03-12 MORIOKA Tomohiko <morioka@jaist.ac.jp>
* mime-file.el: Rename `mime-article/extract-file' ->
`mime-extract-current-entity'.
-1998-03-03 François Pinard <pinard@iro.umontreal.ca>
+1998-03-03 Fran\e-A\ eg\ fois Pinard <pinard@iro.umontreal.ca>
* mime-edit.el (mime-edit-insert-signature): Function
`mime-edit-insert-tag' is sometimes called with more arguments
\f
1998-02-25 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * SEMI: Version 1.0.0 (Nukaj\e-Dþtaku-mae)\e-A was released.
+ * SEMI: Version 1.0.0 (Nukaj\e-D\ e~\ ftaku-mae) was released.
* SEMI-ELS: Remove mime-tar.el.
\f
1997-11-16 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * SEMI: Version 0.116 (D\e-Dòhòji)\e-A was released.
+ * SEMI: Version 0.116 (D\e-D\ er\ fh\ er\ fji) was released.
1997-11-15 MORIOKA Tomohiko <morioka@jaist.ac.jp>
* mime-view.el, mime-pgp.el, mime-partial.el: Rename
`mime::article/content-info' -> `mime-raw-content-info'.
-1997-11-11 François Pinard <pinard@iro.umontreal.ca>
+1997-11-11 Fran\e-A\ eg\ fois Pinard <pinard@iro.umontreal.ca>
* mime-edit.el: Modify space in prompt and removespurious trailing
spaces in the files. (cf. [tm-en:1507])
-;;; mime-pgp.el --- mime-view internal methods foro PGP.
+;;; mime-pgp.el --- mime-view internal methods for PGP.
;; Copyright (C) 1995,1996,1997,1998,1999 MORIOKA Tomohiko
:group 'mime)
(defcustom pgg-default-scheme 'gpg
- "Default PGP scheme"
- :group 'symbol
- :type 'string)
+ "Default PGP scheme."
+ :group 'pgg
+ :type '(choice (const :tag "GnuPG" gpg)
+ (const :tag "PGP 5" pgp5)
+ (const :tag "PGP" pgp)))
(defcustom pgg-default-user-id (user-login-name)
"User ID of your default identity."
:type 'string)
(defcustom pgg-encrypt-for-me nil
- "Encrypt all outgoing messages with user's public key."
+ "If t, encrypt all outgoing messages with user's public key."
:group 'pgg
:type 'boolean)
(defcustom pgg-cache-passphrase t
- "Cache passphrase"
+ "If t, cache passphrase."
:group 'pgg
:type 'boolean)
(defvar pgg-echo-buffer "*PGG-echo*")
(defvar pgg-scheme nil
- "Current scheme of PGP implementation")
+ "Current scheme of PGP implementation.")
(defmacro pgg-truncate-key-identifier (key)
`(if (> (length ,key) 8) (substring ,key 8) ,key))
:type 'string)
(defcustom pgg-gpg-shell-file-name "/bin/sh"
- "File name to load inferior shells from. Bourne shell or its equivalent
-\(not tcsh) is needed for \"2>\"."
+ "File name to load inferior shells from.
+Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
:group 'pgg-gpg
:type 'string)
(defun pgg-gpg-process-region (start end passphrase program args)
(let* ((errors-file-name
- (concat temporary-file-directory
+ (concat temporary-file-directory
(make-temp-name "pgg-errors")))
(status-file-name
- (concat temporary-file-directory
+ (concat temporary-file-directory
(make-temp-name "pgg-status")))
- (args
+ (args
(append
`("--status-fd" "3"
,@(if passphrase '("--passphrase-fd" "0"))
(luna-define-method pgg-scheme-lookup-key ((scheme pgg-scheme-gpg)
string &optional type)
- (let ((args (list "--with-colons" "--no-greeting" "--batch"
+ (let ((args (list "--with-colons" "--no-greeting" "--batch"
(if type "--list-secret-keys" "--list-keys")
string)))
(with-current-buffer (get-buffer-create pgg-output-buffer)
(apply #'call-process pgg-gpg-program nil t nil args)
(goto-char (point-min))
(when (re-search-forward "^\\(sec\\|pub\\):" nil t)
- (substring
- (nth 3 (split-string
+ (substring
+ (nth 3 (split-string
(buffer-substring (match-end 0)
(progn (end-of-line)(point)))
":"))
8)))))
-(luna-define-method pgg-scheme-encrypt-region ((scheme pgg-scheme-gpg)
+(luna-define-method pgg-scheme-encrypt-region ((scheme pgg-scheme-gpg)
start end recipients)
(let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id))
- (args
+ (args
`("--batch" "--armor" "--always-trust" "--encrypt"
,@(if recipients
- (apply #'append
- (mapcar (lambda (rcpt)
- (list "--remote-user"
- (concat "\"" rcpt "\"")))
+ (apply #'append
+ (mapcar (lambda (rcpt)
+ (list "--remote-user"
+ (concat "\"" rcpt "\"")))
(append recipients
(if pgg-encrypt-for-me
(list pgg-gpg-user-id)))))))))
(pgg-process-when-success
(pgg-convert-lbt-region (point-min)(point-max) 'LF))))
-(luna-define-method pgg-scheme-decrypt-region ((scheme pgg-scheme-gpg)
+(luna-define-method pgg-scheme-decrypt-region ((scheme pgg-scheme-gpg)
start end)
(let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id))
(passphrase
- (pgg-read-passphrase
+ (pgg-read-passphrase
(format "GnuPG passphrase for %s: " pgg-gpg-user-id)
(pgg-scheme-lookup-key scheme pgg-gpg-user-id 'encrypt)))
(args '("--batch" "--decrypt")))
(pgg-gpg-process-region start end passphrase pgg-gpg-program args)
(pgg-process-when-success nil)))
-(luna-define-method pgg-scheme-sign-region ((scheme pgg-scheme-gpg)
+(luna-define-method pgg-scheme-sign-region ((scheme pgg-scheme-gpg)
start end &optional cleartext)
(let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id))
(passphrase
- (pgg-read-passphrase
+ (pgg-read-passphrase
(format "GnuPG passphrase for %s: " pgg-gpg-user-id)
(pgg-scheme-lookup-key scheme pgg-gpg-user-id 'sign)))
- (args
+ (args
(list (if cleartext "--clearsign" "--detach-sign")
- "--armor" "--batch" "--verbose"
+ "--armor" "--batch" "--verbose"
"--local-user" pgg-gpg-user-id))
(inhibit-read-only t)
buffer-read-only)
(pgg-process-when-success
(pgg-convert-lbt-region (point-min)(point-max) 'LF)
(when (re-search-forward "^-+BEGIN PGP SIGNATURE" nil t);XXX
- (let ((packet
- (cdr (assq 2 (pgg-parse-armor-region
+ (let ((packet
+ (cdr (assq 2 (pgg-parse-armor-region
(progn (beginning-of-line 2)
(point))
(point-max))))))
(if pgg-cache-passphrase
- (pgg-add-passphrase-cache
+ (pgg-add-passphrase-cache
(cdr (assq 'key-identifier packet))
passphrase)))))))
-(luna-define-method pgg-scheme-verify-region ((scheme pgg-scheme-gpg)
+(luna-define-method pgg-scheme-verify-region ((scheme pgg-scheme-gpg)
start end &optional signature)
(let ((args '("--batch" "--verify")))
(when (stringp signature)
(luna-define-method pgg-scheme-insert-key ((scheme pgg-scheme-gpg))
(let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id))
- (args (list "--batch" "--export" "--armor"
+ (args (list "--batch" "--export" "--armor"
(concat "\"" pgg-gpg-user-id "\""))))
(pgg-gpg-process-region (point)(point) nil pgg-gpg-program args)
(insert-buffer-substring pgg-output-buffer)))
(set-buffer pgg-status-buffer)
(goto-char (point-min))
(when (re-search-forward "^\\[GNUPG:] +IMPORT_RES +" nil t)
- (setq status (buffer-substring (match-end 0)
- (progn (end-of-line)
+ (setq status (buffer-substring (match-end 0)
+ (progn (end-of-line)
(point)))
- status (vconcat (mapcar #'string-to-int
+ status (vconcat (mapcar #'string-to-int
(split-string status))))
(erase-buffer)
(insert (format "Imported %d key(s).
;; This module is based on
;; [OpenPGP] RFC 2440: "OpenPGP Message Format"
-;; by John W. Noerenberg, II <jwn2@qualcomm.com>,
+;; by John W. Noerenberg, II <jwn2@qualcomm.com>,
;; Jon Callas <jon@pgp.com>, Lutz Donnerhacke <lutz@iks-jena.de>,
;; Hal Finney <hal@pgp.com> and Rodney Thayer <rodney@unitran.com>
;; (1998/11)
(2 . ZLIB))
"Alist of the assigned number to the compression algorithm."
:group 'pgg-parse
- :type 'alist)
+ :type 'alist)
(defcustom pgg-parse-signature-type-alist
'((0 . "Signature of a binary document")
(16 . "Generic certification of a User ID and Public Key packet")
(17 . "Persona certification of a User ID and Public Key packet")
(18 . "Casual certification of a User ID and Public Key packet")
- (19 . "Positive certification of a User ID and Public Key packet")
+ (19 . "Positive certification of a User ID and Public Key packet")
(24 . "Subkey Binding Signature")
(31 . "Signature directly on a key")
(32 . "Key revocation signature")
"^-----BEGIN PGP PUBLIC KEY BLOCK-----\r?$"
"^-----BEGIN PGP PRIVATE KEY BLOCK-----\r?$"
"^-----BEGIN PGP SIGNATURE-----\r?$")
- "Armor headers")
+ "Armor headers.")
(defmacro pgg-format-key-identifier (string)
`(upcase (apply #'format "%02x%02x%02x%02x%02x%02x%02x%02x"
`(char-int (char-after (prog1 (point) (forward-char)))))
(defmacro pgg-read-bytes-string (nbytes)
- `(buffer-substring
+ `(buffer-substring
(point) (prog1 (+ ,nbytes (point))
(forward-char ,nbytes))))
(format "%c%c%c"
(logand (aref h 1) 255)
(logand (lsh (aref h 2) -8) 255)
- (logand (aref h 2) 255))))
- )
+ (logand (aref h 2) 255)))))
(defmacro pgg-parse-length-type (c)
- `(cond
+ `(cond
((< ,c 192) (cons ,c 1))
((< ,c 224)
- (cons (+ (lsh (- ,c 192) 8)
+ (cons (+ (lsh (- ,c 192) 8)
(pgg-byte-after (+ 2 (point)))
192)
2))
packet-bytes 0
header-bytes (1+ length-type))
(dotimes (i length-type)
- (setq packet-bytes
- (logior (lsh packet-bytes 8)
- (pgg-byte-after (+ 1 i (point))))))
- )
+ (setq packet-bytes
+ (logior (lsh packet-bytes 8)
+ (pgg-byte-after (+ 1 i (point)))))))
(setq content-tag (logand 63 ptag)
- length-type (pgg-parse-length-type
+ length-type (pgg-parse-length-type
(pgg-byte-after (1+ (point))))
packet-bytes (car length-type)
header-bytes (1+ (cdr length-type))))
;; 12 -- Trust Packet
(13 ;User ID Packet
(pgg-read-body-string ptag))
- ;; 14 -- Public Subkey Packet
+ ;; 14 -- Public Subkey Packet
;; 60 .. 63 -- Private or Experimental Values
))
(defun pgg-parse-packets (&optional header-parser body-parser)
(let ((header-parser
- (or header-parser
+ (or header-parser
(function pgg-parse-packet-header)))
(body-parser
- (or body-parser
+ (or body-parser
(function pgg-parse-packet)))
result ptag)
(while (> (point-max) (1+ (point)))
(setq ptag (funcall header-parser))
(pgg-skip-header ptag)
- (push (cons (car ptag)
- (save-excursion
+ (push (cons (car ptag)
+ (save-excursion
(funcall body-parser ptag)))
result)
(if (zerop (nth 1 ptag))
(defun pgg-parse-signature-subpacket (ptag)
(case (car ptag)
(2 ;signature creation time
- (cons 'creation-time
+ (cons 'creation-time
(let ((bytes (pgg-read-bytes 4)))
(pgg-parse-time-field bytes))))
(3 ;signature expiration time
- (cons 'signature-expiry
+ (cons 'signature-expiry
(let ((bytes (pgg-read-bytes 4)))
(pgg-parse-time-field bytes))))
(4 ;exportable certification
(5 ;trust signature
(cons 'trust-level (pgg-read-byte)))
(6 ;regular expression
- (cons 'regular-expression
+ (cons 'regular-expression
(pgg-read-body-string ptag)))
(7 ;revocable
(cons 'revocability (pgg-read-byte)))
(9 ;key expiration time
- (cons 'key-expiry
+ (cons 'key-expiry
(let ((bytes (pgg-read-bytes 4)))
(pgg-parse-time-field bytes))))
;; 10 = placeholder for backward compatibility
(cons 'notation
(let ((name-bytes (pgg-read-bytes 2))
(value-bytes (pgg-read-bytes 2)))
- (cons (pgg-read-bytes-string
+ (cons (pgg-read-bytes-string
(logior (lsh (car name-bytes) 8)
(nth 1 name-bytes)))
- (pgg-read-bytes-string
+ (pgg-read-bytes-string
(logior (lsh (car value-bytes) 8)
- (nth 1 value-bytes))))))
- )
+ (nth 1 value-bytes)))))))
(21 ;preferred hash algorithms
(cons 'preferred-hash-algorithm
(cdr (assq (pgg-read-byte)
(let* ((signature-version (pgg-byte-after))
(result (list (cons 'version signature-version)))
hashed-material field n)
- (cond
+ (cond
((= signature-version 3)
(pgg-skip-bytes 2)
(setq hashed-material (pgg-read-bytes 5))
- (pgg-set-alist result
- 'signature-type
+ (pgg-set-alist result
+ 'signature-type
(cdr (assq (pop hashed-material)
pgg-parse-signature-type-alist)))
(pgg-set-alist result
- 'creation-time
+ 'creation-time
(pgg-parse-time-field hashed-material))
(pgg-set-alist result
'key-identifier
(pgg-set-alist result
'public-key-algorithm (pgg-read-byte))
(pgg-set-alist result
- 'hash-algorithm (pgg-read-byte))
- )
+ 'hash-algorithm (pgg-read-byte)))
((= signature-version 4)
(pgg-skip-bytes 1)
(pgg-set-alist result
- 'signature-type
+ 'signature-type
(cdr (assq (pgg-read-byte)
pgg-parse-signature-type-alist)))
(pgg-set-alist result
- 'public-key-algorithm
+ 'public-key-algorithm
(pgg-read-byte))
(pgg-set-alist result
'hash-algorithm (pgg-read-byte))
(narrow-to-region (point)(+ n (point)))
(nconc result
(mapcar (function cdr) ;remove packet types
- (pgg-parse-packets
+ (pgg-parse-packets
#'pgg-parse-signature-subpacket-header
#'pgg-parse-signature-subpacket)))
- (goto-char (point-max)))
- )
+ (goto-char (point-max))))
(when (>= 10000 (setq n (pgg-read-bytes 2)
n (logior (lsh (car n) 8)
(nth 1 n))))
(narrow-to-region (point)(+ n (point)))
(nconc result
(mapcar (function cdr) ;remove packet types
- (pgg-parse-packets
+ (pgg-parse-packets
#'pgg-parse-signature-subpacket-header
- #'pgg-parse-signature-subpacket)))
- ))
- ))
+ #'pgg-parse-signature-subpacket)))))))
(setcdr (setq field (assq 'public-key-algorithm
result))
'version (pgg-read-byte))
(pgg-set-alist result
'key-identifier
- (pgg-format-key-identifier
+ (pgg-format-key-identifier
(pgg-read-bytes-string 8)))
(pgg-set-alist result
'public-key-algorithm
(pgg-set-alist result
'key-expiry (pgg-read-bytes 2))
(pgg-set-alist result
- 'public-key-algorithm (pgg-read-byte))
- )
+ 'public-key-algorithm (pgg-read-byte)))
((= 4 key-version)
(pgg-set-alist result
'creation-time
(let ((bytes (pgg-read-bytes 4)))
(pgg-parse-time-field bytes)))
(pgg-set-alist result
- 'public-key-algorithm (pgg-read-byte))
- ))
+ 'public-key-algorithm (pgg-read-byte))))
(setcdr (setq field (assq 'public-key-algorithm
result))
(mime-decode-region (point-min) marker "base64")
(static-when (fboundp 'pgg-parse-crc24-string )
(or pgg-ignore-packet-checksum
- (string-equal
+ (string-equal
(funcall (mel-find-function 'mime-encode-string "base64")
- (pgg-parse-crc24-string
+ (pgg-parse-crc24-string
(buffer-substring (point-min)(point-max))))
checksum)
- (error "PGP packet checksum does not match.")))))
+ (error "PGP packet checksum does not match")))))
(defun pgg-decode-armor-region (start end)
(save-restriction
"PGP 2.* and 6.* interface"
:group 'pgg)
-(defcustom pgg-pgp-program "pgp"
+(defcustom pgg-pgp-program "pgp"
"PGP 2.* and 6.* executable."
:group 'pgg-pgp
:type 'string)
(defcustom pgg-pgp-shell-file-name "/bin/sh"
- "File name to load inferior shells from. Bourne shell or its equivalent
-\(not tcsh) is needed for \"2>\"."
+ "File name to load inferior shells from.
+Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
:group 'pgg-pgp
:type 'string)
(luna-define-class pgg-scheme-pgp (pgg-scheme)))
(defvar pgg-pgp-user-id nil
- "GnuPG ID of your default identity.")
+ "PGP ID of your default identity.")
(defvar pgg-scheme-pgp-instance nil)
(defun pgg-pgp-process-region (start end passphrase program args)
(let* ((errors-file-name
- (concat temporary-file-directory
+ (concat temporary-file-directory
(make-temp-name "pgg-errors")))
- (args
- (append args
+ (args
+ (append args
pgg-pgp-extra-args
(list (concat "2>" errors-file-name))))
(shell-file-name pgg-pgp-shell-file-name)
(if (and process (eq 'run (process-status process)))
(interrupt-process process)))))
-(luna-define-method pgg-scheme-lookup-key ((scheme pgg-scheme-pgp)
+(luna-define-method pgg-scheme-lookup-key ((scheme pgg-scheme-pgp)
string &optional type)
(let ((args (list "+batchmode" "+language=en" "-kv" string)))
(with-current-buffer (get-buffer-create pgg-output-buffer)
(buffer-substring (point)(+ 8 (point))))
((re-search-forward "^Type" nil t);PGP 6.*
(beginning-of-line 2)
- (substring
- (nth 2 (split-string
+ (substring
+ (nth 2 (split-string
(buffer-substring (point)(progn (end-of-line) (point)))))
2))))))
-(luna-define-method pgg-scheme-encrypt-region ((scheme pgg-scheme-pgp)
+(luna-define-method pgg-scheme-encrypt-region ((scheme pgg-scheme-pgp)
start end recipients)
(let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
- (args
+ (args
`("+encrypttoself=off +verbose=1" "+batchmode"
"+language=us" "-fate"
,@(if recipients
(pgg-pgp-process-region start end nil pgg-pgp-program args)
(pgg-process-when-success nil)))
-(luna-define-method pgg-scheme-decrypt-region ((scheme pgg-scheme-pgp)
+(luna-define-method pgg-scheme-decrypt-region ((scheme pgg-scheme-pgp)
start end)
(let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
(passphrase
- (pgg-read-passphrase
+ (pgg-read-passphrase
(format "PGP passphrase for %s: " pgg-pgp-user-id)
(pgg-scheme-lookup-key scheme pgg-pgp-user-id 'encrypt)))
- (args
+ (args
'("+verbose=1" "+batchmode" "+language=us" "-f")))
(pgg-pgp-process-region start end passphrase pgg-pgp-program args)
(pgg-process-when-success nil)))
-(luna-define-method pgg-scheme-sign-region ((scheme pgg-scheme-pgp)
+(luna-define-method pgg-scheme-sign-region ((scheme pgg-scheme-pgp)
start end &optional clearsign)
(let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
(passphrase
- (pgg-read-passphrase
+ (pgg-read-passphrase
(format "PGP passphrase for %s: " pgg-pgp-user-id)
(pgg-scheme-lookup-key scheme pgg-pgp-user-id 'sign)))
- (args
+ (args
(list (if clearsign "-fast" "-fbast")
"+verbose=1" "+language=us" "+batchmode"
"-u" pgg-pgp-user-id)))
(pgg-process-when-success
(goto-char (point-min))
(when (re-search-forward "^-+BEGIN PGP" nil t);XXX
- (let ((packet
- (cdr (assq 2 (pgg-parse-armor-region
+ (let ((packet
+ (cdr (assq 2 (pgg-parse-armor-region
(progn (beginning-of-line 2)
(point))
(point-max))))))
(if pgg-cache-passphrase
- (pgg-add-passphrase-cache
+ (pgg-add-passphrase-cache
(cdr (assq 'key-identifier packet))
passphrase)))))))
-(luna-define-method pgg-scheme-verify-region ((scheme pgg-scheme-pgp)
+(luna-define-method pgg-scheme-verify-region ((scheme pgg-scheme-pgp)
start end &optional signature)
(let* ((basename (expand-file-name "pgg" temporary-file-directory))
(orig-file (make-temp-name basename))
(progn (beginning-of-line 2) (point)))))
(goto-char (point-min))
(when (re-search-forward "^\\.$" nil t)
- (delete-region (point-min)
+ (delete-region (point-min)
(progn (beginning-of-line 2)
(point)))))))
(luna-define-method pgg-scheme-insert-key ((scheme pgg-scheme-pgp))
(let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
(args
- (list "+verbose=1" "+batchmode" "+language=us" "-kxaf"
+ (list "+verbose=1" "+batchmode" "+language=us" "-kxaf"
(concat "\"" pgg-pgp-user-id "\""))))
(pgg-pgp-process-region (point)(point) nil pgg-pgp-program args)
(insert-buffer-substring pgg-output-buffer)))
(let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
(basename (expand-file-name "pgg" temporary-file-directory))
(key-file (make-temp-name basename))
- (args
- (list "+verbose=1" "+batchmode" "+language=us" "-kaf"
+ (args
+ (list "+verbose=1" "+batchmode" "+language=us" "-kaf"
key-file)))
(write-region-as-raw-text-CRLF start end key-file)
(pgg-pgp-process-region start end nil pgg-pgp-program args)
"PGP 5.* interface"
:group 'pgg)
-(defcustom pgg-pgp5-pgpe-program "pgpe"
+(defcustom pgg-pgp5-pgpe-program "pgpe"
"PGP 5.* 'pgpe' executable."
:group 'pgg-pgp5
:type 'string)
-(defcustom pgg-pgp5-pgps-program "pgps"
+(defcustom pgg-pgp5-pgps-program "pgps"
"PGP 5.* 'pgps' executable."
:group 'pgg-pgp5
:type 'string)
-(defcustom pgg-pgp5-pgpk-program "pgpk"
+(defcustom pgg-pgp5-pgpk-program "pgpk"
"PGP 5.* 'pgpk' executable."
:group 'pgg-pgp5
:type 'string)
-(defcustom pgg-pgp5-pgpv-program "pgpv"
+(defcustom pgg-pgp5-pgpv-program "pgpv"
"PGP 5.* 'pgpv' executable."
:group 'pgg-pgp5
:type 'string)
(defcustom pgg-pgp5-shell-file-name "/bin/sh"
- "File name to load inferior shells from. Bourne shell or its equivalent
-\(not tcsh) is needed for \"2>\"."
+ "File name to load inferior shells from.
+Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
:group 'pgg-pgp5
:type 'string)
:type 'string)
(defcustom pgg-pgp5-extra-args nil
- "Extra arguments for every PGP invocation."
+ "Extra arguments for every PGP 5.* invocation."
:group 'pgg-pgp5
:type 'string)
(luna-define-class pgg-scheme-pgp5 (pgg-scheme)))
(defvar pgg-pgp5-user-id nil
- "GnuPG ID of your default identity.")
+ "PGP 5.* ID of your default identity.")
(defvar pgg-scheme-pgp5-instance nil)
(defun pgg-pgp5-process-region (start end passphrase program args)
(let* ((errors-file-name
- (concat temporary-file-directory
+ (concat temporary-file-directory
(make-temp-name "pgg-errors")))
- (args
- (append args
+ (args
+ (append args
pgg-pgp5-extra-args
(list (concat "2>" errors-file-name))))
(shell-file-name pgg-pgp5-shell-file-name)
(if (and process (eq 'run (process-status process)))
(interrupt-process process)))))
-(luna-define-method pgg-scheme-lookup-key ((scheme pgg-scheme-pgp5)
+(luna-define-method pgg-scheme-lookup-key ((scheme pgg-scheme-pgp5)
string &optional type)
(let ((args (list "+language=en" "-l" string)))
(with-current-buffer (get-buffer-create pgg-output-buffer)
(apply #'call-process pgg-pgp5-pgpk-program nil t nil args)
(goto-char (point-min))
(when (re-search-forward "^sec" nil t)
- (substring
- (nth 2 (split-string
+ (substring
+ (nth 2 (split-string
(buffer-substring (match-end 0)(progn (end-of-line)(point)))))
2)))))
-(luna-define-method pgg-scheme-encrypt-region ((scheme pgg-scheme-pgp5)
+(luna-define-method pgg-scheme-encrypt-region ((scheme pgg-scheme-pgp5)
start end recipients)
(let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id))
- (args
+ (args
`("+NoBatchInvalidKeys=off" "-fat" "+batchmode=1"
,@(if recipients
- (apply #'append
- (mapcar (lambda (rcpt)
- (list "-r"
- (concat "\"" rcpt "\"")))
+ (apply #'append
+ (mapcar (lambda (rcpt)
+ (list "-r"
+ (concat "\"" rcpt "\"")))
(append recipients
(if pgg-encrypt-for-me
(list pgg-pgp5-user-id)))))))))
(pgg-pgp5-process-region start end nil pgg-pgp5-pgpe-program args)
(pgg-process-when-success nil)))
-(luna-define-method pgg-scheme-decrypt-region ((scheme pgg-scheme-pgp5)
+(luna-define-method pgg-scheme-decrypt-region ((scheme pgg-scheme-pgp5)
start end)
(let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id))
(passphrase
- (pgg-read-passphrase
+ (pgg-read-passphrase
(format "PGP passphrase for %s: " pgg-pgp5-user-id)
(pgg-scheme-lookup-key scheme pgg-pgp5-user-id 'encrypt)))
- (args
+ (args
'("+verbose=1" "+batchmode=1" "+language=us" "-f")))
(pgg-pgp5-process-region start end passphrase pgg-pgp5-pgpv-program args)
(pgg-process-when-success nil)))
-(luna-define-method pgg-scheme-sign-region ((scheme pgg-scheme-pgp5)
+(luna-define-method pgg-scheme-sign-region ((scheme pgg-scheme-pgp5)
start end &optional clearsign)
(let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id))
(passphrase
- (pgg-read-passphrase
+ (pgg-read-passphrase
(format "PGP passphrase for %s: " pgg-pgp5-user-id)
(pgg-scheme-lookup-key scheme pgg-pgp5-user-id 'sign)))
- (args
+ (args
(list (if clearsign "-fat" "-fbat")
"+verbose=1" "+language=us" "+batchmode=1"
"-u" pgg-pgp5-user-id)))
(pgg-pgp5-process-region start end passphrase pgg-pgp5-pgps-program args)
(pgg-process-when-success
(when (re-search-forward "^-+BEGIN PGP SIGNATURE" nil t);XXX
- (let ((packet
- (cdr (assq 2 (pgg-parse-armor-region
+ (let ((packet
+ (cdr (assq 2 (pgg-parse-armor-region
(progn (beginning-of-line 2)
(point))
(point-max))))))
(if pgg-cache-passphrase
- (pgg-add-passphrase-cache
+ (pgg-add-passphrase-cache
(cdr (assq 'key-identifier packet))
passphrase)))))))
-(luna-define-method pgg-scheme-verify-region ((scheme pgg-scheme-pgp5)
+(luna-define-method pgg-scheme-verify-region ((scheme pgg-scheme-pgp5)
start end &optional signature)
(let* ((basename (expand-file-name "pgg" temporary-file-directory))
(orig-file (make-temp-name basename))
(luna-define-method pgg-scheme-insert-key ((scheme pgg-scheme-pgp5))
(let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id))
(args
- (list "+verbose=1" "+batchmode=1" "+language=us" "-x"
+ (list "+verbose=1" "+batchmode=1" "+language=us" "-x"
(concat "\"" pgg-pgp5-user-id "\""))))
(pgg-pgp5-process-region (point)(point) nil pgg-pgp5-pgpk-program args)
(insert-buffer-substring pgg-output-buffer)))
(let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id))
(basename (expand-file-name "pgg" temporary-file-directory))
(key-file (make-temp-name basename))
- (args
- (list "+verbose=1" "+batchmode=1" "+language=us" "-a"
+ (args
+ (list "+verbose=1" "+batchmode=1" "+language=us" "-a"
key-file)))
(write-region-as-raw-text-CRLF start end key-file)
(pgg-pgp5-process-region start end nil pgg-pgp5-pgpk-program args)
(luna-define-internal-accessors 'pgg-scheme))
(luna-define-generic pgg-scheme-lookup-key (scheme string &optional type)
- "Search keys associated with STRING")
+ "Search keys associated with STRING.")
(luna-define-generic pgg-scheme-encrypt-region (scheme start end recipients)
"Encrypt the current region between START and END.")
(luna-define-generic pgg-scheme-verify-region
(scheme start end &optional signature)
- "Verify region between START and END
-as the detached signature SIGNATURE.")
+ "Verify region between START and END as the detached signature SIGNATURE.")
(luna-define-generic pgg-scheme-insert-key (scheme)
"Insert public key at point.")
(luna-define-generic pgg-scheme-snarf-keys-region (scheme start end)
- "Add all public keys in region between START
-and END to the keyring.")
+ "Add all public keys in region between START and END to the keyring.")
;;; @ utility functions
;;;
(defun pgg-temp-buffer-show-function (buffer)
(let ((window (split-window-vertically
- (- (window-height)
+ (- (window-height)
(/ (window-height) 5)))))
(set-window-buffer window buffer)))
(delete-region start end)
(insert-buffer-substring pgg-output-buffer)
(decode-coding-region start (point) buffer-file-coding-system))
- (let ((temp-buffer-show-function
+ (let ((temp-buffer-show-function
(function pgg-temp-buffer-show-function)))
(with-output-to-temp-buffer pgg-echo-buffer
(set-buffer standard-output)
(list (region-beginning)(region-end)
(split-string (read-string "Recipients: ") "[ \t,]+")))
(let* ((entity (pgg-make-scheme pgg-default-scheme))
- (status
+ (status
(pgg-save-coding-system start end
(pgg-scheme-encrypt-region entity (point-min)(point-max) rcpts))))
(when (interactive-p)
(buffer-disable-undo)
(set-buffer-multibyte nil)
(insert-file-contents signature)
- (cdr (assq 2 (pgg-decode-armor-region
+ (cdr (assq 2 (pgg-decode-armor-region
(point-min)(point-max)))))))
(scheme
(or pgg-scheme