aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/call-agent.c2
-rw-r--r--g10/call-agent.h1
-rw-r--r--g10/card-util.c21
3 files changed, 24 insertions, 0 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c
index 755f2e30b..e9ea82e4f 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -609,6 +609,8 @@ learn_status_cb (void *opaque, const char *line)
parm->extcap.ki = abool;
else if (!strcmp (p, "aac"))
parm->extcap.aac = abool;
+ else if (!strcmp (p, "bt"))
+ parm->extcap.bt = abool;
else if (!strcmp (p, "kdf"))
parm->extcap.kdf = abool;
else if (!strcmp (p, "si"))
diff --git a/g10/call-agent.h b/g10/call-agent.h
index 59e4ff486..1055b5ef9 100644
--- a/g10/call-agent.h
+++ b/g10/call-agent.h
@@ -69,6 +69,7 @@ struct agent_card_info_s
unsigned int ki:1; /* Key import available. */
unsigned int aac:1; /* Algorithm attributes are changeable. */
unsigned int kdf:1; /* KDF object to support PIN hashing available. */
+ unsigned int bt:1; /* Button for confirmation available. */
} extcap;
unsigned int status_indicator;
};
diff --git a/g10/card-util.c b/g10/card-util.c
index 234abcbab..5205798b6 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -2114,10 +2114,31 @@ kdf_setup (const char *args)
static void
uif (int arg_number, const char *arg_rest)
{
+ struct agent_card_info_s info;
+ int feature_available;
gpg_error_t err;
char name[100];
unsigned char data[2];
+ memset (&info, 0, sizeof info);
+
+ err = agent_scd_getattr ("EXTCAP", &info);
+ if (err)
+ {
+ log_error (_("error getting card info: %s\n"), gpg_strerror (err));
+ return;
+ }
+
+ feature_available = info.extcap.bt;
+ agent_release_card_info (&info);
+
+ if (!feature_available)
+ {
+ log_error (_("This command is not supported by this card\n"));
+ tty_printf ("\n");
+ return;
+ }
+
snprintf (name, sizeof name, "UIF-%d", arg_number);
if ( !strcmp (arg_rest, "off") )
data[0] = 0x00;