--- pgp/src/pgp.h 2018/04/24 16:38:18 1.1.1.2 +++ pgp/src/pgp.h 2018/04/24 16:39:54 1.1.1.4 @@ -10,6 +10,9 @@ */ #include "usuals.h" +#include "more.h" +#include "armor.h" + #define KEYFRAGSIZE 8 /* # of bytes in key ID modulus fragment */ #define SIZEOF_TIMESTAMP 4 /* 32-bit timestamp */ @@ -128,6 +131,7 @@ #define KC_OWNERTRUST_ULTIMATE 0x07 /* Only for keys in secret ring */ #define KC_BUCKSTOP 0x80 /* This key is in secret ring */ #define KC_VISITED 0x40 +#define KC_DISABLED 0x20 /* key is disabled */ /* Values for trust bits in keycntrl packet after userid packet */ #define KC_LEGIT_MASK 0x03 /* Key legit bits for key */ @@ -146,12 +150,9 @@ #define KC_SIGTRUST_MARGINAL 0x05 #define KC_SIGTRUST_COMPLETE 0x06 #define KC_SIGTRUST_ULTIMATE 0x07 +#define KC_SIG_CHECKED 0x40 /* This sig has been checked */ #define KC_CONTIG 0x80 /* This sig is on a cert. path */ -#define MAINT_CHECK 0x01 -#define MAINT_VERBOSE 0x02 -#define MAINT_SILENT 0x04 - #define is_secret_key(ctb) is_ctb_type(ctb,CTB_CERT_SECKEY_TYPE) #define MPILEN (2+MAX_BYTE_PRECISION) @@ -181,18 +182,15 @@ boolean is_armor_file(char *infile, long int armor_file(char *infile, char *outfile, char *filename, char *clearname); int de_armor_file(char *infile, char *outfile, long *curline); -void exitPGP(int); -void user_error(); +void user_error(void); /* Global filenames and system-wide file extensions... */ -extern char CTX_EXTENSION[]; extern char PGP_EXTENSION[]; extern char ASC_EXTENSION[]; extern char SIG_EXTENSION[]; extern char BAK_EXTENSION[]; extern char CONSOLE_FILENAME[]; extern char rel_version[]; -extern char rel_date[]; /* These files use the environmental variable PGPPATH as a default path: */ extern char PUBLIC_KEYRING_FILENAME[32]; @@ -201,6 +199,7 @@ extern char RANDSEED_FILENAME[32]; /* Variables which are global across the driver code */ extern boolean filter_mode; +extern boolean moreflag; extern FILE *pgpout; /* FILE structure for routine output */ /* Variables settable by config.pgp and referenced in config.c ... */ @@ -209,14 +208,22 @@ extern char charset[]; /* my_name is substring of default userid for secret key to make signatures */ extern char my_name[]; extern char floppyring[]; /* for comparing secret keys with backup on floppy */ -extern char lit_mode; /* text or binary mode for literal packet */ +extern char literal_mode; /* text or binary mode for literal packet */ extern boolean emit_radix_64; extern boolean showpass; extern boolean keepctx; extern boolean verbose; /* display maximum information */ extern boolean compress_enabled; /* attempt compression before encryption */ extern boolean clear_signatures; +extern boolean encrypt_to_self; /* Should I encrypt to myself? */ +extern boolean batchmode; /* for batch processing */ +extern boolean quietmode; /* less verbose */ +extern boolean force_flag; /* overwrite existing file without asking */ +extern boolean pkcs_compat; /* Use PKCS format messages */ +/* Ask for each key separately if it should be added to the keyring */ +extern boolean interactive_add; extern long timeshift; /* seconds from GMT timezone */ +extern boolean signature_checked; extern int pem_lines; extern int marg_min; /* number of marginally trusted signatures needed to make a key fully-legit */ @@ -224,7 +231,16 @@ extern int compl_min; /* number of fully extern int max_cert_depth; extern char pager[]; /* file lister command */ -extern char trust_lst[8][16]; +/* These lists store hashed passwords for future use. */ +/* passwds are passwords of as-yet-unknown purpose; keypasswds + are passwords used to decrypt keys. */ +struct hashedpw { + struct hashedpw *next; + byte hash[16]; +}; +extern struct hashedpw *keypasswds, *passwds; + +extern boolean strip_spaces; #ifdef VMS /* @@ -232,7 +248,9 @@ extern char trust_lst[8][16]; */ int fdl_generate(char *in_file, char **fdl, short *len); -void *fdl_create( char *fdl, short len, char *outfile, char *preserved_name); -int fdl_copyfile2bin(FILE *f, void *rab, word32 longcount); -void fdl_close( void *rab); +VOID *fdl_create( char *fdl, short len, char *outfile, char *preserved_name); +int fdl_copyfile2bin(FILE *f, VOID *rab, word32 longcount); +void fdl_close( VOID *rab); #endif /* VMS */ + +extern int compressSignature(byte *header);