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:25:22 +0000 (10:25 +0900)
commit76e2aa739c0c75a9de7059daebdf2823582d8b24
tree8c7bbcafbd0de8081f7ce22e545df4622dfeb8cd
parentbe136273454532d94a955fbbcfa1544b47cad954
g10: Improve handling of no corresponding public key.

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

--

(ported from 1.4 commit b3fd30451a5464b124b0296afbc341cb98b3977c)

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