g10: Improve handling of no corresponding public key.
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 19 May 2015 01:14:09 +0000 (10:14 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 19 May 2015 01:14:09 +0000 (10:14 +0900)
commitb3fd30451a5464b124b0296afbc341cb98b3977c
treec0b2ad18b0c38550c2e4385784f9ab8cfd60bf1b
parent04667cabef2d6aaa214b288482bb902c891893a5
g10: Improve handling of no corresponding public key.

* g10/getkey.c (get_seckey): Return G10ERR_NO_PUBKEY when it's not
exact match.

--

In the situation of corrupted .gnupg/ where only private subkey is
available but no corresponding public key of the subkey, the code
returned public primary key which caused mysterious error (for a
user).  This fix detects an error earlier.

GnuPG-bug-id: 1422
Debian-Bug-Id: #638619
g10/getkey.c