gpg: Improve check for already compressed packets.
authorWerner Koch <wk@gnupg.org>
Fri, 24 Mar 2017 10:51:44 +0000 (11:51 +0100)
committerWerner Koch <wk@gnupg.org>
Fri, 24 Mar 2017 10:51:44 +0000 (11:51 +0100)
commit0b3770c421a35b64823a805fa8d49ddd5c653d50
tree8ee4bb26b2c725b7bf20bb9ec4e926258ace6e0a
parent2c237c13628a88ba23742da34ea18d3e205d7c53
gpg: Improve check for already compressed packets.

* common/miscellaneous.c (is_openpgp_compressed_packet): New.
(is_file_compressed): Rerad 2 more bytes and call new function.

--

Note that this does not yet allow to detect compressed data piped to
gpg.  This requires a proper read-ahead in iobuf.c which is
complicated due to the auto-removal of filter functions.  Thus such an
read-ahead needs to be done in the I/O backend of iobuf.

Signed-off-by: Werner Koch <wk@gnupg.org>
common/miscellaneous.c