1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

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 <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-04-02 11:54:01 +02:00
parent 2ccbcfec12
commit 5b7b42e2b2
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 17 additions and 8 deletions

View file

@ -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;