aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2022-03-04 01:11:38 +0000
committerNIIBE Yutaka <[email protected]>2022-03-04 01:11:38 +0000
commit58e6990eaabb7302cc8cc979378e6fffe36459b7 (patch)
tree08585b93bfdd753c9e0ce681d5cc61acc158edd9 /scd/app.c
parentscd: Add --challenge-response option to PK_AUTH for OpenPGP card. (diff)
downloadgnupg-58e6990eaabb7302cc8cc979378e6fffe36459b7.tar.gz
gnupg-58e6990eaabb7302cc8cc979378e6fffe36459b7.zip
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 <[email protected]>
Diffstat (limited to 'scd/app.c')
-rw-r--r--scd/app.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/scd/app.c b/scd/app.c
index 2de4f129c..3961bdf6c 100644
--- a/scd/app.c
+++ b/scd/app.c
@@ -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);