diff options
author | Werner Koch <[email protected]> | 2019-04-03 11:16:22 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-04-03 11:16:22 +0000 |
commit | 2b1135cf920cf3d863813d60f032d476dcccfb58 (patch) | |
tree | 128100370ccfa4fb91ff3fb9fc5a5aa078bb047f /scd/app-openpgp.c | |
parent | gpg: Avoid endless loop if a card's serial number can't be read. (diff) | |
download | gnupg-2b1135cf920cf3d863813d60f032d476dcccfb58.tar.gz gnupg-2b1135cf920cf3d863813d60f032d476dcccfb58.zip |
scd: New standard attributes $ENCRKEYID and $SIGNKEYID.
* g10/call-agent.c (agent_scd_keypairinfo): Use --keypairinfo.
* sm/call-agent.c (gpgsm_agent_scd_keypairinfo): Ditto.
* scd/app-openpgp.c (do_getattr): Add attributes "$ENCRKEYID" and
"$SIGNKEYID".
* scd/app-piv.c (do_getattr): Ditto.
--
We already have $AUTHKEYID to locate the keyref of the key to be used
with ssh. It will also be useful to have default keyref for
encryption and signing. For example, this will allow us to repalce
the use of "OPENPGP.2" by a app type specific keyref.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'scd/app-openpgp.c')
-rw-r--r-- | scd/app-openpgp.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 1e904b578..c5ca063f7 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -987,6 +987,8 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name) { "PRIVATE-DO-3", 0x0103 }, { "PRIVATE-DO-4", 0x0104 }, { "$AUTHKEYID", 0x0000, -3 }, + { "$ENCRKEYID", 0x0000, -6 }, + { "$SIGNKEYID", 0x0000, -7 }, { "$DISPSERIALNO",0x0000, -4 }, { "UIF-1", 0x00D6, 0 }, { "UIF-2", 0x00D7, 0 }, @@ -1071,6 +1073,18 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name) send_key_attr (ctrl, app, table[idx].name, i); return 0; } + if (table[idx].special == -6) + { + char const tmp[] = "OPENPGP.2"; + send_status_info (ctrl, table[idx].name, tmp, strlen (tmp), NULL, 0); + return 0; + } + if (table[idx].special == -7) + { + char const tmp[] = "OPENPGP.1"; + send_status_info (ctrl, table[idx].name, tmp, strlen (tmp), NULL, 0); + return 0; + } relptr = get_one_do (app, table[idx].tag, &value, &valuelen, &rc); if (relptr) |