Fixed a bug in the mechanism listing and made it more general

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1474 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
sth 2003-09-29 13:45:07 +00:00
parent d208a04872
commit 1055045267
1 changed files with 7 additions and 3 deletions

View File

@ -607,13 +607,17 @@ list_mechs(CK_SLOT_ID slot)
printf(", sign");
if (info.flags & CKF_VERIFY)
printf(", verify");
if (info.flags & CKF_WRAP)
printf(", wrap");
if (info.flags & CKF_UNWRAP)
printf(", unwrap");
if (info.flags & CKF_UNWRAP)
printf(", unwrap");
if (info.flags & CKF_ENCRYPT)
printf(", encrypt");
if (info.flags & CKF_DECRYPT)
printf(", decrypt");
if (info.flags & CKF_GENERATE_KEY_PAIR)
printf(", keypairgen");
info.flags &= ~(CKF_DIGEST|CKF_SIGN|CKF_VERIFY|CKF_HW|CKF_UNWRAP|CKF_GENERATE_KEY_PAIR);
info.flags &= ~(CKF_DIGEST|CKF_SIGN|CKF_VERIFY|CKF_HW|CKF_UNWRAP|CKF_ENCRYPT|CKF_DECRYPT|CKF_GENERATE_KEY_PAIR);
if (info.flags)
printf(", other flags=0x%x", (unsigned int) info.flags);
}