Closed FauxFaux closed 7 years ago
The files are signed with gzsig
, a deprecated tool which makes use of the "extra field" in the gzip header.
I made a simple example file, which fails in a more interesting way: read_exact
goes wrong somewhere.
https://b.goeswhere.com/world.gz
https://b.goeswhere.com/world.signed.gz
I made these using printf hello | gzip -n > world.gz
, and signing it using my ~/.ssh/id_rsa using a build of gzsig from an old commit in https://github.com/chneukirchen/outils . I have no idea if it's done anything useful, but the gzip file is readable by gzip/libarchive, and not by libflate.
The problem appears to be that there's a rogue {0x05, 0x01}
between the header and the extra field:
% xxd world.signed.gz
00000000: 1f8b 0804 0000 0000 0003 0501 4753 0101 ............GS..
I do not know what that is.
Aha! The extra field code is wrong.
The format is [LE len, 2 bytes] [id, 2 bytes] [LE len again, 2 bytes]. The code is trying to read just the second two.
The releases for the "joe" / "jupp" text editor, from mirbsd, cause the decompressor to panic (in debug mode) or error (in release mode).
This has happened on multiple releases, so I'm guessing it's a BSD gzip implementation quirk.
Neither GNU gzip or libarchive (
bsdtar
) gives the slightest hint that something might be wrong.Download link: http://deb.debian.org/debian/pool/main/j/jupp/jupp_3.1.30.orig.tar.gz https://www.mirbsd.org/MirOS/dist/jupp/joe-3.1jupp30.tgz