ckolivas
|
f225f9f173
|
Move to c99 in preparation for pedantic warning compatibility.
|
2012-03-07 12:42:42 +11:00 |
|
Carlo Alberto Ferraris
|
81f89fe4ca
|
silly cosmetic change
|
2011-12-05 15:23:54 +01:00 |
|
Con Kolivas
|
d9fb70bffc
|
Fixes.
|
2011-09-16 23:06:17 +10:00 |
|
Con Kolivas
|
18105bbf7c
|
Merge branch 'master' into liblrzip
Conflicts:
lrzip.c
|
2011-09-16 22:55:34 +10:00 |
|
Con Kolivas
|
00700c1d42
|
Change permission and owner warning to verbose logging only instead of error.
|
2011-09-16 21:14:21 +10:00 |
|
discomfitor
|
3316dd5505
|
remove trailing whitespace
|
2011-08-17 20:59:41 +10:00 |
|
discomfitor
|
949c6d7a97
|
another semi-clusterfuck commit: *new logging macros *allow compression to and from any FILE, not just stdin/stdout *update main.c to work with the above
|
2011-08-17 20:59:41 +10:00 |
|
discomfitor
|
6dd20d735b
|
giant clusterfuck commit: *add and use alloca/strdupa in some spots *implement return values on almost every function *free() is now a macro which also nulls the freed pointer *when in 'library mode', fatal_exit() will not be called *fatal()/failure() are now macros which add line number and file for logging *all occurrences of fatal/failure in files other than main.c are now wrapped to use a logging callback (if specified) and then return *functions now clean up resources on returning with an error
|
2011-08-17 20:59:40 +10:00 |
|
discomfitor
|
133b201867
|
move more code out of main.c, allocate outfile suffix
|
2011-08-17 20:59:40 +10:00 |
|
discomfitor
|
08d2294e5e
|
add password callback hook
|
2011-08-17 20:59:40 +10:00 |
|
discomfitor
|
cbff8faef7
|
move liblrzip.h contents to lrzip_private.h global variables-----
|
2011-08-17 20:59:40 +10:00 |
|
discomfitor
|
cfd6915b20
|
move some initialization stuff out of main()
|
2011-08-17 20:59:40 +10:00 |
|
discomfitor
|
59f10b2c9c
|
move functions+defines out of main.c
|
2011-08-17 20:59:40 +10:00 |
|
Con Kolivas
|
b85d08a9ec
|
Don't set executable bit in unknown permission circumstances.
|
2011-05-08 01:28:34 +10:00 |
|
Con Kolivas
|
1ea75154d6
|
Silence compiler warnings.
|
2011-05-08 00:05:46 +10:00 |
|
Con Kolivas
|
542c1637b2
|
Cope with zero byte older files in get fileinfo.
|
2011-05-07 23:58:38 +10:00 |
|
Con Kolivas
|
aca5123d72
|
Support zero byte sized pre 0.6 archives by setting the eof flag always.
|
2011-05-07 23:36:55 +10:00 |
|
Con Kolivas
|
55dc9b0095
|
Fix the arbitrary lower limit of 128 bytes by compressing zeroes beyond the size of the chunk.
Put special case management of zero sized files.
Modify the percentage calculation to be able to cope with small numbers and zeroes.
|
2011-05-07 18:37:25 +10:00 |
|
Jari Aalto
|
476dce3e66
|
lrzip.c: (get_magic): Fix spelling mistake
|
2011-04-21 20:01:48 +03:00 |
|
ckolivas
|
127a101b14
|
Disable md5 checking on apple for now till someone fixes it.
|
2011-04-13 14:50:26 +10:00 |
|
Con Kolivas
|
f81f8c68c7
|
Fixes to make lrzip compile on cygwin courtesy of Тулебаев Салават .
|
2011-04-11 21:51:53 +10:00 |
|
Con Kolivas
|
920ad9251d
|
Make open use mode 0777 since it will already be & ~umask it will preserve the default permissions.
Don't try to copy permissions from STDIN.
|
2011-04-10 11:03:45 +10:00 |
|
Con Kolivas
|
915edb78a2
|
Remove unused variables and functions.
|
2011-03-23 08:16:07 +11:00 |
|
Con Kolivas
|
b27e1df879
|
Revert "Modify the file format to not include rzip chunk size except for STDOUT chunked files thus decreasing the file format size further."
This reverts commit 131d4c92c2.
Breaks STDIN/OUT so revert this change and cope with the slightly extra file size on non-chunked files.
|
2011-03-23 07:59:04 +11:00 |
|
Con Kolivas
|
8077412ee5
|
Allow files with non-standard extensions to be tested or decompressed if they actually exist.
Don't allow a suffix if an actual output filename has been specified.
Convert ints to chars when they can be.
|
2011-03-23 01:51:40 +11:00 |
|
Con Kolivas
|
74f7b3deb6
|
Cope with trying to force when write bit is disabled and use mode 0600 instead of 0666.
Patch by Serge Belyshev.
|
2011-03-23 00:42:58 +11:00 |
|
Con Kolivas
|
70e7866271
|
Include arpa/inet.h for those OSs that have endian details elsewhere.
|
2011-03-22 21:47:24 +11:00 |
|
Con Kolivas
|
a901b015bf
|
Revert "Try endian swap on dicSize."
This reverts commit 74b0b71e0b.
Broken crap.
|
2011-03-22 20:49:51 +11:00 |
|
ckolivas
|
74b0b71e0b
|
Try endian swap on dicSize.
|
2011-03-22 18:15:18 +11:00 |
|
Con Kolivas
|
131d4c92c2
|
Modify the file format to not include rzip chunk size except for STDOUT chunked files thus decreasing the file format size further.
|
2011-03-22 09:04:24 +11:00 |
|
Con Kolivas
|
7101372167
|
memcpy is a silly way to set that variable which may be different size.
|
2011-03-22 08:19:21 +11:00 |
|
Con Kolivas
|
8614ede6e0
|
Should be doing endian change on variable, not pointer.
|
2011-03-22 08:03:05 +11:00 |
|
Con Kolivas
|
2736118f82
|
Check for different endian.h includes and variants of le32toh.
|
2011-03-22 07:57:32 +11:00 |
|
Con Kolivas
|
a30efcaa55
|
Portable generic byteswap for BE.
|
2011-03-22 00:13:29 +11:00 |
|
Con Kolivas
|
dfcce76594
|
BE #7 fixes.
|
2011-03-21 21:35:25 +11:00 |
|
Con Kolivas
|
8c8f5bdd48
|
lrz_crypt tweaks courtesy of Serge Belyshev.
|
2011-03-21 20:54:53 +11:00 |
|
Con Kolivas
|
738cde54ed
|
More BE fixes.
|
2011-03-20 22:31:38 +11:00 |
|
Con Kolivas
|
f87528d14d
|
Forgot to include salt length for next head.
|
2011-03-20 17:01:33 +11:00 |
|
Con Kolivas
|
30b70dc884
|
Fixes for non little endian machines.
|
2011-03-20 16:16:38 +11:00 |
|
Con Kolivas
|
0dad7dcc5a
|
Modify the encrypted version to not write down the rzip chunk size, then keep track of where each block header is written, go back and write 8 bytes of salt before it and encrypt the headers in place.
|
2011-03-20 15:45:44 +11:00 |
|
Con Kolivas
|
0b1db75a44
|
Cleanups.
|
2011-03-19 13:53:43 +11:00 |
|
Con Kolivas
|
b11b5a0b5d
|
Need to memset magic to zero to prevent garbage beign written to fields not written.
|
2011-03-19 01:16:21 +11:00 |
|
Con Kolivas
|
63fb1bafea
|
Modify the file format further to make all block header information only encode the number of bytes determined in chunk_bytes instead of 8 full bytes all the time.
|
2011-03-18 23:18:36 +11:00 |
|
ckolivas
|
5005c2dff5
|
Get rid of extra data in new header and stick to old header size, compacting extra info into existing space.
|
2011-03-18 17:32:47 +11:00 |
|
ckolivas
|
b8d8ecfe33
|
Fix warnings.
Patch ~ by Serge Belyshev.
|
2011-03-18 10:37:09 +11:00 |
|
ckolivas
|
e856d481bf
|
Discard hash_iv entirely, using passphrase hash and centralise key generation.
Patch by Serge Belyshev.
|
2011-03-18 10:22:58 +11:00 |
|
Con Kolivas
|
a3e80871c2
|
Add 8 bytes of random data to the start of every encrypted compressed block and use it along with 8 bytes from the stored salt to make a unique key and IV for encryption.
|
2011-03-18 00:06:11 +11:00 |
|
ckolivas
|
9049263f6f
|
Make fd_out read/write in preparation for reading, encrypting, and then writing header data back.
|
2011-03-17 17:36:52 +11:00 |
|
ckolivas
|
7cbf870679
|
fdout_seekto will not always be seeking to zero.
|
2011-03-17 17:25:23 +11:00 |
|
ckolivas
|
e78069c0d7
|
Consolidate magic writing to be able to seek to read and encrypt block header data later.
|
2011-03-17 16:59:27 +11:00 |
|
ckolivas
|
d63a9a02ff
|
Use a separate IV for when it is sequentially updated in preparation for encrypting the headers as well.
|
2011-03-17 16:00:57 +11:00 |
|
ckolivas
|
9d496236c5
|
Read remainder of magic information for ver06 files when reading from STDIN.
Refuse to decompress encrypted files from STDIN as well.
|
2011-03-17 13:08:36 +11:00 |
|
ckolivas
|
0fd18f27f5
|
Remove redundant code and check return value of fgets.
|
2011-03-17 09:54:50 +11:00 |
|
Con Kolivas
|
4d72e6d765
|
Apply fixes so that ciphertext matches. Patch courtesy of Serge Belyshev.
|
2011-03-17 07:03:40 +11:00 |
|
Con Kolivas
|
5fd7c82e1f
|
Implement ciphertext stealing to not have to pad compressed blocks courtesy of Serge Belyshev who saved me hours of debugging thanks!
|
2011-03-16 21:24:05 +11:00 |
|
Con Kolivas
|
57944b1d5c
|
Zero, unlock and free ram more strictly.
|
2011-03-16 12:38:10 +11:00 |
|
Con Kolivas
|
7e71d8689f
|
Put carriage returns in right place after password prompts.
|
2011-03-16 11:10:46 +11:00 |
|
Con Kolivas
|
928a0a098a
|
Consolidate padded length throughout.
|
2011-03-16 10:29:16 +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
|
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 |
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
6ac74aa9f0
|
Create a flag to know when the temporary output buffer is in use, in preparation for when we use it on decompression.
|
2011-03-13 08:34:06 +11:00 |
|
Con Kolivas
|
2f87f62696
|
Make the tmp out buf slightly larger to account for incompressible data, and check for buffer overflows.
|
2011-03-13 08:16:46 +11:00 |
|
Con Kolivas
|
823a51cc74
|
Move const one_g to correct place.
|
2011-03-12 22:50:40 +11:00 |
|
Con Kolivas
|
d067a6ea9e
|
Implement the real workings of writing to a temporary buffer before flushing to stdout.
|
2011-03-12 22:46:57 +11:00 |
|
Con Kolivas
|
1397c0f832
|
Create custom "loop count" system to determine how many times to hash a password when encrypting based on the datestamp.
This data will be stored as a 2 byte entry in the header in the future (b1 and b2).
|
2011-03-12 20:31:56 +11:00 |
|
Con Kolivas
|
7fbec0a783
|
Prepare to write compressed output by flushing stdout after each chunk is compressed.
|
2011-03-12 19:56:08 +11:00 |
|
Con Kolivas
|
c75a50f723
|
Being modifying write_1g function to be able to write to a temporary buffer instead of straight to fd_out.
Split out make_magic to be able to write magic wherever we want later.
|
2011-03-12 14:13:28 +11:00 |
|
Con Kolivas
|
885c6b327f
|
Add storage time display if it exists in maxverbose info.
|
2011-03-12 11:55:15 +11:00 |
|
Con Kolivas
|
6642955375
|
Update magic header info. It turns out I can't add.
Fix fileinfo to be able to read version 0.6x files.
|
2011-03-12 11:40:51 +11:00 |
|
Con Kolivas
|
fe68b9a3f7
|
Institute writing and reading of 0.6 file format for compress/decompress.
|
2011-03-12 11:17:11 +11:00 |
|
Con Kolivas
|
d87df4f44e
|
Store the file size as zero when the magic header will be written before the size is known.
|
2011-03-11 23:45:22 +11:00 |
|
Con Kolivas
|
a10d423596
|
Write/read new magic header and fix version number in configure.ac
|
2011-03-11 23:29:56 +11:00 |
|
Con Kolivas
|
9bd7468465
|
Fix fileinfo output for versions < 0.5.
|
2011-03-11 21:46:23 +11:00 |
|
Con Kolivas
|
64ca85120c
|
Add chunk_byte reading to information output.
|
2011-03-11 21:26:42 +11:00 |
|