;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:21:04 2007 ;;; from file /home/cyd/emacs/lisp/pgg-parse.el ;;; in Emacs version 22.0.99 ;;; 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 "`pgg-parse.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (custom-declare-group 'pgg-parse nil "OpenPGP packet parsing." :group 'pgg) #@59 Alist of the assigned number to the public key algorithm. (custom-declare-variable 'pgg-parse-public-key-algorithm-alist ''((1 . RSA) (2 . RSA-E) (3 . RSA-S) (16 . ELG-E) (17 . DSA) (20 . ELG)) '(#$ . 641) :group 'pgg-parse :type '(repeat (cons (sexp :tag "Number") (sexp :tag "Type")))) #@62 Alist of the assigned number to the simmetric key algorithm. (custom-declare-variable 'pgg-parse-symmetric-key-algorithm-alist ''((1 . IDEA) (2 . 3DES) (4 . CAST5) (5 . SAFER-SK128)) '(#$ . 935) :group 'pgg-parse :type '(repeat (cons (sexp :tag "Number") (sexp :tag "Type")))) #@67 Alist of the assigned number to the cryptographic hash algorithm. (custom-declare-variable 'pgg-parse-hash-algorithm-alist ''((1 . MD5) (2 . SHA1) (3 . RIPEMD160) (5 . MD2) (8 . SHA256) (9 . SHA384) (10 . SHA512)) '(#$ . 1218) :group 'pgg-parse :type '(repeat (cons (sexp :tag "Number") (sexp :tag "Type")))) #@60 Alist of the assigned number to the compression algorithm. (custom-declare-variable 'pgg-parse-compression-algorithm-alist ''((0) (1 . ZIP) (2 . ZLIB)) '(#$ . 1533) :group 'pgg-parse :type '(repeat (cons (sexp :tag "Number") (sexp :tag "Type")))) #@53 Alist of the assigned number to the signature type. (custom-declare-variable 'pgg-parse-signature-type-alist ''((0 . "Signature of a binary document") (1 . "Signature of a canonical text document") (2 . "Standalone signature") (16 . "Generic certification of a User ID and Public Key packet") (17 . "Persona certification of a User ID and Public Key packet") (18 . "Casual certification of a User ID and Public Key packet") (19 . "Positive certification of a User ID and Public Key packet") (24 . "Subkey Binding Signature") (31 . "Signature directly on a key") (32 . "Key revocation signature") (40 . "Subkey revocation signature") (48 . "Certification revocation signature") (64 . "Timestamp signature.")) '(#$ . 1786) :group 'pgg-parse :type '(repeat (cons (sexp :tag "Number") (sexp :tag "Type")))) #@67 If non-nil checksum of each ascii armored packet will be ignored. (custom-declare-variable 'pgg-ignore-packet-checksum 't '(#$ . 2595) :group 'pgg-parse :type 'boolean) #@16 Armor headers. (defvar pgg-armor-header-lines '("^-----BEGIN PGP MESSAGE\\(, PART [0-9]+\\(/[0-9]+\\)?\\)?----- ?$" "^-----BEGIN PGP PUBLIC KEY BLOCK----- ?$" "^-----BEGIN PGP PRIVATE KEY BLOCK----- ?$" "^-----BEGIN PGP SIGNATURE----- ?$") (#$ . 2770)) (byte-code "\300\301\302\303!\203\f\303\202 \304\"\207" [defalias pgg-char-int fboundp char-int identity] 4) (defalias 'pgg-format-key-identifier '(macro . #[(string) "\301\302\303BBB\207" [string mapconcat (lambda (c) (format "%02X" (pgg-char-int c))) ("")] 4])) (defalias 'pgg-parse-time-field '(macro . #[(bytes) "\301\302\303\304D\305BB\306\307EE\302\303\306\310E\311BB\306\312EE\313BBB\207" [bytes list logior lsh car (8) nth 1 2 (8) 3 (0)] 7])) (defalias 'pgg-byte-after '(macro . #[(&optional pos) "\301\302\206\303DD\207" [pos pgg-char-int char-after (point)] 3])) (defalias 'pgg-read-byte '(macro . #[nil "\300\207" [(pgg-char-int (char-after (prog1 (point) (forward-char))))] 1])) (defalias 'pgg-read-bytes-string '(macro . #[(nbytes) "\301\302\303\304\305BB\306DEE\207" [nbytes buffer-substring (point) prog1 + ((point)) forward-char] 6])) (defalias 'pgg-read-bytes '(macro . #[(nbytes) "\301\302\303DE\207" [nbytes mapcar #'pgg-char-int pgg-read-bytes-string] 4])) (defalias 'pgg-read-body-string '(macro . #[(ptag) "\301\302\303E\304\302\303ED\305BBB\207" [ptag if nth 1 pgg-read-bytes-string ((pgg-read-bytes-string (- (point-max) (point))))] 6])) (defalias 'pgg-read-body '(macro . #[(ptag) "\301\302\303DE\207" [ptag mapcar #'pgg-char-int pgg-read-body-string] 4])) (defalias 'pgg-skip-bytes 'forward-char) (defalias 'pgg-skip-header '(macro . #[(ptag) "\301\302\303ED\207" [ptag pgg-skip-bytes nth 2] 4])) (defalias 'pgg-skip-body '(macro . #[(ptag) "\301\302\303ED\207" [ptag pgg-skip-bytes nth 1] 4])) (defalias 'pgg-set-alist '(macro . #[(alist key value) "\303\304\305\306 \nEDEE\207" [alist key value setq nconc list cons] 8])) (byte-code "\302\303!\203%\304\305 B\306\305\307\310#\210\311!\210\306\305\312\313\305\"#\210)\314\315\316\"\210\310\207" [prog current-load-list fboundp define-ccl-program [1 30 14 114744 114775 0 161 131127 1 148217 15 82167 1 1848 131159 1 1595 5 256 114743 390 114775 19707 1467 16 7 183 1 -5628 -7164 22] pgg-parse-crc24 put variable-documentation nil (lambda (#1=#:defconst-tmp-var) (defconst pgg-parse-crc24 #1#)) ccl-program-idx register-ccl-program defalias pgg-parse-crc24-string #[(string) "\303\304\305\306\304\211\211\211\211\211& \307 \n#\210\310\311\312\313H\314\"\312\315\316H\317\"\314\"\312\316H\314\"$)\207" [h pgg-parse-crc24 string vector nil 183 1230 ccl-execute-on-string format "%c%c%c" logand 1 255 lsh 2 -8] 10]] 6) (defalias 'pgg-parse-length-type '(macro . #[(c) "\301\302\303BB\304\305BBD\302\306BB\304\307\310\311\312BB\313BB\314BB\315BBD\316\317BB\320B\321BBBB\207" [c cond < (192) cons (1) (224) + lsh - (192) (8) ((pgg-byte-after (+ 2 (point))) 192) (2) = (255) ((cons (cons (logior (lsh (pgg-byte-after (+ 2 (point))) 8) (pgg-byte-after (+ 3 (point)))) (logior (lsh (pgg-byte-after (+ 4 (point))) 8) (pgg-byte-after (+ 5 (point))))) 5)) ((t '(0 . 0)))] 9])) (defalias 'pgg-parse-packet-header #[nil "\306`f!\307\211\211\211\310\311\f\312\"!\203]\311\f\313\"\211\313U\203%\314\202)\315\316 \"\311\315\f\317\"\320\"\314 T \314 W\203Y\321\315 \322\"\306 `\\\316\\f!\" T\211\202=*\202\323\311\f\323\"\306`Tf!\324W\203v\306`Tf!\316B\202\313\306`Tf!\325W\203\230\315\306`Tf!\324Z\322\"\306`\326\\f!\\\324\\\326B\202\313\306`Tf!\327U\203\312\321\315\306`\326\\f!\322\"\306`\313\\f!\"\321\315\306`\330\\f!\322\"\306`\331\\f!\"B\331B\202\313\332\211@ AT\n E-\207" [header-bytes packet-bytes content-tag length-type ptag i pgg-char-int nil zerop logand 64 3 0 lsh 1 -2 15 logior 8 63 192 224 2 255 4 5 (0 . 0) #1=#:--cl-dotimes-temp--] 7]) (defalias 'pgg-parse-packet #[(ptag) "@\301=\203 \302!\207@\303=\203\304!\207@\305=\203!\306!\207@\307=\203,\310!\207@\311=\203SA@\203F`A@`\\A@u\210{\207`d`Z`\\d`Zu\210{\207@\312=\203zA@\203m`A@`\\A@u\210{\207`d`Z`\\d`Zu\210{\207@\313=\203\241A@\203\224`A@`\\A@u\210{\207`d`Z`\\d`Zu\210{\207@\314=\205\307A@\203\273`A@`\\A@u\210{\207`d`Z`\\d`Zu\210{\207" [ptag 1 pgg-parse-public-key-encrypted-session-key-packet 2 pgg-parse-signature-packet 3 pgg-parse-symmetric-key-encrypted-session-key-packet 6 pgg-parse-public-key-packet 9 10 11 13] 4]) (defalias 'pgg-parse-packets #[(&optional header-parser body-parser) "\206\304 \206\n\305\306\211d`TV\203A \307\310\n8!\210\n@\212 \n!)B B\311\nA@!\2039db\210\202\nA@u\210\202 ,\207" [header-parser body-parser ptag result pgg-parse-packet-header pgg-parse-packet nil pgg-skip-bytes 2 zerop] 4]) (defalias 'pgg-parse-signature-subpacket-header #[nil "\301`f!\302W\203\301`f!\303B\202d\301`f!\304W\2032\305\301`f!\302Z\306\"\301`\307\\f!\\\302\\\307B\202d\301`f!\310U\203c\311\305\301`\307\\f!\306\"\301`\312\\f!\"\311\305\301`\313\\f!\306\"\301`\314\\f!\"B\314B\202d\315\301A`\\f!@SATE)\207" [length-type pgg-char-int 192 1 224 lsh 8 2 255 logior 3 4 5 (0 . 0)] 6]) (defalias 'pgg-parse-signature-subpacket #[(ptag) "@\306=\203.\307\310\311``\312\\\312u\210{\"\313\314 @\315\" A@\"\313\314\306 8\315\"\316 8\"\317E)B\207@\316=\203\\\320\310\311``\312\\\312u\210{\"\313\314 @\315\" A@\"\313\314\306 8\315\"\316 8\"\317E)B\207@\312=\203m\321\311`\322u\210f!B\207@\323=\203~\324\311`\322u\210f!B\207@\325=\203\251\326A@\203\233`A@`\\A@u\210{\202\247`d`Z`\\d`Zu\210{B\207@\327=\203\272\330\311`\322u\210f!B\207@\331=\203\350\332\310\311``\312\\\312u\210{\"\313\314 @\315\" A@\"\313\314\306 8\315\"\316 8\"\317E)B\207@\333=\203\374\334\311`\322u\210f!\n\236AB\207@\335=\203\322\207@\336=\2034\337\340\341A@\203$`A@`\\A@u\210{\2020`d`Z`\\d`Zu\210{\342#B\207@\343=\203\220\344\312!\210\345\310\311``\306\\\306u\210{\"\310\311``\306\\\306u\210{\"`\313\314\f@\315\"\fA@\"`\\\313\314\f@\315\"\fA@\"u\210{`\313\314 @\315\" A@\"`\\\313\314 @\315\" A@\"u\210{*BB\207@\346=\203\244\347\311`\322u\210f! \236AB\207@\350=\203\271\351\311`\322u\210f!0\236AB\207@\352=\203\347\353\310\311A@\203\330`A@`\\A@u\210{\202\344`d`Z`\\d`Zu\210{\"B\207@\354=\203\355A@\203`A@`\\A@u\210{\202`d`Z`\\d`Zu\210{B\207@\356=\205<\357A@\203/`A@`\\A@u\210{\202;`d`Z`\\d`Zu\210{B\207" [ptag bytes pgg-parse-symmetric-key-algorithm-alist value-bytes name-bytes pgg-parse-hash-algorithm-alist 2 creation-time mapcar pgg-char-int 4 logior lsh 8 3 0 signature-expiry exportability nil 5 trust-level 6 regular-expression 7 revocability 9 key-expiry 11 preferred-symmetric-key-algorithm 12 16 key-identifier mapconcat #[(c) "\301\302\303!\"\207" [c format "%02X" pgg-char-int] 4] "" 20 pgg-skip-bytes notation 21 preferred-hash-algorithm 22 preferred-compression-algorithm 23 key-server-preferences 24 preferred-key-server 26 policy-url pgg-parse-compression-algorithm-alist] 8]) (defalias 'pgg-parse-signature-packet #[(ptag) "\306`f!\307BC\310\211\310\311U\203\200\312\313!\210\314\306``\315\\\315u\210{\" \316\n\211A@ \236ABC\244\211\317\320\321\n@\322\"\nA@\"\320\321\313\n8\322\"\311\n8\"\323EBC\244\211\324\325\326``\322\\\322u\210{\327#BC\244\211\330\306`\310u\210f!BC\244\211\331\306`\310u\210f!BC\244\202\332U\203\312\333!\210 \316\306`\310u\210f! \236ABC\244\211\330\306`\310u\210f!BC\244\211\331\306`\310u\210f!BC\244\334\314\306``\313\\\313u\210{\"\320\321\f@\322\"\fA@\"\211Y\203\346\214`\f`\\}\210 \314\335\336\337\340\"\"\244\210db\210)\334\314\306``\313\\\313u\210{\"\320\321\f@\322\"\fA@\"\211Y\203\214`\f`\\}\210 \314\335\336\337\340\"\"\244\210)\330 \236\211\211A!\236A\241\210\331 \236\211\211A\"\236A\241\210 -\207" [signature-version result hashed-material field n pgg-parse-signature-type-alist pgg-char-int version nil 3 pgg-skip-bytes 2 mapcar 5 signature-type creation-time logior lsh 8 0 key-identifier mapconcat #[(c) "\301\302\303!\"\207" [c format "%02X" pgg-char-int] 4] "" public-key-algorithm hash-algorithm 4 1 10000 cdr pgg-parse-packets pgg-parse-signature-subpacket-header pgg-parse-signature-subpacket pgg-parse-public-key-algorithm-alist pgg-parse-hash-algorithm-alist] 8]) (defalias 'pgg-parse-public-key-encrypted-session-key-packet #[(ptag) "\302\211\303\304`\302u\210f!BC\244\211\305\306\307``\310\\\310u\210{\311#BC\244\211\312\304`\302u\210f! \236ABC\244\211)\207" [result pgg-parse-public-key-algorithm-alist nil version pgg-char-int key-identifier mapconcat #[(c) "\301\302\303!\"\207" [c format "%02X" pgg-char-int] 4] 8 "" public-key-algorithm] 8]) (defalias 'pgg-parse-symmetric-key-encrypted-session-key-packet #[(ptag) "\302\211\303\304`\302u\210f!BC\244\211\305\304`\302u\210f! \236ABC\244\211)\207" [result pgg-parse-symmetric-key-algorithm-alist nil version pgg-char-int symmetric-key-algorithm] 6]) (defalias 'pgg-parse-public-key-packet #[(ptag) "\305`\306u\210f!\307BC\306\310U\203` \311\312\305``\313\\\313u\210{\"\314\315 @\316\" A@\"\314\315\317 8\316\"\310 8\"\320E)BC\244\211\321\312\305``\317\\\317u\210{\"BC\244\211\322\305`\306u\210f!BC\244\202\235\313U\203\235 \311\312\305``\313\\\313u\210{\"\314\315 @\316\" A@\"\314\315\317 8\316\"\310 8\"\320E)BC\244\211\322\305`\306u\210f!BC\244\322 \236\211\211A\f\236A\241\210 +\207" [key-version result field bytes pgg-parse-public-key-algorithm-alist pgg-char-int nil version 3 creation-time mapcar 4 logior lsh 8 2 0 key-expiry public-key-algorithm] 8]) (defalias 'pgg-decode-packets #[nil "\303\304\305\306#\203?\307\224\310\311!\211d|\210\305\312\313\217\2038\314\315!?\206=\n\206=\316\315\317 !!\230\206=\320\321!\210\305\202=\320\322!\210\305*\207\320\323!\210\305\207" [checksum p pgg-ignore-packet-checksum re-search-forward "^=\\([A-Za-z0-9+/]\\{4\\}\\)$" nil t 0 match-string 1 (byte-code "\301e\"\207" [p base64-decode-region] 3) ((error)) fboundp pgg-parse-crc24-string base64-encode-string buffer-string message "PGP packet checksum does not match" "PGP packet contain invalid base64" "PGP packet checksum not found"] 5]) (defalias 'pgg-decode-armor-region #[(start end) "\214 }\210eb\210\302\303\304\305#\210e\306\307!\205\310\225|\210\311 \205#eb\210\312 )\207" [start end re-search-forward "^-+BEGIN PGP" nil t search-forward "\n\n" 0 pgg-decode-packets pgg-parse-packets] 4]) (defalias 'pgg-parse-armor #[(string) "\302\303!\304\216rq\210\305 \210\306\307!\203\307\310!\210 c\210\311e`\"+\207" [#1=#:temp-buffer string generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) buffer-disable-undo fboundp set-buffer-multibyte nil pgg-decode-armor-region] 3]) (byte-code "\300\301\302\303!\203\f\303\202 \304\"\207" [defalias pgg-string-as-unibyte fboundp string-as-unibyte identity] 4) (defalias 'pgg-parse-armor-region #[(start end) "\302\303 {!!\207" [start end pgg-parse-armor pgg-string-as-unibyte] 4]) (provide 'pgg-parse)