--- pgp/src/keymgmt.h 2018/04/24 16:39:18 1.1.1.3 +++ pgp/src/keymgmt.h 2018/04/24 16:42:14 1.1.1.6 @@ -4,6 +4,7 @@ /* Return printable public key fragment. */ char *keyIDstring(byte *keyID); char *key2IDstring(unitptr n); +extern char const blankkeyID[]; /* Do an RSA key pair generation, and write them out to the keyring files. */ int dokeygen(char *numstr, char *numstr2); @@ -47,12 +48,16 @@ int getpublickey(int flags, char *keyfil #define GPK_SHOW 2 #define GPK_NORVK 4 #define GPK_DISABLED 8 +/* Flag used in getsecretkey() only - should it be GSK_? */ +/* Prevents use of existing password list. */ +#define GPK_ASKPASS 16 +#define GPK_SECRET 32 /* We are actually getting a secret key */ /* Extract private key corresponding to keyID or userid from keyfile */ -int getsecretkey(int flags, char *keyfile, byte *keyID, - byte *timestamp, char *passp, boolean *hkey, byte *userid, - unitptr n, unitptr e, unitptr d, unitptr p, unitptr q, - unitptr u); +int getsecretkey(int flags, char *keyfile, byte *keyID, byte *timestamp, + byte *hpass, boolean *hkey, byte *userid, + unitptr n, unitptr e, unitptr d, unitptr p, unitptr q, + unitptr u); /* Return true if ctb is one for a key in a keyring */ int is_key_ctb (byte ctb); @@ -65,7 +70,8 @@ short nextkeypacket(FILE *f, byte *pctb) /* Read the next key packet from file f, return info about it in the various * pointers. Most pointers can be NULL without breaking it. */ -short readkeypacket(FILE *f, boolean hidekey, byte *pctb, +struct IdeaCfbContext; +short readkeypacket(FILE *f, struct IdeaCfbContext *cfb, byte *pctb, byte *timestamp, char *userid, unitptr n ,unitptr e, unitptr d, unitptr p, unitptr q, unitptr u, byte *sigkeyID, byte *keyctrl); @@ -77,7 +83,7 @@ int getpubuserid(char *keyfile, long key long *userid_position, int *userid_len, boolean exact_match); int getpubusersig(char *keyfile, long user_position, byte *sigkeyID, - long *sig_position, int *sig_len); + byte *timestamp, long *sig_position, int *sig_len); void getKeyHash( byte *hash, unitptr n, unitptr e ); void printKeyHash( byteptr hash, boolean indent );