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:
parent
2ccbcfec12
commit
5b7b42e2b2
3 changed files with 17 additions and 8 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue