aboutsummaryrefslogtreecommitdiffstats
path: root/common/iobuf.h
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2023-05-24 01:36:04 +0000
committerNIIBE Yutaka <[email protected]>2023-11-16 23:40:49 +0000
commit960877b10f42ba664af4fb29130a3ba48141e64a (patch)
treef1b7f5e6ea92a33b9ea6c0aa46a091caab457af4 /common/iobuf.h
parentscd:p15: Basic support for Starcos 3.2. (diff)
downloadgnupg-960877b10f42ba664af4fb29130a3ba48141e64a.tar.gz
gnupg-960877b10f42ba664af4fb29130a3ba48141e64a.zip
gpg: Report BEGIN_* status before examining the input.
* common/miscellaneous.c (is_openpgp_compressed_packet) (is_file_compressed): Moved to ... * common/iobuf.c: ... in this file. (is_file_compressed): Change the argument to INP, the iobuf. * common/util.h (is_file_compressed): Remove. * common/iobuf.h (is_file_compressed): Add. * g10/cipher-aead.c (write_header): Don't call write_status_printf here. (cipher_filter_aead): Call write_status_printf when called with IOBUFCTRL_INIT. * g10/cipher-cfb.c (write_header): Don't call write_status_printf here. (cipher_filter_cfb): Call write_status_printf when called with IOBUFCTRL_INIT. * g10/encrypt.c (encrypt_simple): Use new is_file_compressed function, after call of iobuf_push_filter. (encrypt_crypt): Likewise. * g10/sign.c (sign_file): Likewise. -- Cherry-pick from master commit of: 2f872fa68c6576724b9dabee9fb0844266f55d0d GnuPG-bug-id: 6481 Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'common/iobuf.h')
-rw-r--r--common/iobuf.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/iobuf.h b/common/iobuf.h
index 751ae73c3..04e6b4421 100644
--- a/common/iobuf.h
+++ b/common/iobuf.h
@@ -625,6 +625,9 @@ void iobuf_set_partial_body_length_mode (iobuf_t a, size_t len);
from the following filter (which may or may not return EOF). */
void iobuf_skip_rest (iobuf_t a, unsigned long n, int partial);
+/* Check if the file is compressed, by peeking the iobuf. */
+int is_file_compressed (iobuf_t inp);
+
#define iobuf_where(a) "[don't know]"
/* Each time a filter is allocated (via iobuf_alloc()), a