GPGME_No_Matching_Secret_Key error code missing

Marcus Brinkmann Marcus.Brinkmann@ruhr-uni-bochum.de
Fri Feb 14 13:38:01 2003


On Thu, Feb 13, 2003 at 08:06:07PM +0100, Ingo Klöcker wrote:
> I guess I should have told you that this is about OpenPGP and not about 
> S/MIME. I don't think gpgsm is involved.

Yes, definitely, because it makes all the difference.  
 
> > To fix the bogus No_Passphrase you saw, we need to find out what
> > sequence of events triggered that.  I can not conclude that from just
> > looking at GPGME, I need the gpgsm server log for that (or a way to
> > reproduce it).
> 
> To reproduce the problem install KMail 1.5 (from KDE 3.1), add 
> "use-agent" to your ~/.gnupg/options (resp. gpg.conf ?), start KMail 
> without starting gpg-agent, select a message which is PGP/MIME 
> encrypted. KMail will tell you that gpgme_op_decrypt_verify() returned 
> error code 19 (== GPGME_No_Passphrase).

Requiring kmail to reproduce a bug is a bit heavy, but luckily I now know
what's going on.  The GPG cryptplug doesn't support GnuPG without gpg-agent,
and the current GnuPG doesn't yet support gpg-agent as transparently as
gpgsm.

The legacy way to get the passphrase is to use the gpgme passphrase
callback (in that case, it is the user's responsibility to provide the
passphrase to gpg through gpgme).  As cryptplug doesn't install a passphrase
callback, it doesn't support this legacy method, and the error description
is accurate: No passphrase.

gpgsm on the other hand doesn't support the legacy method, and this is why
it bails out to other error messages.  It should probably report agent errors
in a better way, and then we also need to map this error in gpgme.

Except this last point, which first requires changes in gpgsm, there is
nothing gpgme can do about this.  In fact it is working accurate and as
expected.  The changes have to be done in GnuPG (and gnupg 1.9/2.0 will
behave like gpgsm in this regard), or, if you need a workaround, cryptplug
(to support the legacy method of passphrase retrieval).

I will do the error reporting as discusses in the last mail soon.

Thanks,
Marcus


-- 
`Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    marcus@gnu.org
Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de/