aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app-piv.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-04-03 11:16:22 +0000
committerWerner Koch <[email protected]>2019-04-03 11:16:22 +0000
commit2b1135cf920cf3d863813d60f032d476dcccfb58 (patch)
tree128100370ccfa4fb91ff3fb9fc5a5aa078bb047f /scd/app-piv.c
parentgpg: Avoid endless loop if a card's serial number can't be read. (diff)
downloadgnupg-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-piv.c')
-rw-r--r--scd/app-piv.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/scd/app-piv.c b/scd/app-piv.c
index 41fd7b7c5..addc22c17 100644
--- a/scd/app-piv.c
+++ b/scd/app-piv.c
@@ -812,7 +812,9 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name)
int special;
} table[] = {
{ "SERIALNO", 0x0000, -1 },
- { "$AUTHKEYID", 0x0000, -2 }, /* Default key for ssh. */
+ { "$AUTHKEYID", 0x0000, -2 }, /* Default ssh key. */
+ { "$ENCRKEYID", 0x0000, -6 }, /* Default encryption key. */
+ { "$SIGNKEYID", 0x0000, -7 }, /* Default signing key. */
{ "$DISPSERIALNO",0x0000, -3 },
{ "CHV-STATUS", 0x0000, -4 },
{ "CHV-USAGE", 0x007E, -5 }
@@ -883,6 +885,16 @@ do_getattr (app_t app, ctrl_t ctrl, const char *name)
xfree (relptr);
}
}
+ else if (table[idx].special == -6)
+ {
+ char const tmp[] = "PIV.9D"; /* Key Management. */
+ send_status_info (ctrl, table[idx].name, tmp, strlen (tmp), NULL, 0);
+ }
+ else if (table[idx].special == -7)
+ {
+ char const tmp[] = "PIV.9C"; /* Digital Signature. */
+ send_status_info (ctrl, table[idx].name, tmp, strlen (tmp), NULL, 0);
+ }
else
{
relptr = get_one_do (app, table[idx].tag, &value, &valuelen, &err);