1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

agent: Fix returning GPG_ERR_NOT_FOUND wrongly.

* agent/learncard.c (agent_handle_learn): Find SERIALNO.

--

Bug is: "gpg-connect-agent learn /bye" just fails wrongly.

Fixes-commit: 8c8ce8711d9c938fcb982b0341e6b052742cb887
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2017-11-02 16:23:10 +09:00
parent fd3f5ca151
commit 5e96fe72e4

View File

@ -340,14 +340,12 @@ agent_handle_learn (ctrl_t ctrl, int send, void *assuan_context, int force)
}
/* Pass on all the collected status information. */
if (assuan_context)
for (sitem = sparm.info; sitem; sitem = sitem->next)
{
for (sitem = sparm.info; sitem; sitem = sitem->next)
{
if (!strcmp (sitem->keyword, "SERIALNO"))
serialno = sitem->data;
assuan_write_status (assuan_context, sitem->keyword, sitem->data);
}
if (!strcmp (sitem->keyword, "SERIALNO"))
serialno = sitem->data;
if (assuan_context)
assuan_write_status (assuan_context, sitem->keyword, sitem->data);
}
if (!serialno)