aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app-openpgp.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2018-10-25 07:20:20 +0000
committerNIIBE Yutaka <[email protected]>2018-10-25 07:20:20 +0000
commit0240345728a84d8f235ce05889e83963e52742eb (patch)
tree6981b0b2439a4a4e691849ed390c9b3f454e91cf /scd/app-openpgp.c
parentall: fix spelling and typos (diff)
downloadgnupg-0240345728a84d8f235ce05889e83963e52742eb.tar.gz
gnupg-0240345728a84d8f235ce05889e83963e52742eb.zip
g10,scd: Improve UIF support.
* g10/call-agent.c (learn_status_cb): Parse "bt" flag. * g10/call-agent.h: New member field "bt". * g10/card-util.c (uif): Limit its access only when it is supported. * scd/app-openpgp.c (do_setattr): Allow access to UIF objects only when there is a button. Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'scd/app-openpgp.c')
-rw-r--r--scd/app-openpgp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 63265e48a..789b72f00 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -2468,9 +2468,9 @@ do_setattr (app_t app, const char *name,
{ "SM-KEY-MAC", 0x00D2, 3, 0, 1 },
{ "KEY-ATTR", 0, 0, 3, 1 },
{ "AESKEY", 0x00D5, 3, 0, 1 },
- { "UIF-1", 0x00D6, 3, 0, 1 },
- { "UIF-2", 0x00D7, 3, 0, 1 },
- { "UIF-3", 0x00D8, 3, 0, 1 },
+ { "UIF-1", 0x00D6, 3, 5, 1 },
+ { "UIF-2", 0x00D7, 3, 5, 1 },
+ { "UIF-3", 0x00D8, 3, 5, 1 },
{ "KDF", 0x00F9, 3, 4, 1 },
{ NULL, 0 }
};
@@ -2483,6 +2483,9 @@ do_setattr (app_t app, const char *name,
if (table[idx].need_v2 && !app->app_local->extcap.is_v2)
return gpg_error (GPG_ERR_NOT_SUPPORTED); /* Not yet supported. */
+ if (table[idx].special == 5 && app->app_local->extcap.has_button == 0)
+ return gpg_error (GPG_ERR_INV_OBJ);
+
if (table[idx].special == 3)
return change_keyattr_from_string (app, pincb, pincb_arg, value, valuelen);