[PATCH] (GnupG 2.0) g10: fix --card-status creating stub.

NIIBE Yutaka gniibe at fsij.org
Tue Aug 11 06:01:43 CEST 2015


Hello,

This is a simple fix against the issue reported to gnupg-users:

    https://lists.gnupg.org/pipermail/gnupg-users/2015-July/053993.html

The fix is that it should search exact match of secret key.

The specific function get_seckeyblock_byfprint is only used by the
particular calls in the card_status function in g10/card-util.c.  So,
I think that there will be no impact other than --card-status itself.

I'll push this.

diff --git a/g10/getkey.c b/g10/getkey.c
index 6c14683..476445f 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -1414,6 +1414,7 @@ get_seckeyblock_byfprint (KBNODE *ret_keyblock, const byte *fprint,
     return G10ERR_GENERAL; /* Oops */

   memset (&ctx, 0, sizeof ctx);
+  ctx.exact = 1 ;
   ctx.not_allocated = 1;
   ctx.kr_handle = keydb_new (1);
   ctx.nitems = 1;

-- 



More information about the Gnupg-devel mailing list