Skip to content

Commit

Permalink
Fix for final not being called after init in edge case pin failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Dec 20, 2023
1 parent b2d28f0 commit 5754086
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/pkcs11test.c
Original file line number Diff line number Diff line change
Expand Up @@ -7791,8 +7791,10 @@ static CK_RV pkcs11_test(int slotId, int setPin, int onlySet, int closeDl)
ret = pkcs11_lib_init();

/* Do tests after library initialization but without SO PIN. */
if (ret == CKR_OK)
if (ret == CKR_OK) {
inited = 1;
ret = run_tests(testFunc, testFuncCnt, onlySet, TEST_FLAG_INIT);
}

if (ret == CKR_OK)
ret = pkcs11_init_token();
Expand All @@ -7805,7 +7807,6 @@ static CK_RV pkcs11_test(int slotId, int setPin, int onlySet, int closeDl)

/* Set user PIN. */
if (ret == CKR_OK) {
inited = 1;
if (setPin)
ret = pkcs11_set_user_pin(slotId);
}
Expand Down

0 comments on commit 5754086

Please sign in to comment.