Home GnuPG
Diffusion GnuPG ccbb0cfeefed

sm: Try not to output a partial new message after an error.

Description

sm: Try not to output a partial new message after an error.

* sm/gpgsm.c (main) <aSign,aEncr>:  Uses gpgrt_fcancel on error.

When creating a signature or encrypting and the respective key is not
available or the user canceled the PIN entry gpgsm prints the initial
part of the message due to internal buffering in gpgrt. By using
gpgrt_fcancel we can avoid this at least as long as the data is less
than the standard buffer size (which is currently 8k). If is not a
complete solution but the best we can do easily. Outputting to the
tty is anyway more of a testing aid than for real use.

This makes use of the new gpgrt_fcancel API.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Jun 26 2020, 3:21 PM
Parents
rG208a90197317: sm: Print the serial number of a cert also in decimal.
Branches
Unknown
Tags
Unknown