aboutsummaryrefslogtreecommitdiffstats
path: root/g10/cipher-aead.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2023-05-24 01:36:04 +0000
committerNIIBE Yutaka <[email protected]>2023-05-24 01:36:04 +0000
commit2f872fa68c6576724b9dabee9fb0844266f55d0d (patch)
tree8496ce6451f117e6a70c885587430171906c04ba /g10/cipher-aead.c
parentscd: Fix send_client_notifications for Windows. (diff)
downloadgnupg-2f872fa68c6576724b9dabee9fb0844266f55d0d.tar.gz
gnupg-2f872fa68c6576724b9dabee9fb0844266f55d0d.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. -- GnuPG-bug-id: 6481 Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'g10/cipher-aead.c')
-rw-r--r--g10/cipher-aead.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/g10/cipher-aead.c b/g10/cipher-aead.c
index 640d8432f..0c07e65de 100644
--- a/g10/cipher-aead.c
+++ b/g10/cipher-aead.c
@@ -174,8 +174,6 @@ write_header (cipher_filter_context_t *cfx, iobuf_t a)
log_debug ("aead packet: len=%lu extralen=%d\n",
(unsigned long)ed.len, ed.extralen);
- write_status_printf (STATUS_BEGIN_ENCRYPTION, "0 %d %d",
- cfx->dek->algo, ed.aead_algo);
print_cipher_algo_note (cfx->dek->algo);
if (build_packet( a, &pkt))
@@ -488,6 +486,11 @@ cipher_filter_aead (void *opaque, int control,
{
mem2str (buf, "cipher_filter_aead", *ret_len);
}
+ else if (control == IOBUFCTRL_INIT)
+ {
+ write_status_printf (STATUS_BEGIN_ENCRYPTION, "0 %d %d",
+ cfx->dek->algo, cfx->dek->use_aead);
+ }
return rc;
}