mirror of https://github.com/wolfSSL/wolfBoot.git
Fix stm32h5 test-app pkcs11 command
InitToken needs to be run before OpenSession.pull/681/head
parent
7258081216
commit
28f4de6a9c
|
|
@ -626,14 +626,6 @@ static int cmd_login_pkcs11(const char *args)
|
|||
ret = wc_Pkcs11Token_Init(&token, &PKCS11_d, 1, "EccKey",
|
||||
(const byte*)TokenPin, strlen(TokenPin));
|
||||
|
||||
if (ret == 0) {
|
||||
printf("Done.\r\n");
|
||||
printf("Retrieving crypto engine function list...");
|
||||
fflush(stdout);
|
||||
ret = wolfpkcs11nsFunctionList.C_OpenSession(1,
|
||||
CKF_SERIAL_SESSION | CKF_RW_SESSION,
|
||||
NULL, NULL, &session);
|
||||
}
|
||||
if (ret == 0) {
|
||||
printf("Done.\r\n");
|
||||
printf("Initializing token...");
|
||||
|
|
@ -641,6 +633,14 @@ static int cmd_login_pkcs11(const char *args)
|
|||
ret = wolfpkcs11nsFunctionList.C_InitToken(1,
|
||||
(byte *)TokenPin, strlen(TokenPin), (byte *)SoPinName);
|
||||
}
|
||||
if (ret == 0) {
|
||||
printf("Done.\r\n");
|
||||
printf("Opening session...");
|
||||
fflush(stdout);
|
||||
ret = wolfpkcs11nsFunctionList.C_OpenSession(1,
|
||||
CKF_SERIAL_SESSION | CKF_RW_SESSION,
|
||||
NULL, NULL, &session);
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
printf("Done.\r\n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue