-
Notifications
You must be signed in to change notification settings - Fork 546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix zip file extension in cli compression #386
Conversation
Using the zip extension here doesn't seem right. While zlib is afaik the same compression algo used in zip, the output of --compress=zlib will not be a standard infozip file and in fact I'm not sure there are any standard Unix or Windows tools which understand 'plain' RFC 1950 zlib. Unless I'm missing something else about this? |
Your right. I did not put a lot of research into that one because I thought it is a simple typo. I never saw a .zlib file. .zip files are higher level containers, so definitely not correct here.
But what is the difference between zlib and gzip? Isn't the first an implementation of the second? |
It is kind of confusing really... there is zlib the library which implements deflate compression (RFC 1951). On top of deflate compression several different incompatible compression formats are defined including gzip (RFC 1952) and zlib (RFC 1950), and also IIRC .zip. Early versions of zlib (the library) only produced zlib format, which is deflate + simple header + Adler32 checksum (or I think it could do raw deflate with no headers using a special mode; more recent versions have this anyway). It is only somewhat recently (zlib 1.2.0 and higher) that zlib (the library) can handle gzip (the format). Old versions of gzip (the command line program) would call zlib (the library) to produce raw deflate bits and added the gzip headers and checksum (a CRC instead of Adler32) itself. Because for such a long time zlib (the library) could only easily produce zlib (the format) and not gzip (the format), it is common for zlib format to show up in binary protocols even though command line support for it is minimal to non-existent. For example the only compression algorithm ever really defined for TLS was zlib, XMPP compression has RFC 1950 zlib as mandatory to implement, etc. |
Thanks for the great explanation, which helped a lot to make things clearer. I tried to put that into comments. This leads to another question: What about lzma and xz? As far as my research goes, .xz requires LZMA2 data:
from the .xz file format documentation at http://tukaani.org/xz/xz-file-format.txt. This is the same that Wiki says:
Assuming "lzma" runs |
At least on my system /usr/include/lzma/ and liblzma come from the $ echo foo > foo Based on the comments from lzma/container.h, XZ is basically identical to LZMA2 (or is a file format built around LZMA2, shades of gzip/zlib formats built on deflate I guess). It appears LZMA1 can be done using the |
Issue randombit#386: Use RDRAND in OpenSSL if that engine is available.
No description provided.