aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app-piv.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2020-04-02 09:54:01 +0000
committerWerner Koch <[email protected]>2020-04-02 09:54:01 +0000
commit5b7b42e2b2b7ba7b88f89ff4b4ee7baf0eef2a04 (patch)
tree627c06b4e84307688672d53ce8c0a3dd4263e414 /scd/app-piv.c
parentscd: New command DEVINFO. (diff)
downloadgnupg-5b7b42e2b2b7ba7b88f89ff4b4ee7baf0eef2a04.tar.gz
gnupg-5b7b42e2b2b7ba7b88f89ff4b4ee7baf0eef2a04.zip
scd: Use Gcrypt usage constants for the do_with_keygrip capabilities.
* scd/command.c (cmd_keyinfo): Use Gcrypt constants for CAP. * scd/app-openpgp.c (do_with_keygrip): Adjust for them. * scd/app-piv.c (do_with_keygrip): Ditto. -- That makes it easier to read. An open question is whether we should allow several capabilities and whether they are the ORed or ANDed. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'scd/app-piv.c')
-rw-r--r--scd/app-piv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/scd/app-piv.c b/scd/app-piv.c
index cd53c175f..8a3ba1e1b 100644
--- a/scd/app-piv.c
+++ b/scd/app-piv.c
@@ -3513,17 +3513,17 @@ do_with_keygrip (app_t app, ctrl_t ctrl, int action,
}
else if (!want_keygripstr || !strcmp (keygripstr, want_keygripstr))
{
- if (capability == 1)
+ if (capability == GCRY_PK_USAGE_SIGN)
{
if (strcmp (data_objects[i].keyref, "9C"))
continue;
}
- if (capability == 2)
+ if (capability == GCRY_PK_USAGE_ENCR)
{
if (strcmp (data_objects[i].keyref, "9D"))
continue;
}
- if (capability == 3)
+ if (capability == GCRY_PK_USAGE_AUTH)
{
if (strcmp (data_objects[i].keyref, "9A"))
continue;