scd: Fix PK_AUTH with --challenge-response option.

* scd/app.c (app_auth): It's only APPTYPE_OPENPGP which supports
the challenge response interaction.
* scd/command.c (cmd_pkauth): It only wants if it works or not.

--

GnuPG-bug-id: 5862
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2022-03-04 10:11:38 +09:00
parent 44621120a2
commit 58e6990eaa
2 changed files with 6 additions and 3 deletions

View File

@ -2062,6 +2062,10 @@ app_auth (card_t card, ctrl_t ctrl, const char *keyidstr,
err = gpg_error (GPG_ERR_UNSUPPORTED_OPERATION);
else
{
if (card->app->apptype != APPTYPE_OPENPGP
&& (!indata || !indatalen))
return gpg_error (GPG_ERR_INV_VALUE);
if (DBG_APP)
log_debug ("slot %d app %s: calling auth(%s)\n",
card->slot, xstrapptype (card->app), keyidstr);

View File

@ -1133,10 +1133,9 @@ cmd_pkauth (assuan_context_t ctx, char *line)
}
else
{
rc = assuan_send_data (ctx, outdata, outdatalen);
if (!challenge_response)
rc = assuan_send_data (ctx, outdata, outdatalen);
xfree (outdata);
if (rc)
return rc; /* that is already an assuan error code */
}
return rc;