gpgme_set_passphrase_cb seems to be ignored

Marcus Brinkmann marcus.brinkmann at
Sat Apr 18 14:15:45 CEST 2009

Gary Suggett wrote:
> When I set a passphrase callback, it doesn't seem to be used, and
> pinentry runs instead.

That's the correct behaviour with gpg2.

> The application compiles fine, and the function return_pass is setup
> correctly, but pinentry runs no matter what I change. Is there a way
> to force this callback?

This is half-a-lie, but the short answer is no, there isn't.  The application
is not allowed to insert itself into the trusted path.

Think about it: If your program would work with a smart card terminal, you
also wouldn't get access to the PIN inquiry.

I suspect that your actual question is how to do unattended
decryption/signing.  This has many answers depending on circumstances (using
no passphrase at all, presetting the password in the agent and caching it
there, writing a custom pinentry, disabling pinentry in an custom
configuration, etc).


More information about the Gnupg-devel mailing list