1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-05-31 22:18:03 +02: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: 8c8ce8711d
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. */ /* 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;
if (!strcmp (sitem->keyword, "SERIALNO")) if (assuan_context)
serialno = sitem->data; assuan_write_status (assuan_context, sitem->keyword, sitem->data);
assuan_write_status (assuan_context, sitem->keyword, sitem->data);
}
} }
if (!serialno) if (!serialno)