aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine-gpg.c
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2024-09-20 08:05:30 +0000
committerIngo Klöcker <[email protected]>2024-09-20 08:05:30 +0000
commit79ca846993638de359936f86eafaa23f75c9f85d (patch)
treeeaa547c855bdb27c84a5df0540f02cc08eb24b70 /src/engine-gpg.c
parentdoc,build: Look for yat2m in $prefix/bin (diff)
downloadgpgme-79ca846993638de359936f86eafaa23f75c9f85d.tar.gz
gpgme-79ca846993638de359936f86eafaa23f75c9f85d.zip
core: Report failed encryption/signing if gpgtar didn't emit SUCCESS
src/encrypt-sign.c (encrypt_sym_status_handler): Add call of _gpgme_encrypt_status_handler. (encrypt_sign_start): Call _gpgme_op_encrypt_init_result with success_required=1 if archive is created. Always call _gpgme_op_sign_init_result with success_required=0 because the encrypt status handler already checks for SUCCESS. src/encrypt.c (op_data_t): Add success_seen flag. (_gpgme_encrypt_status_handler): Return error if we didn't see a required SUCCESS on GPGME_STATUS_EOF. Set success_seen flag on GPGME_STATUS_SUCCESS. (encrypt_sym_status_handler): Add call of _gpgme_encrypt_status_handler. (_gpgme_op_encrypt_init_result): Add argument success_required. Set success_seen flag if SUCCESS is not required. (encrypt_start): Call _gpgme_op_encrypt_init_result with success_required=1 if archive is created. src/ops.h (_gpgme_op_sign_init_result, _gpgme_op_encrypt_init_result): Add argument success_required to prototypes. src/sign.c (op_data_t): Add success_seen flag. (_gpgme_sign_status_handler): Return error if we didn't see a required SUCCESS on GPGME_STATUS_EOF. Set success_seen flag on GPGME_STATUS_SUCCESS. (sign_init_result): Add argument success_required. Set success_seen flag if SUCCESS is not required. (_gpgme_op_sign_init_result): Add argument success_required and forward it to sign_init_result. (sign_start): Call sign_init_result with success_required=1 if archive is created. -- gpgtar emits a SUCCESS status just before successful termination. If the process terminates unexpectedly (e.g. because it's killed) then gpgme now reports GPG_ERR_EOF. The SUCCESS status is only required if a signed and/or encrypted archive is created which is only supported for OpenPGP. The other engines reject the GPGME_ENCRYPT_ARCHIVE flag so that we don't need to check the protocol in the generic code. This change also adds handling of invalid recipients in case symmetric encryption is used which makes sense because one can combine symmetric and public key encryption. GnuPG-bug-id: 6554
Diffstat (limited to 'src/engine-gpg.c')
0 files changed, 0 insertions, 0 deletions