;ELC   
;;; compiled by amu@mit.edu on Wed Dec 30 12:35:46 1998
;;; from file /afs/sipb.mit.edu/contrib/emacs/packages/mailcrypt-3.5.1/mc-gpg.el
;;; emacs version 19.34.1.
;;; bytecomp version FSF 2.10
;;; optimization is on.
;;; this file uses opcodes which do not exist in Emacs 18.

(if (and (boundp 'emacs-version)
	 (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 (quote mailcrypt))
#@35 *GPG ID of your default identity.
(defvar mc-gpg-user-id (user-login-name) (#$ . -517))
#@22 *The GPG executable.
(defvar mc-gpg-path "gpg" (#$ . -611))
#@57 *If t, pop up the GPG output window when snarfing keys.
(defvar mc-gpg-display-snarf-output nil (#$ . -677))
#@44 *Public keyring to use instead of default.
(defvar mc-gpg-alternate-keyring nil (#$ . -792))
#@84 *Comment field to appear in ASCII armor output.  If nil, let GPG use its 
default.
(defvar mc-gpg-comment nil (#$ . -891))
#@42 Text for start of GPG message delimiter.
(defconst mc-gpg-msg-begin-line "-----BEGIN PGP MESSAGE-----" (#$ . 1020))
#@40 Text for end of GPG message delimiter.
(defconst mc-gpg-msg-end-line "-----END PGP MESSAGE-----\n?" (#$ . 1142))
#@40 Text for start of GPG signed messages.
(defconst mc-gpg-signed-begin-line "-----BEGIN PGP SIGNED MESSAGE-----" (#$ . 1261))
#@38 Text for end of GPG signed messages.
(defconst mc-gpg-signed-end-line "-----END PGP SIGNATURE-----\n?" (#$ . 1391))
#@35 Text for start of GPG public key.
(defconst mc-gpg-key-begin-line "^-----BEGIN PGP PUBLIC KEY BLOCK-----?$" (#$ . 1513))
#@33 Text for end of GPG public key.
(defconst mc-gpg-key-end-line "^-----END PGP PUBLIC KEY BLOCK-----?$" (#$ . 1641))
#@47 Regular expression matching an error from GPG
(defconst mc-gpg-error-re "^\\(ERROR:\\|WARNING:\\).*" (#$ . 1763))
#@64 Regular expression matching a GPG signature validation message
(defconst mc-gpg-sigok-re "^gpg: Good signature.*" (#$ . 1883))
#@53 Regular expression matching a GPG key snarf message
(defconst mc-gpg-newkey-re "^[^:]+:[^:]+: \\(key [0-9A-F]+\\): \\(.*\\)$" (#$ . 2016))
#@56 Regular expression matching a GPG missing-key messsage
(defconst mc-gpg-nokey-re "Cannot find the public key matching userid '\\(.+\\)'$" (#$ . 2161))
(byte-code "ÀÁ\nBÁ‡" ["gpg: Signature made .+ using .+ key ID \\(\\S +\\)\ngpg: Can't check signature: Public key not found" mc-gpg-key-expected-re current-load-list] 2)
#@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.
(defconst mc-gpg-extra-args nil (#$ . 2491))
#@76 A buffer for debugging messages. If nil, no debugging messages are logged.
(defconst mc-gpg-debug-buffer nil (#$ . 2701))
(defalias 'mc-gpg-debug-print #[(string) "ÀÁ!… 	… Â	\"‡" [boundp mc-gpg-debug-buffer print string] 3])
(defalias 'mc-gpg-insert-parser #[(stdoutbuf stderrbuf statusbuf rc) "ÀÁÂ\f$!ˆÆUƒ Ç‡ÈÉ\fÊ \"!‡" [mc-gpg-debug-print format "(mc-gpg-generic-parser stdoutbuf=%s stderrbuf=%s rc=%s" stdoutbuf stderrbuf rc 0 (t t) error with-current-buffer buffer-string] 6])
(defalias 'mc-gpg-null-parser #[(stdoutbuf stderrbuf statusbuf rc) "À	D‡" [t rc] 2])
(defalias 'mc-gpg-process-region #[(beg end passwd program args parser bufferdummy) "pÀÁÀ‰‰‰‰‰‰‰‰	\n\fÎÏÐ&!ˆØÙÚ\"!	ØÙÜ\"!ÝŽÞß!‰\nqˆà ˆqˆá\n!ˆƒi âã\"âä	PC\"âåPC\"âæ\"'ƒ“ â'\"ÎÏèéêë##!ˆìíî\n%ƒÂ ïðP\"ˆ1„Â òó!ˆô#ˆõ!ˆö!÷=ƒÞ øù\"ˆ‚Î ö!ú!ÎÏû\f\"!ˆü!ˆ\nqˆdbˆýþÀó#ƒÿ”ÿ•|ˆebˆ�@ �A Àó#ƒ�B ð!ˆ‚	�C =„.�D =ƒ9�E �F \f#ˆÞ�G !á!ˆqˆà ˆ�H 	!ˆÞ�I !á!ˆqˆà ˆ�H !ˆ\nqˆ\n\f$ÎÏ�J \n\"!ˆ\n@ƒŸqˆ|ˆbˆ�K \n!ˆ\nA.‡" [nil "/bin/sh" parser-result status rc proc status-buf status-tempfilename stderr-buf stderr-tempfilename mybuf shell-file-name process-connection-type obuf 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 make-temp-name expand-file-name "mailcrypt-gpg-stderr-" mc-temp-directory "mailcrypt-gpg-status-" ((byte-code "ƒ Á!Â=ƒ Ã!ˆ\fqˆÅ!ˆÅ!‡" [proc process-status run interrupt-process obuf delete-file stderr-tempfilename status-tempfilename] 2)) get-buffer-create " *mailcrypt stdout temp" erase-buffer buffer-disable-undo append ("--passphrase-fd" "0") "2>" "3>" ("--status-fd" "3") mc-gpg-extra-args "prog is %s, args are %s" mapconcat #[(x) "ÀÁ\n\"‡" [format "'%s'" x] 3] " " apply start-process-shell-command "*GPG*" process-send-string "\n" mc-passwd-timeout 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 stop signal error "%s exited abnormally: '%s'" " *mailcrypt stderr temp" insert-file-contents " *mailcrypt status temp" " parser returned %s" insert-buffer-substring] 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 (#$ . 5119))
(defalias 'mc-gpg-lookup-key #[(str &optional type) "À\nÃš?…� Ä\n\"£ÆpÀ	‰\n„€ ËŽÌÍ!ÎÏÐÑ\n¯ƒ9 ÓÔD	\"ƒD Ó	\"Ö×Ø	\"!ˆÙÚÀÀ	&ˆqˆebˆÜ	ÀÝ#ƒ Þß”ß•\"àÞá”á•\"PB\n\n\nBB)\n„Š âã\n\"ˆ\n,)‡" [nil args str "***** CONVENTIONAL *****" assoc mc-gpg-key-cache "^sec:[^:]*:[^:]*:[^:]*:\\([^:]*\\):[^:]*:[^:]*:[^:]*:[^:]*:\\([^:]*\\):$" buffer obuf key-regexp result ((set-buffer obuf)) generate-new-buffer " *mailcrypt temp" "--with-colons" "--no-greeting" "--batch" "--list-secret-keys" mc-gpg-alternate-keyring append "--keyring" mc-gpg-extra-args mc-gpg-debug-print format "lookup: args are %s" apply call-process mc-gpg-path re-search-forward t buffer-substring-no-properties 2 "0x" 1 error "No GPG secret key for %s"] 8])
(defalias 'mc-gpg-encrypt-region #[(recipients start end &optional id sign) "Á\n!pÃ‰‰‰‰‰‰	\n\fÍÎÏ&!ˆÕÖ×Øƒ; Ù‚< Ú¯ƒI Û‚J Ü\nÎÝ\n\"	ƒe ßàÎá\"D\"\"ƒt ßã\"D\"$å=„Í $„‹ „‹ æç!ƒÍ è†“ )ê\"ëAÎì@A#\"ßíî@îQïE\"Îð\n@#	„Í ñŸ!Ÿƒê 2ƒê †ä è)ê\"‰@Bƒý ßóßôõ\"\"\"ö÷	\"ˆø9ú\f&öû	\"ˆ.\nü‡" [process-environment get-buffer-create mc-buffer-name nil gpg-id result passwd key args msg action obuf buffer mc-gpg-debug-print format "(mc-gpg-encrypt-region recipients=%s start=%s end=%s id=%s sign=%s)" recipients start end id sign "--batch" "--armor" "--textmode" "--always-trust" "--encrypt" "--store" "Encrypting" "Armoring" "%s..." mc-gpg-comment append "--comment" "'%s'" mc-gpg-alternate-keyring "--keyring" mc-pgp-always-sign never y-or-n-p "Sign the message? " mc-gpg-lookup-key mc-gpg-user-id encrypt mc-activate-passwd "GPG passphrase for %s (%s): " "--local-user" "\"" "--sign" "%s+signing as %s ..." cddr mc-encrypt-for-me apply mapcar #[(x) "ÀÁ\nÁQD‡" ["--remote-user" "\"" x] 4] message "%s" mc-gpg-process-region mc-gpg-path mc-gpg-insert-parser "%s Done." t] 10])
(defalias 'mc-gpg-decrypt-parser #[(stdoutbuf stderrbuf statusbuf rc) "À‰‰‰‰‰qˆebˆÈÉÀÊ#ƒ# ËÌÍ!PebˆÈÎÀÊ#ƒ2 ÌÍ!ebˆÈÏÀÊ#ƒA ÌÍ!qˆebˆÈÑÀÊ#ƒX À‰‰‰F‚@ebˆÈÒÀÊ#ƒg ÌÍ!ebˆÓšƒ� ÈÔÀÊ#ƒ� ËÌÍ!P‚� ÈÕÀÊ#ƒ� ÌÍ!ebˆÈÖÀÊ#ƒ® ƒ¦ ÀÊÀF‚@ÀÄ×ÀF‚@ÈØÀÊ#ƒ¾ ÀÊÀ‰F‚@ÈÙÀÊ#ƒÎ ÀÄÀ‰F‚@„ƒÓšƒå ÊÚÊF‚@Ûšƒ÷ ÊÚÊ‰	\nFF‚@ÊÚÊÀ	\nFF‚@ÊÄÊÀF‚@„Ê‰‰ÀF‚@Óšƒ%Ê‰‰F‚@Ûšƒ7Ê‰‰‰	\nFF‚@Ê‰‰À	\nFF.‡" [nil sigtrust sigdate sigid symmetric sigtype keyid statusbuf re-search-forward "NEED_PASSPHRASE \\(\\S +\\)$" t "0x" match-string 1 "\\(\\S +SIG\\)" "\\(TRUST_\\S +\\)$" stderrbuf "^gpg: public key decryption failed: Secret key not available$" "^gpg: Signature made \\(.*\\) using" "ERRSIG" "^gpg: Signature made .* key ID \\(.*\\)$" "^gpg: \\S + signature from \"\\(.*\\)\"$" "^gpg: fatal: Can't query password in batchmode$" "***** CONVENTIONAL *****" "^gpg: public key decryption failed: Bad passphrase$" "^gpg: decryption failed: Bad key$" signed "GOODSIG"] 7])
(defalias 'mc-gpg-decrypt-region #[(start end &optional id) "Á\n!pÃ‰‰‰‰‰	\nÌÍÎ$!ˆÒ ˆƒQ ÓÔ\"‰ƒJ Õ@ÍÖ@A#\"‚O Õ×\"Ø	ƒc Ú	ÛD\"	Ú	Ü\"	ÝÞ!ˆß 	á&‰@„Š âã!‚3A@„š äå!ˆâæ!‚3A@åš„® çA@#‚3è8ƒ.è8‰):„û ÝÍê)\"!ˆ+ì=„÷ +„Ü íÍî)\"!ƒ÷ ïÃ)B!ƒ÷ ð ˆñò!ˆç#‚*ó‚*)@ƒÝÍô)A@è)8õ)8$!ˆö‚*ÝÍ÷)A@è)8õ)8$!ˆø)‚3Ýù!ˆú.	‡" [process-environment get-buffer-create mc-buffer-name nil gpg-id result passwd new-key key args obuf buffer mc-gpg-debug-print format "(mc-gpg-decrypt-region start=%s end=%s id=%s)" start end id undo-boundary mc-gpg-lookup-key encrypt mc-activate-passwd "GPG passphrase for %s (%s): " "GPG passphrase for conventional decryption: " ("--batch") mc-gpg-alternate-keyring append "--keyring" ("--decrypt") message "Decrypting..." mc-gpg-process-region mc-gpg-path mc-gpg-decrypt-parser error "This message is not addressed to you" mc-deactivate-passwd t "That passphrase was wrong" mc-gpg-decrypt-region 2 sig "cannot check signature from keyid %s" mc-gpg-always-fetch never y-or-n-p "Key %s not found; attempt to fetch? " mc-gpg-fetch-key undo-start undo-more 1 (t) "Good signature from '%s' %s made %s" 3 (t . t) "BAD SIGNATURE from '%s' %s made %s" (t) "Decrypting... Done." (t)] 10])
(defalias 'mc-gpg-sign-region #[(start end &optional id unclear) "Á\n!Ã‰‰È	† \nË\"Ì\f@ÍÎ\f@\fA#\"ÏÐÑÒ\fAÒQƒ7 Ô‚8 Õ¯ƒK ×ØÍÙ\"D\"ƒV ×\"ÛÜ\f@\"ˆÝ á&…u Ûâ\f@\"ˆã-‡" [process-environment get-buffer-create mc-buffer-name nil key args passwd buffer mc-gpg-lookup-key id mc-gpg-user-id sign mc-activate-passwd format "GPG passphrase for %s (%s): " "--batch" "--armor" "--local-user" "\"" unclear "--sign" "--clearsign" mc-gpg-comment append "--comment" "'%s'" mc-gpg-extra-args message "Signing as %s ..." mc-gpg-process-region start end mc-gpg-path mc-gpg-insert-parser "Signing as %s ... Done." t] 8])
(defalias 'mc-gpg-verify-parser #[(stdoutbuf stderrbuf statusbuf rc) "À\nqˆebˆÃÄÀÅ#ƒ Æ	ÇÈ!C\"‚ ÉÊ	Ë#)\nqˆebˆÃÌÀÅ#…N qˆebˆÃÎÀÅ#…N qˆebˆÃÏÀÅ#ˆÇÈ!ÒÓÔ\"!ˆÖUƒ� À×qˆebˆÃØÀÅ#ƒ{ ËÇÈ!QE‚¥ ÈUƒ� ÀÙE‚¥ ƒ� ÀÐE‚¥ ÚÛÜ \"!*‡" [nil msg statusbuf re-search-forward "^\\[GNUPG:\\]\\s +\\(\\S +\\)" t append match-string 1 mapconcat identity " " "^\\[GNUPG:\\]\\s +ERRSIG$" stderrbuf "gpg: Can't check signature: Public key not found$" "key ID \\(\\S +\\)$" needkey status mc-gpg-debug-print format " status is %s" rc 0 good "^gpg: Good signature \\(from.*\\)$" bad error with-current-buffer buffer-string] 6])
(defalias 'mc-gpg-verify-region #[(start end &optional no-fetch) "À	!pÂ‰‰È	ƒ ÊË	#ÌÍ!ˆÎÂÒ&ÓÔÕ\"!ˆ@Ö=ƒE ÌA@!‚¥ @×=ƒT ØA@!‚¥ @Ù=ƒ  „— ÛA@P‰ƒ— Ý=„— „ ÞÔß\f\"!ƒ— àÂ\fB!ƒ— qƒ— áâ#‚¥ ØãA@\"‚¥ ØA@!-‡" [get-buffer-create mc-buffer-name nil result gpg-id args obuf buffer ("--batch" "--verify") mc-gpg-alternate-keyring append "--keyring" message "Verifying..." mc-gpg-process-region start end mc-gpg-path mc-gpg-verify-parser mc-gpg-debug-print format "process-region returned %s" good bad error needkey no-fetch "0x" mc-gpg-always-fetch never y-or-n-p "Key %s not found; attempt to fetch? " mc-gpg-fetch-key mc-gpg-verify-region t "Can't check signature: Public key 0x%s not found"] 8])
(defalias 'mc-gpg-insert-public-key #[(&optional id) "À	!Â†\f ÇÈÉF\nƒ# ËÌÍÎ\n\"D\"ƒ0 ËÐD\"Ñ``ÂÓ\f&…F ÔÍÕ\"!ˆÖ*‡" [get-buffer-create mc-buffer-name nil args buffer id mc-gpg-user-id "--export" "--armor" "--batch" mc-gpg-comment append "--comment" format "'%s'" mc-gpg-alternate-keyring "--keyring" mc-gpg-process-region mc-gpg-path mc-gpg-insert-parser message "Key for user ID: %s" t] 8])
(defalias 'mc-gpg-snarf-parser #[(stdoutbuf stderrbuf statusbuf rc) "Á=ƒO Á‰‰ÂŠqˆebˆÈ	ÂÊ#ƒG ËÌ”Ì•\"‰Íšƒ5 T‚ ÎšƒA T‚ \fT‚ Ê\fF-‡ÏÐÑ \"!‡" [rc 0 nil tmpstr weirdos oldkeys newkeys stderrbuf re-search-forward mc-gpg-newkey-re t buffer-substring-no-properties 2 "public key imported" "not changed" error with-current-buffer buffer-string] 5])
(defalias 'mc-gpg-snarf-keys #[(start end) "À	!Â‰Æƒ ÈÉD\"ÊË!ˆÌÂÐ&ÊÑÒ\f@\fA@Ó\f8$!ˆ\f@+‡" [get-buffer-create mc-buffer-name nil args results buffer ("--import" "--batch") mc-gpg-alternate-keyring append "--keyring" message "Snarfing..." mc-gpg-process-region start end mc-gpg-path mc-gpg-snarf-parser format "%d new keys, %d old, %d weird" 2] 8])
(defalias 'mc-scheme-gpg #[nil "ÀÁBÂÃBÄÅBÆÇBÈÉBÊËBÌBÎBÐBÒBÔBÖBØB¯‡" [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 mc-gpg-msg-begin-line msg-end-line mc-gpg-msg-end-line signed-begin-line mc-gpg-signed-begin-line signed-end-line mc-gpg-signed-end-line key-begin-line mc-gpg-key-begin-line key-end-line mc-gpg-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 (quote never) (#$ . -13146))
#@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) "ÀÁ!‡" [error "Key fetching not yet implemented"] 2 (#$ . 13281)])
