From 921f76ee4de8242ed95672c560976bb2d9f7b894 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Mon, 8 Dec 2008 20:05:57 +0000 Subject: When loading mechanisms, use the correct one. --- src/slot.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/slot.c b/src/slot.c index 13851c3..44035e8 100644 --- a/src/slot.c +++ b/src/slot.c @@ -345,20 +345,20 @@ test_slot_mechanisms(void) for(j = 0; j < mech_count; ++j) { - rv = (p11t_module_funcs->C_GetMechanismInfo)(slot_id, mech_list[i], &mech_info[i]); + rv = (p11t_module_funcs->C_GetMechanismInfo)(slot_id, mech_list[j], &mech_info[j]); P11T_CHECK_RV("Normal call", rv, CKR_OK); P11T_SECTION("CK_MECHANISM_INFO"); - if(mech_info[i].ulMinKeySize > mech_info[i].ulMaxKeySize) + if(mech_info[j].ulMinKeySize > mech_info[j].ulMaxKeySize) P11T_CHECK_FAIL("Mechanism min key size should not be greater than max"); - P11T_CHECK_MASK("flags", mech_info[i].flags, + P11T_CHECK_MASK("flags", mech_info[j].flags, CKF_HW | CKF_ENCRYPT | CKF_DECRYPT | CKF_DIGEST | CKF_SIGN | CKF_SIGN_RECOVER | CKF_VERIFY | CKF_VERIFY_RECOVER | CKF_GENERATE | CKF_GENERATE_KEY_PAIR | CKF_WRAP | CKF_UNWRAP | CKF_DERIVE); - P11T_CHECK_NFLAG("flags", mech_info[i].flags, CKF_EXTENSION); + P11T_CHECK_NFLAG("flags", mech_info[j].flags, CKF_EXTENSION); } } -- cgit v1.2.3