--- pgp/src/crypto.h 2018/04/24 16:37:53 1.1 +++ pgp/src/crypto.h 2018/04/24 16:41:19 1.1.1.4 @@ -13,7 +13,7 @@ int signfile(boolean nested, boolean sep int get_header_info_from_file(char *infile, byte *header, int count); /* RSA-encrypt a file */ -int encryptfile(char *mcguffin, char *infile, char *outfile, +int encryptfile(char **mcguffin, char *infile, char *outfile, boolean attempt_compression); /* Encrypt file with IPES/IDEA cipher */ @@ -29,7 +29,7 @@ int decryptfile(char *infile, char *outf /* Check signature in infile for validity. Strip off the signature and write the remaining packet to outfile */ int check_signaturefile(char *infile, char *outfile, boolean strip_signature, - boolean explicit_outfile_flag); + char *preserved_name); /* Decrypt file with IPES/IDEA only */ int idea_decryptfile(char *infile, char *outfile); @@ -38,23 +38,25 @@ int idea_decryptfile(char *infile, char int decompress_file(char *infile, char *outfile); /* Strip off literal prefix from infile, copying to outfile */ -int strip_literal(char *infile, char *outfile, boolean explicit_outfile_flag, +int strip_literal(char *infile, char *outfile, char *preserved_name, char *lit_mode); +struct IdeaCfbContext; /* Write a multiprecision integer to a file */ -void write_mpi(unitptr n, FILE *f, boolean scrambled); +void write_mpi(unitptr n, FILE *f, struct IdeaCfbContext *cfb); /* Read a mutiprecision integer from a file */ -int read_mpi(unitptr r, FILE *f, boolean adjust_precision, boolean scrambled); +int read_mpi(unitptr r, FILE *f, boolean adjust_precision, struct IdeaCfbContext *cfb); /* Convert C <-> Quiche strings */ void CToPascal(char *s); void PascalToC( char *s ); -/* Reads IPES/IDEA random key and random number seed from file, cranks the - the seed through the idearand strong pseudorandom number generator, and - writes them back out */ -int strong_pseudorandom(byte *buf, int bufsize); +/* Tests if a randseed.bin file exists already */ +int seedfile_exists(void); + +/* Creates a randseed.bin file (call if above returns false) */ +void create_seedfile(void); /* Return date string, given pointer to 32-bit timestamp */ char *cdate(word32 *tstamp); @@ -82,3 +84,4 @@ int squish_file(char *infile, char *outf int signkey(char *keyguffin, char *sigguffin, char *keyfile); +extern int compromise(byte *keyID, char *keyfile);