Cancel operation does not return error code

Schultschik, Sven sven.schultschik at
Thu Mar 10 14:30:29 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.





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 14944 bytes
Desc: not available
URL: <>

More information about the Gnupg-users mailing list