Skip to content

Commit 28f4de6

Browse files
committed
Fix stm32h5 test-app pkcs11 command
InitToken needs to be run before OpenSession.
1 parent 7258081 commit 28f4de6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test-app/app_stm32h5.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -628,18 +628,18 @@ static int cmd_login_pkcs11(const char *args)
628628

629629
if (ret == 0) {
630630
printf("Done.\r\n");
631-
printf("Retrieving crypto engine function list...");
631+
printf("Initializing token...");
632632
fflush(stdout);
633-
ret = wolfpkcs11nsFunctionList.C_OpenSession(1,
634-
CKF_SERIAL_SESSION | CKF_RW_SESSION,
635-
NULL, NULL, &session);
633+
ret = wolfpkcs11nsFunctionList.C_InitToken(1,
634+
(byte *)TokenPin, strlen(TokenPin), (byte *)SoPinName);
636635
}
637636
if (ret == 0) {
638637
printf("Done.\r\n");
639-
printf("Initializing token...");
638+
printf("Opening session...");
640639
fflush(stdout);
641-
ret = wolfpkcs11nsFunctionList.C_InitToken(1,
642-
(byte *)TokenPin, strlen(TokenPin), (byte *)SoPinName);
640+
ret = wolfpkcs11nsFunctionList.C_OpenSession(1,
641+
CKF_SERIAL_SESSION | CKF_RW_SESSION,
642+
NULL, NULL, &session);
643643
}
644644

645645
if (ret == 0) {

0 commit comments

Comments
 (0)