;ELC   
;;; Compiled by nelhage@localhost.localdomain on Tue Dec 13 12:30:44 2005
;;; from file /home/nelhage/Desktop/mailcrypt-3.5.8/mc-gpg.el
;;; in Emacs version 22.0.50.7
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`mc-gpg.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(require 'mailcrypt)
#@35 *GPG ID of your default identity.
(defvar mc-gpg-user-id (user-login-name) (#$ . -615))
#@22 *The GPG executable.
(defvar mc-gpg-path "gpg" (#$ . -709))
#@57 *If t, pop up the GPG output window when snarfing keys.
(defvar mc-gpg-display-snarf-output nil (#$ . -775))
#@81 *If t, always fetch missing keys. If 'never, never fetch. If nil,
ask the user.
(defvar mc-gpg-always-fetch 'never (#$ . -890))
#@44 *Public keyring to use instead of default.
(defvar mc-gpg-alternate-keyring nil (#$ . -1024))
#@84 *Comment field to appear in ASCII armor output.  If nil, let GPG use its 
default.
(defvar mc-gpg-comment (format "Processed by Mailcrypt %s <http://mailcrypt.sourceforge.net/>" mc-version) (#$ . -1124))
#@42 Text for start of GPG message delimiter.
(defconst mc-gpg-msg-begin-line "^-----BEGIN PGP MESSAGE-----?$" (#$ . 1334))
#@40 Text for end of GPG message delimiter.
(defconst mc-gpg-msg-end-line "^-----END PGP MESSAGE-----?$" (#$ . 1460))
#@40 Text for start of GPG signed messages.
(defconst mc-gpg-signed-begin-line "^-----BEGIN PGP SIGNED MESSAGE-----?$" (#$ . 1580))
#@38 Text for end of GPG signed messages.
(defconst mc-gpg-signed-end-line "^-----END PGP SIGNATURE-----?$" (#$ . 1714))
#@35 Text for start of GPG public key.
(defconst mc-gpg-key-begin-line "^-----BEGIN PGP PUBLIC KEY BLOCK-----?$" (#$ . 1837))
#@33 Text for end of GPG public key.
(defconst mc-gpg-key-end-line "^-----END PGP PUBLIC KEY BLOCK-----?$" (#$ . 1965))
#@160 Extra arguments to pass to all invocations of gpg. Used during debugging to
set --homedir, to use special test keys instead of the developer's normal
keyring.
(defvar mc-gpg-extra-args nil (#$ . 2088))
#@214 A buffer for debugging messages. If nil, no debugging messages are logged.
BEWARE! Sensitive data (including your passphrase) is put here. Set this with:
 (setq mc-gpg-debug-buffer (get-buffer-create "mc debug"))
(defvar mc-gpg-debug-buffer nil (#$ . 2297))
(defalias 'mc-gpg-debug-print #[(string) "\302\300!\205 \205 \303	\"\207" [mc-gpg-debug-buffer string boundp print] 3])
(defalias 'mc-gpg-insert-parser #[(stdoutbuf stderrbuf statusbuf rc parserdata) "\303\304\305	\n$!\210\n\306U\203 \307\207\310\211\nr	q\210\311 )F\207" [stdoutbuf stderrbuf rc mc-gpg-debug-print format "(mc-gpg-generic-parser stdoutbuf=%s stderrbuf=%s rc=%s" 0 (t (t)) nil buffer-string] 6])
(defalias 'mc-gpg-null-parser #[(stdoutbuf stderrbuf statusbuf rc parserdata) "\301D\207" [rc nil] 2])
(defalias 'mc-gpg-process-region #[(beg end passwd program args parser bufferdummy &optional parserdata) "p\306\307\306\211\211\211\211\211\211\211\211?@ABCD\310\311\312EFGHIJK&!\210\313\314\315L\"!@\313\314\316L\"!\317\216\320\321!\211Aq\210\322 \210Dq\210\323A!\210G\203f \324\325I\"I\324\326@PCI\"I\324\327PCI\"I\324\330I\"IM\203\217 \324MI\"I\310\311\331H\332\333I\334##!\210\335\336\337AHI%G\203\276 \340G\341P\"\210N\204\276 \342\343!\210\344EF#\210\345!\210\346!\347=\203\332 \350\351\"\210\202\312 \346!\352!\310\311\353\n\"!\210\354!\210Aq\210db\210\355\356\306\343#\203\357\224\357\225|\210eb\210\360\361\306\343#\203\362\363!\210\202	\364=\204 	\365=\203'\366\367H\n#\210\n\370U\2033\366\371H\"\210\320\372!?\323?!\210?q\210\322 \210\373@!\210\320\374!\323\f!\210\fq\210\322 \210\373!\210Aq\210JA?\f\nO%\310\311\375\"!\210@\203\212Dq\210EF|\210Eb\210\376A!\210A.\207" [parser-result status rc proc status-buf status-tempfilename nil "/bin/sh" mc-gpg-debug-print format "(mc-gpg-process-region beg=%s end=%s passwd=%s program=%s args=%s parser=%s bufferdummy=%s)" make-temp-name expand-file-name "mailcrypt-gpg-stderr-" "mailcrypt-gpg-status-" ((byte-code "\203 \305!\306=\203 \307!\210	q\210\310\n!\210\310!\210\311\304!\203% \f\204C \312\313!\203/ \314\315!\210\312\316!\2039 \314\317!\210\312\320!\203C \314\321!\210\305\207" [proc obuf stderr-tempfilename status-tempfilename mc-gpg-debug-buffer process-status run interrupt-process delete-file boundp get-buffer " *mailcrypt stdout temp" kill-buffer " *mailcrypt stdout temp" " *mailcrypt stderr temp" " *mailcrypt stderr temp" " *mailcrypt status temp" " *mailcrypt status temp"] 2)) get-buffer-create " *mailcrypt stdout temp" erase-buffer buffer-disable-undo append ("--passphrase-fd" "0") "2>" "3>" ("--status-fd" "3") "prog is %s, args are %s" mapconcat #[(x) "\301\302\"\207" [x format "'%s'"] 3] " " apply start-process-shell-command "*GPG*" process-send-string "\n" mc-deactivate-passwd t process-send-region process-send-eof process-status run accept-process-output 5 process-exit-status "prog finished, rc=%s" delete-process re-search-backward "\nProcess \\*GPG.*\n\\'" 0 search-forward "\n" replace-match "\n" stop signal error "%s exited abnormally: '%s'" 127 "%s could not be found" " *mailcrypt stderr temp" insert-file-contents " *mailcrypt status temp" " parser returned %s" insert-buffer-substring stderr-buf stderr-tempfilename mybuf shell-file-name process-connection-type obuf beg end passwd program args parser bufferdummy mc-temp-directory mc-gpg-extra-args mc-passwd-timeout parserdata] 13])
#@143 Association list mapping GPG IDs to canonical "keys".  A "key"
is a pair (USER-ID . KEY-ID) which identifies the canonical IDs of the
GPG ID.
(defvar mc-gpg-key-cache nil (#$ . 5769))
(defalias 'mc-gpg-lookup-key #[(str &optional type) "\306	\307\230?\205\226 \310	\n\"\243\311p\306\211#\204\211 \312\216\313\314!\315\316\317\320	\257$\2035 \321\322$D\"%\203@ \321%\"\323\324\325\"!\210\326\327!\205T \327\330!\205T \330&\331\332'\306\306&\210)q\210eb\210\333\306\334#\203\210 \335\336\224\336\225\"\337\335\340\224\340\225\"PB#	#B\nB)#\204\223 \341\342	\"\210#,)\207" [args str mc-gpg-key-cache buffer obuf key-regexp nil "***** CONVENTIONAL *****" assoc "^\\(sec\\|pub\\):[^:]*:[^:]*:[^:]*:\\([^:]*\\):[^:]*:[^:]*:[^:]*:[^:]*:\\([^:]*\\):" ((set-buffer obuf)) generate-new-buffer " *mailcrypt temp" "--with-colons" "--no-greeting" "--batch" "--list-secret-keys" append "--keyring" mc-gpg-debug-print format "lookup: args are %s" fboundp coding-system-p utf-8 apply call-process re-search-forward t buffer-substring-no-properties 3 "0x" 2 error "No GPG secret key for %s" result mc-gpg-alternate-keyring mc-gpg-extra-args coding-system-for-read mc-gpg-path] 8])
(defalias 'mc-gpg-encrypt-region #[(recipients start end &optional id sign) "\306	!p\307\211\211\211\211\211\211-./01\310\311\31223456&!\210\313\314\315\3162\2039 \317\202: \320\257-2\203G \321\202H \322/\311\323/\".7\203c \324\325\311\3267\"D-\"-8\203r \324\3278D-\"-9\330=\204\305 9\204\211 6\204\211 \331\332!\203\305 \3335\206\221 :\334\"\335A\311\336@A#\"\324\337A\340E-\"-\311\341/@#.2\204\305 -\237\211;AA)\237-2\203\340 <\203\340 \206\332 \333:\334\"\211A2B22\203\363 \324\342\324\343\3442\"\"-\"-\345\346.\"\210\34734\f=-\3501&\211@\204\351\352.\3538#\210.\n\354\207" [process-environment mc-buffer-name gpg-id result passwd key get-buffer-create nil mc-gpg-debug-print format "(mc-gpg-encrypt-region recipients=%s start=%s end=%s id=%s sign=%s)" "--batch" "--armor" "--textmode" "--always-trust" "--encrypt" "--store" "Encrypting" "Armoring" "%s..." append "--comment" "'%s'" "--keyring" never y-or-n-p "Sign the message? " mc-gpg-lookup-key encrypt mc-activate-passwd "GPG passphrase for %s (%s): " "--local-user" "--sign" "%s+signing as %s ..." apply mapcar #[(x) "\301\302\303QD\207" [x "--recipient" "\"" "\""] 4] message "%s" mc-gpg-process-region mc-gpg-insert-parser error "%s failed: %s" 2 t args msg action obuf buffer recipients start end id sign mc-gpg-comment mc-gpg-alternate-keyring mc-pgp-always-sign mc-gpg-user-id x mc-encrypt-for-me mc-gpg-path] 11])
(defalias 'mc-gpg-sigstatus-parser #[nil "\306\211\211\211eb\210\307\310\306\311#\203\211 \312\313!eb\210\314\230\204& \315\230\2032 \307\316\306\311#\2032 \312\317!eb\210\320\230\203e \307\321\306\311#\203e \306\312\313!eb\210\307\322\306\311#\203X \312\323!\203b \324\230\203d \f*eb\210\325\230\203z \307\326\306\311#\203z \312\327!eb\210\307\330\306\311#\203\211 \312\313!\n	F,\207" [sigtrust sigdate sigid sigtype sigid-temp errsig-rc nil re-search-forward "^\\[GNUPG:\\] +\\(GOOD\\|BAD\\|ERR\\)SIG\\b" t match-string 1 "GOOD" "BAD" "^\\[GNUPG:\\] +\\(GOOD\\|BAD\\)SIG +\\(\\S +\\) +\\(.*\\)$" 3 "ERR" "^\\[GNUPG:\\] +ERRSIG +\\(\\S +\\)" "^\\[GNUPG:\\] +ERRSIG +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\)" 6 "9" "GOOD" "^\\[GNUPG:\\] +SIG_ID +\\(\\S +\\) +\\(\\S +\\)\\b" 2 "^\\[GNUPG:\\] +\\(TRUST_\\S +\\)$"] 4])
(defalias 'mc-gpg-decrypt-parser #[(stdoutbuf stderrbuf statusbuf rc parserdata) "\306\211\211\211\211\211\211\211\211\211+,-./q\210eb\210\307\310\306\311#\203, \312\313!.eb\210\307\314\306\311#\203: \311-eb\210\307\315\306\311#\203L \316\312\313!P,eb\210\307\317\306\311#\203Z \311+eb\210\307\320\306\311#\203g \311eb\210\307\321\306\311#\203t \311\322 \2110@0A@\32308\32408)\325\326\327.-,+\f\n	1&\f!\210.\204,\204\204\203\370 \330\230\203\306 \311\331\311\211\n	FF\202\332\230\203\330 \311\331\311\306\n	FF\202\333\230\203\362 \n\203\352 \311\331\311\nF\202\311\211\211\306F\202\334\335!\2021\336U\204\334\337!\202\311\305\311\306F\202.\340\230\204/.\204\202,\204\"\203\2021\336U\204\202\341\230\204\202\204@,\204@\306\211\211\211F\202+\204J2\204_\203V\306\305\342\306F\202\306\311,\306F\202\203k\306\305\306\211F\202\f\204t2\203|\306\311\306\211F\202\334\343!\202.\344\230\204\261.\204\240,\203\2401\336U\204\240\345\230\204\261.\204,\2031\336U\203\203\371\346\230\203\307\311\211\211\211\n	FF\202\347\230\203\331\311\211\211\306\n	FF\202\350\230\203\363\n\203\353\311\211\211\nF\202\311\211\211\306F\202\334\351!\202\203\311\305\311\306F\202\311\211\211\306F\202\334\352.\".\n\207" [sigtrust sigdate sigid sigtype badpass symmetric nil re-search-forward "^\\[GNUPG:\\] +DECRYPTION_\\(OKAY\\|FAILED\\)\\b" t match-string 1 "^\\[GNUPG:\\] +NO_SECKEY\\b" "^\\[GNUPG:\\] +NEED_PASSPHRASE +\\(\\S +\\)" "0x" "^\\[GNUPG:\\] +MISSING_PASSPHRASE\\b" "^\\[GNUPG:\\] +NEED_PASSPHRASE_SYM\\b" "^\\[GNUPG:\\] +BAD_PASSPHRASE\\b" mc-gpg-sigstatus-parser 2 3 mc-gpg-debug-print format "decrypt-parser: decryptstatus=%s no-seckey=%s keyid=%s missing-passphrase=%s symmetric=%s badpass=%s sigtype=%s sigid=%s sigdate=%s sigtrust=%s rc=%s" "GOOD" signed "BAD" "ERR" error "sigtype was bogus. Shouldn't happen." 0 "The message was corrupt." "FAILED" "ERR" "***** CONVENTIONAL *****" "decryption failed, but I don't know why. Shouldn't happen." "OKAY" "ERR" "GOOD" "BAD" "ERR" "sigtype was bogus. Shouldn't happen." "decryptstatus was bogus '%s'. Shouldn't happen." missing-passphrase keyid no-seckey decryptstatus statusbuf sigstuff rc parserdata] 15])
(defalias 'mc-gpg-format-sigline #[(goodp sigid sigtrust sigdate) "\203 \304\305	\n$\207\304\306	\"\207" [goodp sigid sigtrust sigdate format "Good signature from '%s' %s made %s" "BAD SIGNATURE claiming to be from '%s'"] 5])
(defalias 'mc-gpg-decrypt-region #[(start end &optional id) "\306	!p\307\211\211\211\211\2112345\310\311\312678$!\210\313 \2108\203\\ \3148\315\"\2112\203H \3162A\311\3172@2A#\"\202M \3168\320\"\211\321\230\203\\ \322\323!\210\324\325!\210\32639\203n \3273\3309D\"3\3273\331\"3\332\333!\210\33467\f:3\33558&\211@\204\226 \324\336!\202@A@\204\246 \322\323!\210\324\337!\202@A@\323\232\204\272 \34067A@#\202@\3418\203;\3418\211;:\204\342\311\343;\"!\210<\344=\204<\204\350 \345\311\346;\"!\203\347\307;B!\203\350 \210\351\352!\210\340678#\2027\353\2027;@\203#\342\354\323;A@\341;8\355;8$!\210\356\2027\342\354\307;A@\341;8\355;8$\323\"\210\357)\202@\332\360!\210\361.	\207" [process-environment mc-buffer-name gpg-id result passwd new-key get-buffer-create nil mc-gpg-debug-print format "(mc-gpg-decrypt-region start=%s end=%s id=%s)" undo-boundary mc-gpg-lookup-key encrypt mc-activate-passwd "GPG passphrase for %s (%s): " "GPG passphrase for conventional decryption: " "" mc-deactivate-passwd t error "Empty passphrases are bad, mmkay?" ("--batch") append "--keyring" ("--decrypt") message "Decrypting..." mc-gpg-process-region mc-gpg-decrypt-parser "This message is not addressed to you" "That passphrase was wrong" mc-gpg-decrypt-region 2 mc-message-sigstatus "cannot check signature from keyid %s" never y-or-n-p "Key %s not found; attempt to fetch? " mc-gpg-fetch-key undo-start undo-more 1 (t) mc-gpg-format-sigline 3 (t . t) (t) "Decrypting... Done." (t) key args obuf buffer start end id mc-gpg-alternate-keyring mc-gpg-path sig mc-gpg-always-fetch] 10])
(defalias 'mc-gpg-sign-region #[(start end &optional id unclear) "\306	!\307\211\211\211\310 \206 !\311\"\312A\313\314@A#\"\315\316\317A\"\2034 \320\2025 \321\257#\203H \322\323\313\324#\"D\f\"$\203S \322$\f\"\325\326@\"\210\327%&'\f\330&\211@\203v \325\331@\"\210\202\201 \332\333!\210\334\335\336\n8\"\210\n@.\207" [process-environment mc-buffer-name result key args passwd get-buffer-create nil mc-gpg-lookup-key sign mc-activate-passwd format "GPG passphrase for %s (%s): " "--batch" "--armor" "--local-user" "--sign" "--clearsign" append "--comment" "'%s'" message "Signing as %s ..." mc-gpg-process-region mc-gpg-insert-parser "Signing as %s ... Done." mc-deactivate-passwd t error "Signature failed: %s" 2 buffer id mc-gpg-user-id unclear mc-gpg-comment mc-gpg-extra-args start end mc-gpg-path] 9])
(defalias 'mc-gpg-verify-parser #[(stdoutbuf stderrbuf statusbuf rc parserdata) "\306\211\211\211\fq\210\307 \211@A@\3108\3118)\312\313\314\n	%!\210\315U\2047 \2047 \316\317!\210\320\230\203C \306\nD\202Z \321\230\203S \306\322\n	FD\202Z \306\211\n	FD,\207" [sigtrust sigdate sigid sigtype statusbuf sigstuff nil mc-gpg-sigstatus-parser 2 3 mc-gpg-debug-print format "decrypt-parser: sigtype=%s sigid=%s sigdate=%s sigtrust=%s" 0 error "The message was corrupt." "ERR" "GOOD" t rc] 8])
(defalias 'mc-gpg-verify-region #[(start end &optional no-fetch) "\306!p\307\211\310\203 \311\312\n#\313\314!\210\315\307 \n\316\f&\317\320\321	\"!\210	@\211:\204o !\204h \"\322=\204h \"\204Q \323\320\324	\"!\203h \325\307	B!\203h q\203h \326\327#\202\232 \330\331	\"\202\232 	@\203\207 \313\332\327	A@\333	8\334	8$!\210\327\202\232 \335 \210\313\332\307	A@\333	8\334	8$!\210\307,\207" [mc-buffer-name result args obuf buffer mc-gpg-alternate-keyring get-buffer-create nil ("--batch" "--verify") append "--keyring" message "Verifying..." mc-gpg-process-region mc-gpg-verify-parser mc-gpg-debug-print format "process-region returned %s" never y-or-n-p "Key %s not found; attempt to fetch? " mc-gpg-fetch-key mc-gpg-verify-region t error "Can't check signature: Public key %s not found" mc-gpg-format-sigline 2 3 ding start end mc-gpg-path no-fetch mc-gpg-always-fetch] 9])
(defalias 'mc-gpg-insert-public-key #[(&optional id) "\306!\307\211\f\206 \310\311\312\313\f\314QF\203' \315\316\317\320\"D\n\"\2034 \315\321D\n\"\322``\307\n\323&\211@\203O \324\317\325\f\"!\210\202V \324\326\327	8\"\210	@+\207" [mc-buffer-name result args buffer id mc-gpg-user-id get-buffer-create nil "--export" "--armor" "--batch" "\"" "\"" append "--comment" format "'%s'" "--keyring" mc-gpg-process-region mc-gpg-insert-parser message "Key for user ID: %s" "failed: %s" 2 mc-gpg-comment mc-gpg-alternate-keyring mc-gpg-path] 9])
(defalias 'mc-gpg-snarf-parser #[(stdoutbuf stderrbuf statusbuf rc parserdata) "\306=\203j \307\211\211\211\211\211q\210eb\210\310\311\307\312#\203d \313\314\315!!\313\314\316!!\313\314\317!!\313\314\320!!\\\313\314\321!!\313\314\322!!\\Z\fZZ\314\323!\324\230?\307\f\n	\257\202g \325\326!.\207\325rq\210\327 )!\207" [rc secretp changed old new bad 0 nil re-search-forward "^\\[GNUPG:\\] +IMPORT_RES +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\) +\\(\\S +\\)" t string-to-number match-string 1 2 3 11 5 12 10 "0" error "No key import status: your GnuPG is too old." buffer-string count statusbuf stderrbuf] 7])
(defalias 'mc-gpg-snarf-keys #[(start end) "\306!\307\211\211\310\203 \311\n\312D\"\313\314!\210\315\307\n\316\f&\317\320@\"\321A@!\204@ 	\317\322A@\"P\321\3238!\204Q 	\317\324\3238\"P\321\3258!\204b 	\317\326\3258\"P\321\3278!\204s 	\317\330\3278\"P\3318\203} 	\332P\313	!\210\3238,\207" [mc-buffer-name msg args results buffer mc-gpg-alternate-keyring get-buffer-create nil ("--import" "--batch") append "--keyring" message "Snarfing..." mc-gpg-process-region mc-gpg-snarf-parser format "%d keys seen" zerop ", %d bad" 2 ", %d new" 3 ", %d old" 4 ", %d changed" 5 ", SECRET KEYS IMPORTED" start end mc-gpg-path] 8])
(defalias 'mc-scheme-gpg #[nil "\306\307B\310\311B\312\313B\314\315B\316\317B\320\321B\322B\323	B\324\nB\325B\326\fB\327B\330B\257\207" [mc-gpg-msg-begin-line mc-gpg-msg-end-line mc-gpg-signed-begin-line mc-gpg-signed-end-line mc-gpg-key-begin-line mc-gpg-key-end-line encryption-func mc-gpg-encrypt-region decryption-func mc-gpg-decrypt-region signing-func mc-gpg-sign-region verification-func mc-gpg-verify-region key-insertion-func mc-gpg-insert-public-key snarf-func mc-gpg-snarf-keys msg-begin-line msg-end-line signed-begin-line signed-end-line key-begin-line key-end-line user-id mc-gpg-user-id] 14])
#@72 *If t, always attempt to fetch missing keys, or never fetch if
'never.
(defvar mc-gpg-always-fetch 'never (#$ . -18267))
#@272 Attempt to fetch a key for addition to GPG keyring.  Interactively,
prompt for string matching key to fetch.

This function is not yet implemented. The GPG documentation suggests a simple
keyserver protocol, but as far as I know it has not yet been implemented
anywhere.
(defalias 'mc-gpg-fetch-key #[(&optional id) "\300\301!\207" [error "Key fetching not yet implemented"] 2 (#$ . 18395)])
