--- pgp/src/keymgmt.h 2018/04/24 16:40:07 1.1.1.4 +++ pgp/src/keymgmt.h 2018/04/24 16:44:36 1.1.1.8 @@ -4,9 +4,10 @@ /* 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); +int dokeygen(char *numstr, char *numstr2, char *username); /* Edit the userid and/or pass phrase for an RSA key pair, and put them back into the ring files */ @@ -18,9 +19,11 @@ int extract_from_keyring (char *mcguffin boolean transflag); /* Lists all entries in keyring that have mcguffin string in userid */ -int view_keyring(char *mcguffin, char *ringfile, boolean show_signatures, boolean show_hashes); +int view_keyring(char *mcguffin, char *ringfile, + boolean show_signatures, boolean show_hashes); -/* Signature-check all entries in keyring that have mcguffin string in userid */ +/* Signature-check all entries in keyring that have mcguffin string + in userid */ int dokeycheck(char *mcguffin, char *ringfile, int options); /* options: */ #define CHECK_ALL 0 /* Check all signatures */ @@ -30,7 +33,8 @@ int dokeycheck(char *mcguffin, char *rin int remove_sigs(char *mcguffin, char *ringfile); /* Remove the first entry in key ring that has mcguffin string in userid */ -int remove_from_keyring(byte *keyID, char *mcguffin, char *ringfile, boolean secring_too); +int remove_from_keyring(byte *keyID, char *mcguffin, + char *ringfile, boolean secring_too); /* Extract key fragment from modulus n */ void extract_keyID(byteptr keyID, unitptr n); @@ -40,8 +44,9 @@ void writekeyID(unitptr n, FILE *f); /* Extract public key corresponding to keyID or userid from keyfile */ int getpublickey(int flags, char *keyfile, - long *file_position, int *pktlen, byte *keyID, - byte *timestamp, byte *userid, unitptr n, unitptr e); + long *file_position, int *pktlen, byte *keyID, + byte *timestamp, byte *userid, unitptr n, + unitptr e); /* flags: */ #define GPK_GIVEUP 1 #define GPK_SHOW 2 @@ -50,6 +55,7 @@ int getpublickey(int flags, char *keyfil /* 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, @@ -68,7 +74,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); @@ -80,7 +87,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 );