>>>> "SY" == Steve Youngs
<youngs(a)xemacs.org> writes:
SY> Hi Folks!
SY> I've just committed a patch to XEmacs 21.5 that fixes the PGP code in
SY> the package tools.
SY> Could I please ask those of you who have PGP to test this for me. I
SY> want to hear of successes _and_ failures.
Here goes:
1.
(locate-file "gpg" exec-path)
won't do it on Windows, patch forthcoming to use
(locate-file "gpg" exec-path exec-suffix-list)
2.
Signaling: (void-function mc-verify)
(mc-verify)
(progn (setq package-get-continue-update-base nil) (autoload (quote mc-setversion)
"mc-setversion") (or (cond ... ... ...) (error "Can't find a suitable
pgp executable")) (mc-verify) (setq package-get-continue-update-base t))
(if package-entries-are-signed (progn (setq package-get-continue-update-base nil)
(autoload ... "mc-setversion") (or ... ...) (mc-verify) (setq
package-get-continue-update-base t)) (if (yes-or-no-p "Package Index is not PGP
signed. Continue anyway? ") (setq package-get-continue-update-base t) (error
"Package database not updated") (setq package-get-continue-update-base nil)))
(if package-get-require-signed-base-updates (if package-entries-are-signed (progn ...
... ... ... ...) (if ... ... ... ...)))
(save-excursion (set-buffer buf) (goto-char (point-min)) (setq content-beg (point))
(setq content-end (save-excursion ... ...)) (when (re-search-forward
package-get-pgp-signed-begin-line nil t) (setq beg ...) (setq content-beg ...)) (when
(re-search-forward package-get-pgp-signature-begin-line nil t) (setq content-end ...)
(setq package-entries-are-signed t)) (when (re-search-forward
package-get-pgp-signature-end-line nil t) (setq end ...)) (setq
package-get-continue-update-base t) (if package-get-require-signed-base-updates (if
package-entries-are-signed ... ...)) (if package-get-continue-update-base (progn ...
...)))
(let (content-beg content-end beg end) (save-excursion (set-buffer buf) (goto-char ...)
(setq content-beg ...) (setq content-end ...) (when ... ... ...) (when ... ... ...) (when
... ...) (setq package-get-continue-update-base t) (if
package-get-require-signed-base-updates ...) (if package-get-continue-update-base ...)))
package-get-update-base-from-buffer(#<buffer "*package database*">)
#<compiled-function (&optional db-file force-current) "...(62)"
[force-current buf db-file expand-file-name package-get-locate-index-file file-exists-p
error "Package-get database file `%s' does not exist" file-readable-p
"Package-get database file `%s' not readable" get-buffer-create
"*package database*" (...) erase-buffer insert-file-contents-literally
package-get-update-base-from-buffer file-remote-p package-get-maybe-save-index] 3
("c:\\Hacking\\XEmacs\\xemacs-21.5\\lisp\\package-get.elc" . 10952) (let (...)
(list ...))>("C:\\Program
Files\\XEmacs\\XEmacs-21.5-b3\\etc\\package-index.LATEST.pgp")
call-interactively(package-get-update-base)
(featurep 'mailcrypt)
nil
OK
(require 'mailcrypt)
fixes that.
3.
Signaling: (process-error "Searching for program" "/bin/sh")
start-process-internal("*GPG*" #<buffer " *mailcrypt stdout
temp"> "/bin/sh" "/c" "gpg --status-fd 3
3>c:\\tmp\\mailcrypt-gpg-status-wsAISS 2>c:\\tmp\\mailcrypt-gpg-stderr-wsA7HM
--batch --verify")
apply(start-process-internal "*GPG*" #<buffer " *mailcrypt stdout
temp"> "/bin/sh" ("/c" "gpg --status-fd 3
3>c:\\tmp\\mailcrypt-gpg-status-wsAISS 2>c:\\tmp\\mailcrypt-gpg-stderr-wsA7HM
--batch --verify"))
start-process("*GPG*" #<buffer " *mailcrypt stdout temp">
"/bin/sh" "/c" "gpg --status-fd 3
3>c:\\tmp\\mailcrypt-gpg-status-wsAISS 2>c:\\tmp\\mailcrypt-gpg-stderr-wsA7HM
--batch --verify")
start-process-shell-command("*GPG*" #<buffer " *mailcrypt stdout
temp"> "gpg" "--status-fd" "3"
"3>c:\\tmp\\mailcrypt-gpg-status-wsAISS"
"2>c:\\tmp\\mailcrypt-gpg-stderr-wsA7HM" "--batch"
"--verify")
apply(start-process-shell-command "*GPG*" #<buffer " *mailcrypt stdout
temp"> "gpg" ("--status-fd" "3"
"3>c:\\tmp\\mailcrypt-gpg-status-wsAISS"
"2>c:\\tmp\\mailcrypt-gpg-stderr-wsA7HM" "--batch"
"--verify"))
mc-gpg-process-region(1 46330 nil "gpg" ("--batch"
"--verify") mc-gpg-verify-parser #<buffer "*MailCrypt*">)
mc-gpg-verify-region(1 46330)
mc-verify-signature()
mc-verify()
(progn (setq package-get-continue-update-base nil) (autoload (quote mc-setversion)
"mc-setversion") (or (cond ... ... ...) (error "Can't find a suitable
pgp executable")) (mc-verify) (setq package-get-continue-update-base t))
(if package-entries-are-signed (progn (setq package-get-continue-update-base nil)
(autoload ... "mc-setversion") (or ... ...) (mc-verify) (setq
package-get-continue-update-base t)) (if (yes-or-no-p "Package Index is not PGP
signed. Continue anyway? ") (setq package-get-continue-update-base t) (error
"Package database not updated") (setq package-get-continue-update-base nil)))
(if package-get-require-signed-base-updates (if package-entries-are-signed (progn ...
... ... ... ...) (if ... ... ... ...)))
(save-excursion (set-buffer buf) (goto-char (point-min)) (setq content-beg (point))
(setq content-end (save-excursion ... ...)) (when (re-search-forward
package-get-pgp-signed-begin-line nil t) (setq beg ...) (setq content-beg ...)) (when
(re-search-forward package-get-pgp-signature-begin-line nil t) (setq content-end ...)
(setq package-entries-are-signed t)) (when (re-search-forward
package-get-pgp-signature-end-line nil t) (setq end ...)) (setq
package-get-continue-update-base t) (if package-get-require-signed-base-updates (if
package-entries-are-signed ... ...)) (if package-get-continue-update-base (progn ...
...)))
(let (content-beg content-end beg end) (save-excursion (set-buffer buf) (goto-char ...)
(setq content-beg ...) (setq content-end ...) (when ... ... ...) (when ... ... ...) (when
... ...) (setq package-get-continue-update-base t) (if
package-get-require-signed-base-updates ...) (if package-get-continue-update-base ...)))
package-get-update-base-from-buffer(#<buffer "*package database*">)
#<compiled-function (&optional db-file force-current) "...(62)"
[force-current buf db-file expand-file-name package-get-locate-index-file file-exists-p
error "Package-get database file `%s' does not exist" file-readable-p
"Package-get database file `%s' not readable" get-buffer-create
"*package database*" (...) erase-buffer insert-file-contents-literally
package-get-update-base-from-buffer file-remote-p package-get-maybe-save-index] 3
("c:\\Hacking\\XEmacs\\xemacs-21.5\\lisp\\package-get.elc" . 10952) (let (...)
(list ...))>("C:\\Program
Files\\XEmacs\\XEmacs-21.5-b3\\etc\\package-index.LATEST.pgp")
call-interactively(package-get-update-base)
OK, small patch to mailcrypt.el is in order.
4.
OK, now I have to admit I'm new to PGP.
Following failure is due to this:
gpg: Signature made 07/30/99 03:48:55 using DSA key ID DCF80B6B
gpg: Can't check signature: public key not found
Signaling: (error "The message was corrupt.")
signal(error ("The message was corrupt."))
cerror("The message was corrupt.")
apply(cerror "The message was corrupt." nil)
error("The message was corrupt.")
mc-gpg-verify-parser(#<buffer " *mailcrypt stdout temp"> #<buffer
" *mailcrypt stderr temp"> #<buffer " *mailcrypt status
temp"> 2 nil)
funcall(mc-gpg-verify-parser #<buffer " *mailcrypt stdout temp">
#<buffer " *mailcrypt stderr temp"> #<buffer " *mailcrypt status
temp"> 2 nil)
(setq parser-result (funcall parser mybuf stderr-buf status-buf rc parserdata))
(progn (setq mybuf (get-buffer-create " *mailcrypt stdout temp")) (set-buffer
mybuf) (erase-buffer) (set-buffer obuf) (buffer-disable-undo mybuf) (if passwd (setq args
...)) (setq args (append ... args)) (setq args (append ... args)) (setq args (append ...
args)) (if mc-gpg-extra-args (setq args ...)) (mc-gpg-debug-print (format "prog is
%s, args are %s" program ...)) (setq proc (apply ... "*GPG*" mybuf program
args)) (if passwd (progn ... ...)) (process-send-region proc beg end) (process-send-eof
proc) (while (eq ... ...) (accept-process-output proc 5)) (setq status (process-status
proc)) (setq rc (process-exit-status proc)) (mc-gpg-debug-print (format "prog
finished, rc=%s" rc)) (delete-process proc) (set-buffer mybuf) (goto-char
(point-max)) (if (re-search-backward "\nProcess \\*GPG.*\n\\'" nil t)
(delete-region ... ...)) (goto-char (point-min)) (while (search-forward "
\n" nil t) (replace-match "\n")) (if (or ... ...) (error "%s exited
abnormally: '%s'" program rc)) (if (= 127 rc) (error "%s could not be
found" program)) (setq stderr-buf (get-buffer-create " *mailcrypt stderr
temp")) (buffer-disable-undo stderr-buf) (set-buffer stderr-buf) (erase-buffer)
(insert-file-contents stderr-tempfilename) (setq status-buf (get-buffer-create "
*mailcrypt status temp")) (buffer-disable-undo status-buf) (set-buffer status-buf)
(erase-buffer) (insert-file-contents status-tempfilename) (set-buffer mybuf) (setq
parser-result (funcall parser mybuf stderr-buf status-buf rc parserdata))
(mc-gpg-debug-print (format " parser returned %s" parser-result)) (if (car
parser-result) (progn ... ... ... ...)) (cdr parser-result))
(unwind-protect (progn (setq mybuf ...) (set-buffer mybuf) (erase-buffer) (set-buffer
obuf) (buffer-disable-undo mybuf) (if passwd ...) (setq args ...) (setq args ...) (setq
args ...) (if mc-gpg-extra-args ...) (mc-gpg-debug-print ...) (setq proc ...) (if passwd
...) (process-send-region proc beg end) (process-send-eof proc) (while ... ...) (setq
status ...) (setq rc ...) (mc-gpg-debug-print ...) (delete-process proc) (set-buffer
mybuf) (goto-char ...) (if ... ...) (goto-char ...) (while ... ...) (if ... ...) (if ...
...) (setq stderr-buf ...) (buffer-disable-undo stderr-buf) (set-buffer stderr-buf)
(erase-buffer) (insert-file-contents stderr-tempfilename) (setq status-buf ...)
(buffer-disable-undo status-buf) (set-buffer status-buf) (erase-buffer)
(insert-file-contents status-tempfilename) (set-buffer mybuf) (setq parser-result ...)
(mc-gpg-debug-print ...) (if ... ...) (cdr parser-result)) (if (and proc ...)
(interrupt-process proc)) (set-buffer obuf) (delete-file stderr-tempfilename) (delete-file
status-tempfilename) (if (not mc-gpg-debug-buffer) (progn ... ... ...)))
(let ((obuf ...) (process-connection-type nil) (shell-file-name shell-file-name) mybuf
stderr-tempfilename stderr-buf status-tempfilename status-buf proc rc status
parser-result) (mc-gpg-debug-print (format "(mc-gpg-process-region beg=%s end=%s
passwd=%s program=%s args=%s parser=%s bufferdummy=%s)" beg end passwd program args
parser bufferdummy)) (setq stderr-tempfilename (make-temp-name ...)) (setq
status-tempfilename (make-temp-name ...)) (unwind-protect (progn ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ... ... ... ... ...) (if ... ...) (set-buffer obuf)
(delete-file stderr-tempfilename) (delete-file status-tempfilename) (if ... ...)))
mc-gpg-process-region(1 46330 nil "gpg" ("--batch"
"--verify") mc-gpg-verify-parser #<buffer "*MailCrypt*">)
mc-gpg-verify-region(1 46330)
mc-verify-signature()
mc-verify()
(progn (setq package-get-continue-update-base nil) (autoload (quote mc-setversion)
"mc-setversion") (or (cond ... ... ...) (error "Can't find a suitable
pgp executable")) (mc-verify) (setq package-get-continue-update-base t))
(if package-entries-are-signed (progn (setq package-get-continue-update-base nil)
(autoload ... "mc-setversion") (or ... ...) (mc-verify) (setq
package-get-continue-update-base t)) (if (yes-or-no-p "Package Index is not PGP
signed. Continue anyway? ") (setq package-get-continue-update-base t) (error
"Package database not updated") (setq package-get-continue-update-base nil)))
(if package-get-require-signed-base-updates (if package-entries-are-signed (progn ...
... ... ... ...) (if ... ... ... ...)))
(save-excursion (set-buffer buf) (goto-char (point-min)) (setq content-beg (point))
(setq content-end (save-excursion ... ...)) (when (re-search-forward
package-get-pgp-signed-begin-line nil t) (setq beg ...) (setq content-beg ...)) (when
(re-search-forward package-get-pgp-signature-begin-line nil t) (setq content-end ...)
(setq package-entries-are-signed t)) (when (re-search-forward
package-get-pgp-signature-end-line nil t) (setq end ...)) (setq
package-get-continue-update-base t) (if package-get-require-signed-base-updates (if
package-entries-are-signed ... ...)) (if package-get-continue-update-base (progn ...
...)))
(let (content-beg content-end beg end) (save-excursion (set-buffer buf) (goto-char ...)
(setq content-beg ...) (setq content-end ...) (when ... ... ...) (when ... ... ...) (when
... ...) (setq package-get-continue-update-base t) (if
package-get-require-signed-base-updates ...) (if package-get-continue-update-base ...)))
package-get-update-base-from-buffer(#<buffer "*package database*">)
#<compiled-function (&optional db-file force-current) "...(62)"
[force-current buf db-file expand-file-name package-get-locate-index-file file-exists-p
error "Package-get database file `%s' does not exist" file-readable-p
"Package-get database file `%s' not readable" get-buffer-create
"*package database*" (...) erase-buffer insert-file-contents-literally
package-get-update-base-from-buffer file-remote-p package-get-maybe-save-index] 3
("c:\\Hacking\\XEmacs\\xemacs-21.5\\lisp\\package-get.elc" . 10952) (let (...)
(list ...))>("C:\\Program
Files\\XEmacs\\XEmacs-21.5-b3\\etc\\package-index.LATEST.pgp")
call-interactively(package-get-update-base)
5.
Trying to snarf
/ftp@ftp.xemacs.org:/pub/xemacs/pgp-keys/steve_youngs.asc
with mailcrypt-snarf, I get:
I have this installed:
gpg (GnuPG) 1.0.6
Copyright (C) 2001 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.
Home: c:/gnupg
Supported algorithms:
Cipher: 3DES, CAST5, BLOWFISH, RIJNDAEL, RIJNDAEL192, RIJNDAEL256, TWOFISH
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA, ELG
Hash: MD5, SHA1, RIPEMD160
Signaling: (error "No key import status: your GnuPG is too old.")
signal(error ("No key import status: your GnuPG is too old."))
cerror("No key import status: your GnuPG is too old.")
apply(cerror "No key import status: your GnuPG is too old." nil)
error("No key import status: your GnuPG is too old.")
mc-gpg-snarf-parser(#<buffer " *mailcrypt stdout temp"> #<buffer
" *mailcrypt stderr temp"> #<buffer " *mailcrypt status
temp"> 0 nil)
funcall(mc-gpg-snarf-parser #<buffer " *mailcrypt stdout temp">
#<buffer " *mailcrypt stderr temp"> #<buffer " *mailcrypt status
temp"> 0 nil)
(setq parser-result (funcall parser mybuf stderr-buf status-buf rc parserdata))
(progn (setq mybuf (get-buffer-create " *mailcrypt stdout temp")) (set-buffer
mybuf) (erase-buffer) (set-buffer obuf) (buffer-disable-undo mybuf) (if passwd (setq args
...)) (setq args (append ... args)) (setq args (append ... args)) (setq args (append ...
args)) (if mc-gpg-extra-args (setq args ...)) (mc-gpg-debug-print (format "prog is
%s, args are %s" program ...)) (setq proc (apply ... "*GPG*" mybuf program
args)) (if passwd (progn ... ...)) (process-send-region proc beg end) (process-send-eof
proc) (while (eq ... ...) (accept-process-output proc 5)) (setq status (process-status
proc)) (setq rc (process-exit-status proc)) (mc-gpg-debug-print (format "prog
finished, rc=%s" rc)) (delete-process proc) (set-buffer mybuf) (goto-char
(point-max)) (if (re-search-backward "\nProcess \\*GPG.*\n\\'" nil t)
(delete-region ... ...)) (goto-char (point-min)) (while (search-forward "
\n" nil t) (replace-match "\n")) (if (or ... ...) (error "%s exited
abnormally: '%s'" program rc)) (if (= 127 rc) (error "%s could not be
found" program)) (setq stderr-buf (get-buffer-create " *mailcrypt stderr
temp")) (buffer-disable-undo stderr-buf) (set-buffer stderr-buf) (erase-buffer)
(insert-file-contents stderr-tempfilename) (setq status-buf (get-buffer-create "
*mailcrypt status temp")) (buffer-disable-undo status-buf) (set-buffer status-buf)
(erase-buffer) (insert-file-contents status-tempfilename) (set-buffer mybuf) (setq
parser-result (funcall parser mybuf stderr-buf status-buf rc parserdata))
(mc-gpg-debug-print (format " parser returned %s" parser-result)) (if (car
parser-result) (progn ... ... ... ...)) (cdr parser-result))
(unwind-protect (progn (setq mybuf ...) (set-buffer mybuf) (erase-buffer) (set-buffer
obuf) (buffer-disable-undo mybuf) (if passwd ...) (setq args ...) (setq args ...) (setq
args ...) (if mc-gpg-extra-args ...) (mc-gpg-debug-print ...) (setq proc ...) (if passwd
...) (process-send-region proc beg end) (process-send-eof proc) (while ... ...) (setq
status ...) (setq rc ...) (mc-gpg-debug-print ...) (delete-process proc) (set-buffer
mybuf) (goto-char ...) (if ... ...) (goto-char ...) (while ... ...) (if ... ...) (if ...
...) (setq stderr-buf ...) (buffer-disable-undo stderr-buf) (set-buffer stderr-buf)
(erase-buffer) (insert-file-contents stderr-tempfilename) (setq status-buf ...)
(buffer-disable-undo status-buf) (set-buffer status-buf) (erase-buffer)
(insert-file-contents status-tempfilename) (set-buffer mybuf) (setq parser-result ...)
(mc-gpg-debug-print ...) (if ... ...) (cdr parser-result)) (if (and proc ...)
(interrupt-process proc)) (set-buffer obuf) (delete-file stderr-tempfilename) (delete-file
status-tempfilename) (if (not mc-gpg-debug-buffer) (progn ... ... ...)))
(let ((obuf ...) (process-connection-type nil) (shell-file-name shell-file-name) mybuf
stderr-tempfilename stderr-buf status-tempfilename status-buf proc rc status
parser-result) (mc-gpg-debug-print (format "(mc-gpg-process-region beg=%s end=%s
passwd=%s program=%s args=%s parser=%s bufferdummy=%s)" beg end passwd program args
parser bufferdummy)) (setq stderr-tempfilename (make-temp-name ...)) (setq
status-tempfilename (make-temp-name ...)) (unwind-protect (progn ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ... ... ... ... ...) (if ... ...) (set-buffer obuf)
(delete-file stderr-tempfilename) (delete-file status-tempfilename) (if ... ...)))
mc-gpg-process-region(1 1354 nil "gpg" ("--import"
"--batch") mc-gpg-snarf-parser #<buffer "*MailCrypt*">)
mc-gpg-snarf-keys(1 1354)
byte-code("..." [found start mc-default-scheme scheme schemes limits
mc-message-delimiter-positions assoc key-begin-line key-end-line throw done snarf-func]
5)
mc-snarf-keys()
#<compiled-function nil "...(17)" [func mc-modes-alist major-mode
mode-alist snarf mc-snarf-keys] 3 ("c:\\Program
Files\\XEmacs\\xemacs-packages\\lisp\\mailcrypt\\mc-toplev.elc" . -6742) nil>()
call-interactively(mailcrypt-snarf)
command-execute(mailcrypt-snarf t)
execute-extended-command(nil)
call-interactively(execute-extended-command)
Where do I go from here?
Best regards,
Adrian
SY> Test it by:
SY> - grab the latest CVS sources and build a new XEmacs
SY> - (setq package-get-require-signed-base-updates t)
SY> - You'll need MailCrypt installed. Which should snarf my key
SY> the first time you get the signed index file. [1]
SY> - Tools -> Packages -> Add Download Site -> [2]
SY> - Tools -> Packages -> Update Package Index or List &
Install
SY> Once that completes just do 'C-h l' and look at the recent messages
SY> for something similar to:
SY> gpg: Good signature from "Steve Youngs
<youngs(a)xemacs.org>"
SY> When you send me your success/failure report, please also tell me
SY> which version of PGP you are using.
SY> Thanks very much for your help.
SY> Footnotes:
SY> [1] If it doesn't, you should be able to find my key on most key
SY> servers (the keyid is in my sig). It's also in:
SY> /ftp.xemacs.org:/pub/xemacs/pgp-keys/steve_youngs.asc
SY> [2] Both Pre-Releases and the main
xemacs.org directories have signed
SY> index files in them.
SY> --
SY> |---<Steve Youngs>---------------<GnuPG KeyID: 10D5C9C5>---|
SY> | XEmacs - It's not just an editor. |
SY> | It's a way of life. |
SY> |------------------------------------<youngs(a)xemacs.org>---|
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/