Commit graph

346 commits

Author SHA1 Message Date
Con Kolivas e1af8fb0c0 Remove unused functions from aes.c and sha4.c 2011-03-16 00:51:28 +11:00
Con Kolivas 5da0633893 aes_crypt_cbc will allow you to work on the same buffer, so don't bother allocating a separate buffer.
Allocate slightly more on the buffer that might be used for encryption rather than reallocing.
2011-03-16 00:46:39 +11:00
Con Kolivas f61632670e Encrypt the md5 value as well to make the file unidentifiable. 2011-03-16 00:29:10 +11:00
Con Kolivas bf1c1ababc Support correct seeking when doing get_fileinfo on encrypted archives. 2011-03-16 00:04:44 +11:00
Con Kolivas c5938c6a8b Implement the actual aes cbc encryption and decryption. 2011-03-15 23:52:39 +11:00
Con Kolivas acb023988f Generate sha512 hash and hash iv required to encrypt based on password, timestamp, loops and random salt. 2011-03-15 21:18:29 +11:00
Con Kolivas bc86829763 Modify aes and sha from polar to build into lrzip. 2011-03-15 20:22:26 +11:00
Con Kolivas ff4b8303a7 Import aes and sha2 libraries from polarssl code. 2011-03-15 20:07:15 +11:00
Con Kolivas 412cf013c4 Implement passphrase input. 2011-03-15 16:32:32 +11:00
Con Kolivas 202d972a6c Add encryption -e option and flag encryption with a control flag, removing encrypt field. 2011-03-15 15:04:58 +11:00
Con Kolivas 65f901a83c Get the seconds, salt and encryption loop data before compressing.
Store seconds in only 5 bytes which is enough for 400 years, leaving more room for random data.
2011-03-15 14:41:47 +11:00
Con Kolivas 6a903eff8d Convert the usecs field to a dedicated salt one which has 6 random bytes and 2 encoded loops bytes. 2011-03-15 13:14:27 +11:00
Con Kolivas 0ffa041f36 Add function to get a stream of random numbers into a buffer from /dev/urandom if possible, and falling back to random() if not. 2011-03-15 12:56:23 +11:00
ckolivas e26d0d1381 Clear the temporary infile where possible as well when we have falen back to it. 2011-03-15 11:27:07 +11:00
ckolivas 65a681a254 Relative offset is not required in tmp inbuf, it can be safely zeroed. 2011-03-15 11:21:26 +11:00
ckolivas cb1f630fe0 Tidy. 2011-03-15 10:41:17 +11:00
ckolivas 091909b552 Refuse to compress a file smaller than a minimum size. 2011-03-15 10:40:14 +11:00
ckolivas fca5d4232c Refuse to perform file info from STDIN. 2011-03-15 09:56:45 +11:00
Con Kolivas 8a83741c32 Clear tmpinbuf between chunks. 2011-03-14 22:03:13 +11:00
Con Kolivas 3a8c0b6689 Remove seeks that aren't required and don't work on tmp input buffers.
Clean up open_stream_in.
2011-03-14 21:51:27 +11:00
Con Kolivas c832e80085 More infrastructure to read from temporary buffers on stdin decompression. 2011-03-14 21:19:57 +11:00
Con Kolivas 36e09f206e Begin massive read changes to support using temporary file for STDIN. 2011-03-14 20:22:45 +11:00
Con Kolivas 91b8382214 Read magic specially when decompressing from STDIN. 2011-03-14 18:16:14 +11:00
Con Kolivas d56c826725 Add fd_in field to struct rzip_control. 2011-03-14 14:58:41 +11:00
Con Kolivas 00be150cfb Add flag tests for TMP_INBUF. 2011-03-14 14:56:59 +11:00
Con Kolivas 684959efed Add fields for temporary input buffer and clamp memory accordingly in preparation. 2011-03-14 14:47:26 +11:00
Con Kolivas 5f7a03932b Calculate the total expected size progressively and show it when it's not known. 2011-03-14 13:32:36 +11:00
Con Kolivas dc360b52dc Update message when dumping buffer and make it maxverbose only. 2011-03-14 12:54:40 +11:00
Con Kolivas 9e772d3140 Make ALL decompression use temporary in-ram buffer whenever possible. 2011-03-14 12:48:40 +11:00
Con Kolivas 27d7c2a031 Tidy. 2011-03-14 12:23:12 +11:00
Con Kolivas 0fe3213a47 Write to physical files if we cannot fit the decompression in ram. 2011-03-14 12:15:54 +11:00
Con Kolivas aeefba2190 Allocate slightly more so we can cope when the buffer overflows and fall back to a real temporary file. 2011-03-14 11:37:56 +11:00
Con Kolivas 37009e2ac5 Make sure to read on an fd if that's what we're supposed to be doing. 2011-03-14 11:25:04 +11:00
Con Kolivas b644240152 write_1g always uses control->fd_out so don't pass fd to it. 2011-03-14 11:15:35 +11:00
Con Kolivas 7eabb5e7de Check seek hasn't made the pseudo file longer. 2011-03-14 11:12:12 +11:00
Con Kolivas 19ef7298c8 Cast fstat values to i64 to prevent 32 bit overflows. 2011-03-14 10:21:10 +11:00
Con Kolivas e138fa77ff Use temporary files for now with TEST_ONLY mode. 2011-03-14 10:19:53 +11:00
Con Kolivas 4a6fa7602f Begin decompressing to stdout via temporary buffer by creating a read/write wrapper. 2011-03-14 10:07:51 +11:00
Con Kolivas d9e9f0d71d No need to keep usable_ram as a rzip_control variable. 2011-03-13 22:28:28 +11:00
Con Kolivas 66fe056f30 Don't use open coded flags. 2011-03-13 22:22:46 +11:00
Con Kolivas 938ef76182 Clean indent. 2011-03-13 22:19:28 +11:00
Con Kolivas 17c35cb331 Use the usable_ram variable just to determine the maximum size allocatable. 2011-03-13 22:16:46 +11:00
Con Kolivas 6853c2359e Merge branch 'master' into newconf 2011-03-13 22:08:03 +11:00
Con Kolivas f2ddd9022c Ignore the eof flag if the file size is known. 2011-03-13 21:31:03 +11:00
Con Kolivas b17540d32e Fix decompressing single chunk stdout chunked archives. 2011-03-13 18:14:50 +11:00
Con Kolivas e0a0e6b277 Whitespace fix. 2011-03-13 18:13:46 +11:00
Con Kolivas fe0416be9d Fix whitespace indentation. 2011-03-13 18:12:05 +11:00
Con Kolivas 8756fe91e2 Enable decompression when file has been chunked stdout and display progress only when expected size is known. 2011-03-13 17:52:23 +11:00
Con Kolivas a023420cdc Make get_filefinfo read over whole file to get uncompressed size for when it's not known due to being a stdout chunked file.
Don't display microseconds in information as it will be removed.
2011-03-13 17:31:30 +11:00
Con Kolivas 6d0ac95170 Remove extra locking that does nothing. 2011-03-13 12:12:37 +11:00