;ELC ;;; Compiled by per-erik.martin@telia.com on Sun Oct 29 17:38:33 2006 ;;; from file /Users/pem/src/pgp/pgp.el ;;; in Emacs version 21.2.1 ;;; with bytecomp version 1.1.1.4 ;;; 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 "`pgp.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\301B\302\301\207" [current-load-list pgp-vm-version "2.2.2"] 2) #@191 *The directory where incoming emails are saved temporarily while verifying a signature. Files are removed after verification, but you may want to make sure this is somewhere private anyway. (defvar pgp-tmp-directory "/tmp/" (#$ . -677)) #@107 *The command line PGP program. If it is not an explicit path, it must be found in the PATH of the caller. (defvar pgp-program "/usr/local/bin/pgp" (#$ . -921)) #@109 *The command line GnuPG program. If it is not an explicit path, it must be found in the PATH of the caller. (defvar gpg-program "/usr/local/bin/gpg" (#$ . -1088)) #@102 Sign the current composed message using PGP. The program to call is set in the variable pgp-program. (defalias 'pgp-vm-sign #[nil "\300\301\302\"\207" [pem-vm-sign pgp-sign-call "pgp-md5"] 3 (#$ . 1258) nil]) #@105 Sign the current composed message using Gnu PG. The program to call is set in the variable gpg-program. (defalias 'gpg-vm-sign #[nil "\300\301\302\"\207" [pem-vm-sign gpg-sign-call "pgp-sha1"] 3 (#$ . 1474) nil]) (defalias 'pem-vm-sign #[(signer micalg) "p\304\305!\306\216\212\307\310\311\217\210q\210\312 !\210\313\n \"\203- q\210ed|\210\312!\210\314\315!\2020\316\317!,\207" [tmpbuf curbuf signer micalg get-buffer-create " *pgp-sign-temp*" ((kill-buffer tmpbuf)) x (vm-mime-encode-composition) ((error (byte-code "A@\301\230\204\302A@!\210\302\207" [x "Message is already MIME encoded." error] 2))) insert-buffer pem-sign message "Signed. C-c C-c to send, C-x u to undo" error "Signing failed"] 3]) (defalias 'pem-sign #[(signer micalg) "eb\210\306\307Q\310 d\311#\211\204\312\313!\202\325\314 \315 P\316\317\320e\n#\204,\321c\210\317\322e\n\311$\211&?\211'\203B\323c\210\324&\325 \326(P\327Rc\210'\203V\330\331\332\"\210eb\210\310 d\311#\317\333e\n\311$\211)\203n\334 \210eb\210\310 d\311#\335\336!\210\fc\210\337 \210`*\340\332!\210\323c\210&c\210\337 \210)\203\241\341c\210)c\210\337 \210\342*\311\"\210db\210`\316+,\fc\210\337 \210\343c\210\337\336!\210\344-*,D\"+\fc\210\345c\210\337 \210+. *\207" [mail-header-separator header-sep end-of-head b mpb case-fold-search "^" "$" re-search-forward t error "End of header not found" pem-mime-make-multipart-boundary "\n--" nil pem-get-header-val "^MIME-Version: " "MIME-Version: 1.0\n" "^Content-Type: " "Content-Type: " "text/plain; charset=us-ascii" "multipart/signed; boundary=" "; micalg=" ";\n protocol=\"application/pgp-signed\"" insert-char 10 1 "^Content-Transfer-Encoding: " pem-delete-whole-line beginning-of-line 2 newline open-line "Content-Transfer-Encoding: " pem-canonicalization "Content-Type: application/pgp-signature" apply "--" oldct insct micalg oldcte p1 res p2 signer] 6]) #@116 Verify the signature of the current VM message, using PGP. The program to call is set in the variable pgp-program. (defalias 'pgp-vm-verify-signature #[nil "\300\301!\207" [pem-vm-verify-signature pgp-verify-call] 2 (#$ . 3374) nil]) #@119 Verify the signature of the current VM message, using Gnu PG. The program to call is set in the variable gpg-program. (defalias 'gpg-vm-verify-signature #[nil "\300\301!\207" [pem-vm-verify-signature gpg-verify-call] 2 (#$ . 3615) nil]) (defalias 'pem-vm-verify-signature #[(verifyer) "\306\307 \310 \235\204\311\312!\202T\212@q\210~\210\313\314e\315#\211\204)\311\316!\202S\317\320!\210`\321\314d\315#\2068d\nb\210\322\323 \315#\324 \n\f $\211\205R\325!+**\207" [vmbuffers case-fold-search begm endm midm verifyer nil pem-vm-buffer-name-list buffer-name error "Current buffer is not a mail buffer" re-search-backward "^From " t "Message beginning not found" beginning-of-line 2 re-search-forward search-forward "\n\n" pem-verify-signature display-buffer buf] 6]) (defalias 'pem-verify-signature #[(verifyer begm midm endm) "\306\307 #\211\204\310\311!\2021\312\n!\204\310\313!\2021\314\n!\211\204*\310\315!\2020\316\f $))\207" [begm midm ct b verifyer endm pem-get-header-val "^Content-Type: " error "Missing Content-Type" pem-is-signed "Not PGP signed" pem-get-boundary-regexp "No multipart boundary" pem-verify-signature-body] 6]) (defalias 'pem-verify-signature-body #[(verifyer boundary begm endm) "b\210\306\307!\310\n # \311P\310\n #\312\216\f\204$\313\314!\202\203\204/\313\315!\202\203\fq\210\316e!\210\317 !\210\320 \321\"\210\322\323!\210q\210eb\210\324\325d\326#\204X\313\327!\202\203\330\331d\326#\204f\313\332!\202\203e`|\210\322\333 \"\210\317 !\210\320 \321\"\210\322\323!\210\334 D\"-\207" [begm file1 boundary endm buf1 file2 make-unique-tmp-file ".pgp-temp-" pem-get-next-part ".sig" ((byte-code "\203\304!\210 \203\304 !\210\305\n!\203\306\n!\210\305 !\203$\306 !\210\304\207" [buf1 buf2 file1 file2 kill-buffer file-exists-p delete-file] 2)) error "Failed to get the first (message) part" "Failed to get the second (signature) part" pem-canonicalization write-file set-file-modes 384 message nil re-search-forward "^Content-Type: application/pgp-signature$" t "Second part is not a PGP signature" search-forward "\n\n" "No blank line in signature part" "File2=%s" apply buf2 verifyer] 4]) #@105 Encrypt the current composed message using PGP. The program to call is set in the variable pgp-program. (defalias 'pgp-vm-encrypt #[nil "\300\301\302\"\207" [pem-vm-encrypt pgp-encrypt-call nil] 3 (#$ . 5796) nil]) #@108 Encrypt the current composed message using Gnu PG. The program to call is set in the variable gpg-program. (defalias 'gpg-vm-encrypt #[nil "\300\301\302\"\207" [pem-vm-encrypt gpg-encrypt-call nil] 3 (#$ . 6018) nil]) #@114 Encrypt and sign the current composed message using PGP. The program to call is set in the variable pgp-program. (defalias 'pgp-vm-both-sign-and-encrypt #[nil "\300\301\302\"\207" [pem-vm-encrypt pgp-sign-encrypt-call t] 3 (#$ . 6243) nil]) #@117 Encrypt and sign the current composed message using Gnu PG. The program to call is set in the variable gpg-program. (defalias 'gpg-vm-both-sign-and-encrypt #[nil "\300\301\302\"\207" [pem-vm-encrypt gpg-sign-encrypt-call t] 3 (#$ . 6491) nil]) (defalias 'pem-vm-encrypt #[(encryptor sign) "p\304\305!\306\216\212\307\310\311\217\210q\210\312 !\210\313\n \"\203- q\210ed|\210\312!\210\314\315!\2020\316\317!,\207" [tmpbuf curbuf encryptor sign get-buffer-create " *pgp-encr-temp*" ((kill-buffer tmpbuf)) x (vm-mime-encode-composition) ((error (byte-code "A@\301\230\204\302A@!\210\302\207" [x "Message is already MIME encoded." error] 2))) insert-buffer pem-encrypt message "Encrypted. C-c C-c to send, C-x u to undo" error "Encryption failed"] 3]) (defalias 'pem-encrypt #[(encryptor sign) "eb\210\306\307Q\310 d\311#\211\204\312\313!\202\375\314 \315 P\316\316*\317\320e\n#\204/\321c\210\322e\n\"\211*\204@\312\323!\210\202J*A\203J\312\324!\210\317\325e\n\311$\211+?\211,\203`\326c\210\327+\330 \331Qc\210,\203p\332\333\334\"\210eb\210\310 d\311#\317\335e\n\311$\211-\203\210\336 \210eb\210\310 d\311#\337\340!\210\fc\210\341 \210\342c\210\343c\210`.\344\334!\210\326c\210+c\210\341 \210-\203\301\345c\210-c\210\341 \210/\203\314\346.\311\"\210db\210\3470*@.`E\"1.b\210\fc\210\341 \210\350c\210\341\340!\210db\210\fc\210\351c\210\341 \2101. *\207" [mail-header-separator header-sep end-of-head b mpb case-fold-search "^" "$" re-search-forward t error "End of header not found" pem-mime-make-multipart-boundary "\n--" nil pem-get-header-val "^MIME-Version: " "MIME-Version: 1.0\n" pem-get-recipients "No recipients, can't encrypt" "Encrypting for more than one receiver it not supported" "^Content-Type: " "Content-Type: " "text/plain; charset=us-ascii" "multipart/encrypted; boundary=" ";\n protocol=\"application/pgp-encrypted\"" insert-char 10 1 "^Content-Transfer-Encoding: " pem-delete-whole-line beginning-of-line 2 newline "Content-Type: application/pgp-encrypted\n\n" "Version: 1\n" open-line "Content-Transfer-Encoding: " pem-canonicalization apply "Content-Type: application/octet-stream" "--" to-ids oldct insct oldcte p1 sign encryptor res] 6]) #@181 Decrypt the message of the current VM message, using PGP. If the message is also signed, the signature is verified as well. The program to call is set in the variable pgp-program. (defalias 'pgp-vm-decrypt #[nil "\300\301!\207" [pem-vm-decrypt pgp-decrypt-call] 2 (#$ . 8705) nil]) #@184 Decrypt the message of the current VM message, using Gnu GP. If the message is also signed, the signature is verified as well. The program to call is set in the variable gpg-program. (defalias 'gpg-vm-decrypt #[nil "\300\301!\207" [pem-vm-decrypt gpg-decrypt-call] 2 (#$ . 8994) nil]) (defalias 'pem-vm-decrypt #[(decryptor) "\306 \307 \235\204\310\311!\202\322\312p\312\212@q\210~\210\313\314e\315#\211\204.\310\316!\210\202R\317\320!\210`\321\314d\315#\206=d\fb\210\322\323 \315#(\324)\f( $** \205\321 <\203a @\202b <\205j A@*\211+q\210\325\326!\210eb\210\327\330\331\"\210d\211,b\210\332\333\312\334\335#!\210e,|\210\325\336!\210*\203\255\337*!\210*q\210\340 \210\341+!\210\202\262\337+!\210\342\343!\205\320\344+!\210*\203\307\344*!\210\345\n!\210\346 \210\347 ++)\207" [vmbuffers decrypt oldbuf case-fold-search begm endm pem-vm-buffer-name-list buffer-name error "Current buffer is not a mail buffer" nil re-search-backward "^From " t "Message beginning not found" beginning-of-line 2 re-search-forward search-forward "\n\n" pem-decrypt toggle-read-only 0 replace-string " \n" "\n" vm-decode-mime-layout vm-mime-parse-entity ("text/plain" "charset=us-ascii") "7bit" 1 display-buffer split-window-vertically switch-to-buffer-other-window y-or-n-p "Kill decryption buffers? " kill-buffer switch-to-buffer delete-other-windows vm-summarize midm decryptor verbuf secbuf p] 6]) (defalias 'pem-decrypt #[(decryptor begm midm endm) "\306\307 #\211\204\310\311!\2021\312\n!\204\310\313!\2021\314\n!\211\204*\310\315!\2020\316\f $))\207" [begm midm ct b decryptor endm pem-get-header-val "^Content-Type: " error "Missing Content-Type" pem-is-encrypted "Not PGP encrypted" pem-get-boundary-regexp "No multipart boundary" pem-decrypt-body] 6]) (defalias 'pem-decrypt-body #[(decryptor boundary begm endm) "b\210\306 \n\307#\306 \n\310#\311\216 \204\312\313!\202~\f\204%\312\314!\202~ q\210\315\316ed#\317\230\2049\312\320!\210\202T\321\322d\323#\204H\312\324!\210\202T\325\326d\323#\204T\312\327!\210\fq\210eb\210\315\330ed#\331\230\204j\312\332!\202~\321\322d\323#\204x\312\333!\202~\334 `dD\"+\207" [begm boundary endm bufvers bufdecr decryptor pem-get-next-part " *temp-vers*" " *temp-decr*" ((byte-code "\203\302!\210 \203\302 !\210\302\207" [bufvers bufdecr kill-buffer] 2)) error "Failed to get the first (version) part" "Failed to get the second (cryptogram) part" pem-get-header-val "Content-Type: " "application/pgp-encrypted" "First part is not a pgp-encrypt control part" search-forward "\n\n" t "No blank line in control part" search-forward-regexp "^Version: 1$" "First part does not contain Version: 1" "^Content-Type: " "application/octet-stream" "Second part is not a octet-stream" "No blank line in encrypted part" apply] 4]) (defalias 'make-unique-tmp-file #[(prefix) " \302 \303\304 !R\207" [pgp-tmp-directory prefix user-login-name number-to-string emacs-pid] 5]) (defalias 'pem-delete-whole-line #[nil "\301 \210`\301\302!\210`|)\207" [p beginning-of-line 2] 2]) (defalias 'pem-is-signed #[(ct) "\301\302\"\205 \301\303\"\207" [ct string-match "\\" "\\" "\\" process-status run set-process-coding-system no-conversion process-send-string process-send-region process-send-eof 10 0 accept-process-output 1 exit process-exit-status file-exists-p insert-file delete-file toggle-read-only t y-or-n-p "Decryption failed. Try again? " error "Failed to start %s" delete-process beginning-of-line -1 flush-lines "^Process gpg kill.*$" buffer-size kill-buffer shell-file-name process-connection-type gpg-program p start end cnt] 13]) #@139 Verify the clear text signature, if any, of the current VM message, using Gnu PG. The program to call is set in the variable gpg-program. (defalias 'gpg-vm-verify-cleartext #[nil "\305\306 \307 \235\204\310\311!\202I\212@q\210~\210\312\313e\314#\211\204)\310\315!\202H\316\317!\210`\320\313d\314#\2068d\nb\210\321\322 \314#\323`\n #***\207" [vmbuffers case-fold-search begm endm midm nil pem-vm-buffer-name-list buffer-name error "Current buffer is not a mail buffer" re-search-backward "^From " t "Message beginning not found" beginning-of-line 2 re-search-forward search-forward "\n\n" gpg-verify-cleartext] 5 (#$ . 21113) nil]) #@240 Try to locate a Gnu PG clear text signature, starting at POINT. It searches forward first, and then backwards. If MIN and MAX are given, they set the boundaries of how far to search. The program to call is set in the variable gpg-program. (defalias 'gpg-verify-cleartext #[(point &optional min max) "\212b\210\305\306 \206 d\307#\206\310\306\n\206e\307#\211\203@\311\312!\210`\305\313d\307#\211\2039\311\314!\210\315 `\"\202<\316\317!)\202C\316\320!*\207" [point max min begin end search-forward "-----BEGIN PGP SIGNED MESSAGE-----" t search-backward beginning-of-line 1 "-----END PGP SIGNATURE-----" 2 gpg-verify-region error "No end of PGP signature found" "No beginning of PGP signed message found"] 5 (#$ . 21765) "d"]) (defalias 'gpg-verify-region #[(begin end) "\306\307!\310!\311\216\312 \n #\210 q\210\313!\210\314\315\"\210\316\317!\210\310\320!\321 \317\f\322D\322\323\324\325\326& \210\212\fq\210eb\210\327\330!\210\327\331!\210\332\333!\210db\210\334\f!-\207" [file buf begin end verbuf gpg-program make-unique-tmp-file ".pgp-temp-" generate-new-buffer ((byte-code "\203\302!\210\303 !\203\304 !\210\302\207" [buf file kill-buffer file-exists-p delete-file] 2)) copy-to-buffer write-file set-file-modes 384 message nil "*gpg-verify-signature*" call-process t "--batch" "--no-tty" "--quiet" "--verify" flush-lines "^gpg: checking .*$" "^gpg: next trustdb .*$" toggle-read-only 1 display-buffer] 10]) (provide 'pgp)