Cancel operation does not return error code

Schultschik, Sven sven.schultschik at
Thu Mar 10 16:10:49 CET 2022


if your using gpgme with interactive password entry on the command line and the user cancels the operation, shouldn't there be an error returned?

Following code

err = gpgme_op_encrypt(ctx, NULL, GPGME_ENCRYPT_SYMMETRIC, in, out);
fprintf(stdout, "DEBUG ERROR Code = \%d \%s \%s\n" , gpgme_err_code(err), gpgme_strsource(err) , gpgme_strerror(err));

If user cancel on the passwort screen, the following error code is returned

ERROR Code = 0 Unspecified source Success

If I look at the docu and search through the net, there is always said that GPG_ERR_CANCELED should be returned.

Why this is important?
The output stream already created the output file and if the users cancel the operation I need an indicator to do a cleanup afterwards.


More information about the Gnupg-users mailing list