Commits

Anonymous committed 489d2bb

2003-05-10 Ville Skyttä <scop@xemacs.org>

* pgg.el (pgg-temp-buffer-show-function): Reuse existing
visible output window if one is available.

2003-05-09 Simon Josefsson <jas@extundo.com>

* pgg.texi (Default user identity): Add.

2003-03-17 Simon Josefsson <jas@extundo.com>

* pgg.texi: Fix setfilename. Tiny patch by Frank Haun
<pille3003@fhaun.de>.

2003-04-29 Simon Josefsson <jas@extundo.com>

* pgg.el (run-at-time): Autoload it (fix xemacs compile
warnings).

2003-04-24 Dave Love <fx@gnu.org>

* pgg.el: Split eval-when-compile forms.

2003-04-20 Simon Josefsson <jas@extundo.com>

* pgg-def.el, pgg.el, pgg-gpg.el, pgg-parse.el, pgg-pgp5.el,
pgg-pgp.el: Fix license template.

2003-04-16 Dave Love <fx@gnu.org>

* pgg.el: Require cl when compiling.

2003-04-07 Jesper Harder <harder@ifa.au.dk>

* pgg.el (pgg-decrypt-region): Don't use
`insert-buffer', the docstring says "This function is meant for
the user to run interactively. Don't call it from programs!"

2003-04-06 Jesper Harder <harder@ifa.au.dk>

* pgg-gpg.el (pgg-gpg-process-region): Revert previous change.

* pgg-pgp.el (pgg-pgp-process-region, pgg-pgp-verify-region)
(pgg-pgp-snarf-keys-region): do.

* pgg-pgp5.el (pgg-pgp5-verify-region)
(pgg-pgp5-snarf-keys-region, pgg-pgp5-process-region): do.

* pgg.el (pgg-make-temp-file, pgg-temporary-file-directory): do.

2003-04-03 Jesper Harder <harder@ifa.au.dk>

* pgg-gpg.el (pgg-gpg-process-region): do.

* pgg-pgp.el (pgg-pgp-process-region, pgg-pgp-verify-region)
(pgg-pgp-snarf-keys-region): do.

* pgg-pgp5.el (pgg-pgp5-verify-region)
(pgg-pgp5-snarf-keys-region, pgg-pgp5-process-region): Use it.

* pgg.el (pgg-make-temp-file): New function. `make-temp-name' is
unsafe.
(pgg-temporary-file-directory): Remove.

2003-03-04 Jesper Harder <harder@ifa.au.dk>

* pgg.el (pgg-read-passphrase): Simplify.

2003-03-01 Satyaki Das <satyaki@theforce.stanford.edu>
(Trivial patch.)

* pgg-gpg.el (pgg-gpg-process-region): Insert process status into
errors-buffer. This produces a nicer error message in case of
problems.

2003-02-08 Simon Josefsson <jas@extundo.com>

* pgg-gpg.el (pgg-gpg-process-region): Don't blink. From Satyaki
Das <satyaki@chicory.stanford.edu>.

Comments (0)

Files changed (8)

+2003-05-10  Ville Skyttä  <scop@xemacs.org>
+
+	* pgg.el (pgg-temp-buffer-show-function): Reuse existing
+	visible output window if one is available.
+
+2003-05-09  Simon Josefsson  <jas@extundo.com>
+
+	* pgg.texi (Default user identity): Add.
+
+2003-03-17  Simon Josefsson  <jas@extundo.com>
+
+	* pgg.texi: Fix setfilename.  Tiny patch by Frank Haun
+	<pille3003@fhaun.de>.
+
+2003-04-29  Simon Josefsson  <jas@extundo.com>
+
+	* pgg.el (run-at-time): Autoload it (fix xemacs compile
+	warnings).
+
+2003-04-24  Dave Love  <fx@gnu.org>
+
+	* pgg.el: Split eval-when-compile forms.
+
+2003-04-20  Simon Josefsson  <jas@extundo.com>
+
+	* pgg-def.el, pgg.el, pgg-gpg.el, pgg-parse.el, pgg-pgp5.el,
+	pgg-pgp.el: Fix license template.
+
+2003-04-16  Dave Love  <fx@gnu.org>
+
+	* pgg.el: Require cl when compiling.
+
+2003-04-07  Jesper Harder  <harder@ifa.au.dk>
+
+	* pgg.el (pgg-decrypt-region): Don't use
+	`insert-buffer', the docstring says "This function is meant for
+	the user to run interactively.  Don't call it from programs!"
+
+2003-04-06  Jesper Harder  <harder@ifa.au.dk>
+
+	* pgg-gpg.el (pgg-gpg-process-region): Revert previous change.
+
+	* pgg-pgp.el (pgg-pgp-process-region, pgg-pgp-verify-region)
+	(pgg-pgp-snarf-keys-region): do.
+
+	* pgg-pgp5.el (pgg-pgp5-verify-region)
+	(pgg-pgp5-snarf-keys-region, pgg-pgp5-process-region): do.
+
+	* pgg.el (pgg-make-temp-file, pgg-temporary-file-directory): do.
+
+2003-04-03  Jesper Harder  <harder@ifa.au.dk>
+
+	* pgg-gpg.el (pgg-gpg-process-region): do.
+
+	* pgg-pgp.el (pgg-pgp-process-region, pgg-pgp-verify-region)
+	(pgg-pgp-snarf-keys-region): do.
+
+	* pgg-pgp5.el (pgg-pgp5-verify-region)
+	(pgg-pgp5-snarf-keys-region, pgg-pgp5-process-region): Use it.
+
+	* pgg.el (pgg-make-temp-file): New function. `make-temp-name' is
+	unsafe.
+	(pgg-temporary-file-directory): Remove.
+
+2003-03-04  Jesper Harder  <harder@ifa.au.dk>
+
+	* pgg.el (pgg-read-passphrase): Simplify.
+
+2003-03-01  Satyaki Das  <satyaki@theforce.stanford.edu>
+	(Trivial patch.)
+
+	* pgg-gpg.el (pgg-gpg-process-region): Insert process status into
+	errors-buffer. This produces a nicer error message in case of
+	problems.
+
+2003-02-08  Simon Josefsson  <jas@extundo.com>
+
+	* pgg-gpg.el (pgg-gpg-process-region): Don't blink.  From Satyaki
+	Das <satyaki@chicory.stanford.edu>.
+
 2003-03-09  Ben Wing  <ben@xemacs.org>
 
 	* Makefile:
 ;;; pgg-def.el --- functions/macros for defining PGG functions
 
-;; Copyright (C) 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2003 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Created: 1999/11/02
 ;; Keywords: PGP, OpenPGP, GnuPG
 
-;; This file is part of SEMI (Secure Emacs MIME Interface).
+;; This file is part of GNU Emacs.
 
-;; This program 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 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.
 
-;; This program 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.
+;; 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
 ;;; pgg-gpg.el --- GnuPG support for PGG.
 
-;; Copyright (C) 1999,2000 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Created: 1999/10/28
 ;; Keywords: PGP, OpenPGP, GnuPG
 
-;; This file is part of SEMI (Secure Emacs MIME Interface).
+;; This file is part of GNU Emacs.
 
-;; This program 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 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.
 
-;; This program 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.
+;; 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
 	 (errors-buffer pgg-errors-buffer)
 	 (orig-mode (default-file-modes))
 	 (process-connection-type nil)
-	 process status exit-status)
+	 exit-status)
     (with-current-buffer (get-buffer-create errors-buffer)
       (buffer-disable-undo)
       (erase-buffer))
     (unwind-protect
 	(progn
 	  (set-default-file-modes 448)
-	  (let ((coding-system-for-write 'binary))
-	    (setq process
-		  (apply #'start-process "*GnuPG*" errors-buffer
-			 program args)))
-	  (set-process-sentinel process #'ignore)
-	  (when passphrase
-	    (process-send-string process (concat passphrase "\n")))
-	  (process-send-region process start end)
-	  (process-send-eof process)
-	  (while (eq 'run (process-status process))
-	    (accept-process-output process 5))
-	  (setq status (process-status process)
-		exit-status (process-exit-status process))
-	  (delete-process process)
+          (let* ((coding-system-for-write 'binary)
+                 (input (buffer-substring-no-properties start end)))
+            (with-temp-buffer
+              (when passphrase
+                (insert passphrase "\n"))
+              (insert input)
+              (setq exit-status
+                    (apply #'call-process-region (point-min) (point-max) program
+                           nil errors-buffer nil args))))
 	  (with-current-buffer (get-buffer-create output-buffer)
 	    (buffer-disable-undo)
 	    (erase-buffer)
 		(let ((coding-system-for-read 'raw-text-dos))
 		  (insert-file-contents output-file-name)))
 	    (set-buffer errors-buffer)
-	    (if (memq status '(stop signal))
-		(error "%s exited abnormally: '%s'" program exit-status))
-	    (if (= 127 exit-status)
-		(error "%s could not be found" program))))
-      (if (and process (eq 'run (process-status process)))
-	  (interrupt-process process))
+	    (if (not (equal exit-status 0))
+		(insert (format "\n%s exited abnormally: '%s'\n"
+                                program exit-status)))))
       (if (file-exists-p output-file-name)
 	  (delete-file output-file-name))
       (set-default-file-modes orig-mode))))
 ;;; pgg-parse.el --- OpenPGP packet parsing
 
-;; Copyright (C) 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2003 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Created: 1999/10/28
 ;; Keywords: PGP, OpenPGP, GnuPG
 
-;; This file is part of SEMI (Secure Emacs MIME Interface).
+;; This file is part of GNU Emacs.
 
-;; This program 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 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.
 
-;; This program 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.
+;; 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
 ;;; pgg-pgp.el --- PGP 2.* and 6.* support for PGG.
 
-;; Copyright (C) 1999,2000 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Created: 1999/11/02
 ;; Keywords: PGP, OpenPGP
 
-;; This file is part of SEMI (Secure Emacs MIME Interface).
+;; This file is part of GNU Emacs.
 
-;; This program 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 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.
 
-;; This program 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.
+;; 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
 ;;; pgg-pgp5.el --- PGP 5.* support for PGG.
 
-;; Copyright (C) 1999,2000 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Created: 1999/11/02
 ;; Keywords: PGP, OpenPGP
 
-;; This file is part of SEMI (Secure Emacs MIME Interface).
+;; This file is part of GNU Emacs.
 
-;; This program 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 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.
 
-;; This program 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.
+;; 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
 ;;; pgg.el --- glue for the various PGP implementations.
 
-;; Copyright (C) 1999,2000 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Created: 1999/10/28
 ;; Keywords: PGP
 
-;; This file is part of SEMI (Secure Emacs MIME Interface).
+;; This file is part of GNU Emacs.
 
-;; This program 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 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.
 
-;; This program 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.
+;; 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:
-;; 
 
 ;;; Code:
 
 (require 'pgg-def)
 (require 'pgg-parse)
+(autoload 'run-at-time "timer")
 
+;; Don't merge these two `eval-when-compile's.
+(eval-when-compile
+  (require 'cl))
+;; Fixme: This would be better done with an autoload for
+;; `url-insert-file-contents', and the url stuff rationalized.
+;; (`locate-library' can say whether the url code is available.)
 (eval-when-compile
   (ignore-errors
     (require 'w3)
     (require 'url)))
 
+;; Fixme: Avoid this and use mm-make-temp-file (especially for
+;; something sensitive like pgp).
 (defvar pgg-temporary-file-directory
   (cond ((fboundp 'temp-directory) (temp-directory))
 	((boundp 'temporary-file-directory) temporary-file-directory)
        ,@body)))
 
 (defun pgg-temp-buffer-show-function (buffer)
-  (let ((window (split-window-vertically)))
+  (let ((window (or (get-buffer-window buffer 'visible)
+		    (split-window-vertically))))
     (set-window-buffer window buffer)
     (shrink-window-if-larger-than-buffer window)))
 
 
 (defvar pgg-passphrase-cache (make-vector 7 0))
 
-(defvar pgg-read-passphrase nil)
 (defun pgg-read-passphrase (prompt &optional key)
-  (if (not pgg-read-passphrase)
-      (if (functionp 'read-passwd)
-	  (setq pgg-read-passphrase 'read-passwd)
-	(if (load "passwd" t)
-	    (setq pgg-read-passphrase 'read-passwd)
-	  (autoload 'ange-ftp-read-passwd "ange-ftp")
-	  (setq pgg-read-passphrase 'ange-ftp-read-passwd))))
   (or (and pgg-cache-passphrase
 	   key (setq key (pgg-truncate-key-identifier key))
 	   (symbol-value (intern-soft key pgg-passphrase-cache)))
-      (funcall pgg-read-passphrase prompt)))
+      (read-passwd prompt)))
 
 (defun pgg-add-passphrase-cache (key passphrase)
   (setq key (pgg-truncate-key-identifier key))
   (interactive "r")
   (let* ((buf (current-buffer))
 	 (packet (cdr (assq 1 (with-temp-buffer
-				(insert-buffer buf)
+				(insert-buffer-substring buf)
 				(pgg-decode-armor-region
 				 (point-min) (point-max))))))
 	 (key (cdr (assq 'key-identifier packet)))
 \input texinfo                  @c -*-texinfo-*-
 
-@setfilename pgg.info
+@setfilename pgg
 
 @set VERSION 0.1
 
 @ifinfo
 This file describes the PGG.
 
+Copyright (C) 2003 Free Software Foundation, Inc.
 Copyright (C) 2001 Daiki Ueno.
 
 Permission is granted to copy, distribute and/or modify this document
 * User Commands::               
 * Selecting an implementation::  
 * Caching passphrase::          
+* Default user identity::	
 @end menu
 
 @node User Commands
 Elapsed time for expiration in seconds.
 @end defvar
 
+@node Default user identity
+@section Default user identity
+
+The PGP implementation is usually able to select the proper key to use
+for signing and decryption, but if you have more than one key, you may
+need to specify the key id to use.
+
+@defvar pgg-default-user-id
+User ID of your default identity.  It defaults to the value returned
+by @samp{(user-login-name)}.  You can customize this variable.
+@end defvar
+
+@defvar pgg-gpg-user-id
+User ID of the GnuPG default identity.  It defaults to @samp{nil}.
+This overrides @samp{pgg-default-user-id}.  You can customize this
+variable.
+@end defvar
+
+@defvar pgg-pgp-user-id
+User ID of the PGP 2.x/6.x default identity.  It defaults to
+@samp{nil}.  This overrides @samp{pgg-default-user-id}.  You can
+customize this variable.
+@end defvar
+
+@defvar pgg-pgp5-user-id
+User ID of the PGP 5.x default identity.  It defaults to @samp{nil}.
+This overrides @samp{pgg-default-user-id}.  You can customize this
+variable.
+@end defvar
+
 @node Architecture
 @chapter Architecture