28
28
#include "../jnlib/strlist.h"
29
29
#include "cipher.h"
30
30
#include "filter.h"
31
#include "../common/openpgpdefs.h"
32
33
#define DEBUG_PARSE_PACKET 1
36
PKT_PUBKEY_ENC =1, /* public key encrypted packet */
37
PKT_SIGNATURE =2, /* secret key encrypted packet */
38
PKT_SYMKEY_ENC =3, /* session key packet (OpenPGP)*/
39
PKT_ONEPASS_SIG =4, /* one pass sig packet (OpenPGP)*/
40
PKT_SECRET_KEY =5, /* secret key */
41
PKT_PUBLIC_KEY =6, /* public key */
42
PKT_SECRET_SUBKEY =7, /* secret subkey (OpenPGP) */
43
PKT_COMPRESSED =8, /* compressed data packet */
44
PKT_ENCRYPTED =9, /* conventional encrypted data */
45
PKT_MARKER =10, /* marker packet (OpenPGP) */
46
PKT_PLAINTEXT =11, /* plaintext data with filename and mode */
47
PKT_RING_TRUST =12, /* keyring trust packet */
48
PKT_USER_ID =13, /* user id packet */
49
PKT_PUBLIC_SUBKEY =14, /* public subkey (OpenPGP) */
50
PKT_OLD_COMMENT =16, /* comment packet from an OpenPGP draft */
51
PKT_ATTRIBUTE =17, /* PGP's attribute packet */
52
PKT_ENCRYPTED_MDC =18, /* integrity protected encrypted data */
53
PKT_MDC =19, /* manipulation detection code packet */
54
PKT_COMMENT =61, /* new comment packet (private) */
55
PKT_GPG_CONTROL =63 /* internal control packet */
58
36
typedef struct packet_struct PACKET;
373
351
(a)->pkt.generic = NULL; \
377
SIGSUBPKT_TEST_CRITICAL=-3,
378
SIGSUBPKT_LIST_UNHASHED=-2,
379
SIGSUBPKT_LIST_HASHED =-1,
381
SIGSUBPKT_SIG_CREATED = 2, /* signature creation time */
382
SIGSUBPKT_SIG_EXPIRE = 3, /* signature expiration time */
383
SIGSUBPKT_EXPORTABLE = 4, /* exportable */
384
SIGSUBPKT_TRUST = 5, /* trust signature */
385
SIGSUBPKT_REGEXP = 6, /* regular expression */
386
SIGSUBPKT_REVOCABLE = 7, /* revocable */
387
SIGSUBPKT_KEY_EXPIRE = 9, /* key expiration time */
388
SIGSUBPKT_ARR =10, /* additional recipient request */
389
SIGSUBPKT_PREF_SYM =11, /* preferred symmetric algorithms */
390
SIGSUBPKT_REV_KEY =12, /* revocation key */
391
SIGSUBPKT_ISSUER =16, /* issuer key ID */
392
SIGSUBPKT_NOTATION =20, /* notation data */
393
SIGSUBPKT_PREF_HASH =21, /* preferred hash algorithms */
394
SIGSUBPKT_PREF_COMPR =22, /* preferred compression algorithms */
395
SIGSUBPKT_KS_FLAGS =23, /* key server preferences */
396
SIGSUBPKT_PREF_KS =24, /* preferred key server */
397
SIGSUBPKT_PRIMARY_UID =25, /* primary user id */
398
SIGSUBPKT_POLICY =26, /* policy URL */
399
SIGSUBPKT_KEY_FLAGS =27, /* key flags */
400
SIGSUBPKT_SIGNERS_UID =28, /* signer's user id */
401
SIGSUBPKT_REVOC_REASON =29, /* reason for revocation */
402
SIGSUBPKT_FEATURES =30, /* feature flags */
404
SIGSUBPKT_SIGNATURE =32, /* embedded signature */
406
SIGSUBPKT_FLAG_CRITICAL=128
424
370
/*-- mainproc.c --*/
425
371
int proc_packets( void *ctx, iobuf_t a );
426
372
int proc_signature_packets( void *ctx, iobuf_t a,
427
STRLIST signedfiles, const char *sigfile );
373
strlist_t signedfiles, const char *sigfile );
428
374
int proc_encryption_packets( void *ctx, iobuf_t a );
429
375
int list_packets( iobuf_t a );