aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2020-05-26 14:13:15 +0000
committerWerner Koch <[email protected]>2020-05-26 14:24:12 +0000
commit11f0700282c1eeaee8db6686c38aca0900271351 (patch)
tree3c67e441979772cb40f811e095784b14749df7e1
parentscd: Fix Yubikey app switching problem (diff)
downloadgnupg-11f0700282c1eeaee8db6686c38aca0900271351.tar.gz
gnupg-11f0700282c1eeaee8db6686c38aca0900271351.zip
scd:openpgp: Add attribute "UIF" for convenience.
* scd/app-openpgp.c (do_getattr): New attrubute "UIF". (do_learn_status): Use that. -- Actually this is not just convenience but will make it easier to add new keys to an openpgp card - we will need to change this only at one place. Signed-off-by: Werner Koch <[email protected]>
-rw-r--r--scd/app-openpgp.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 42dcdaad1..6c0c0f6d9 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -1080,6 +1080,7 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name)
{ "UIF-1", 0x00D6, 0 },
{ "UIF-2", 0x00D7, 0 },
{ "UIF-3", 0x00D8, 0 },
+ { "UIF", 0x0000, -9 }, /* Shortcut for all UIF */
{ "KDF", 0x00F9, 5 },
{ "MANUFACTURER", 0x0000, -8 },
{ NULL, 0 }
@@ -1180,6 +1181,15 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name)
app->app_local->manufacturer,
get_manufacturer (app->app_local->manufacturer));
}
+ if (table[idx].special == -9)
+ {
+ rc = do_getattr (app, ctrl, "UIF-1");
+ if (!rc)
+ rc = do_getattr (app, ctrl, "UIF-2");
+ if (!rc)
+ rc = do_getattr (app, ctrl, "UIF-3");
+ return rc;
+ }
relptr = get_one_do (app, table[idx].tag, &value, &valuelen, &rc);
if (relptr)
@@ -2002,11 +2012,7 @@ do_learn_status (app_t app, ctrl_t ctrl, unsigned int flags)
if (app->app_local->extcap.kdf_do)
do_getattr (app, ctrl, "KDF");
if (app->app_local->extcap.has_button)
- {
- do_getattr (app, ctrl, "UIF-1");
- do_getattr (app, ctrl, "UIF-2");
- do_getattr (app, ctrl, "UIF-3");
- }
+ do_getattr (app, ctrl, "UIF");
if (app->app_local->extcap.private_dos)
{
do_getattr (app, ctrl, "PRIVATE-DO-1");