PKCS#11 software HSM

11/11/2011 3:20:25 PM
Gravatar
Total Posts 13

Re: PKCS#11 software HSM

The same error in Virtual Cryptoki Explorer and in sample program.

 

On the second PC the same problem also.

 

Regards,

Robert

11/11/2011 3:22:45 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: PKCS#11 software HSM

Really very strange.
On my Win7 64bit and on my XP 32bit it works without any problem.

We are trying to go in depth in the code.

What OSs are you using?

11/11/2011 3:25:52 PM
Gravatar
Total Posts 13

Re: PKCS#11 software HSM

windows 7 sp1 64 bit.

11/11/2011 3:39:31 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: PKCS#11 software HSM

Can you try with this new version?

I added some lines of log and made some little changes.

vcki.zip

Let me know...

11/11/2011 3:55:12 PM
Gravatar
Total Posts 13

Re: PKCS#11 software HSM

[Fri Nov 11 15:53:44 2011],1,0, ************* START LIBRARY ****************,Message
[Fri Nov 11 15:53:44 2011],1,0,-> DLL_PROCESS_ATTACH,Message
[Fri Nov 11 15:53:44 2011],1,0,LX: virtuallx,Message
[Fri Nov 11 15:53:44 2011],1,0,-> C_GetFunctionList(000000001D1CD5F8),Message
[Fri Nov 11 15:53:44 2011],1,0,<- C_GetFunctionList(000000001D1CD5F8),Message
[Fri Nov 11 15:53:44 2011],1,0,-> C_Initialize(0000000000000000),Message
[Fri Nov 11 15:53:44 2011],1,0, * No init args ptr: no multithreading requested, but enabling anyway,Message
[Fri Nov 11 15:53:44 2011],1,0,<- C_Initialize,Message
[Fri Nov 11 15:53:44 2011],1,0,-> C_GetInfo(000000001D1CD700),Message
[Fri Nov 11 15:53:44 2011],1,0,<- C_GetInfo(000000001D1CD700),Message
[Fri Nov 11 15:53:44 2011],1,0,-> C_GetSlotList(0,0000000000000000 000000001D1CD5C8),Message
[Fri Nov 11 15:53:44 2011],1,0,<- C_GetSlotList,Message
[Fri Nov 11 15:53:44 2011],1,0,-> C_GetSlotList(0,000000001B137C80 000000001D1CD5C8),Message
[Fri Nov 11 15:53:44 2011],1,0,<- C_GetSlotList,Message
[Fri Nov 11 15:53:44 2011],1,0,-> C_GetSlotInfo(3565006925,000000001D1CD660),Message
[Fri Nov 11 15:53:44 2011],1,0,Slot Name is: -729960371 - Virtual Smart Card Reader,Message
[Fri Nov 11 15:53:44 2011],1,0,inserted b ,Message
[Fri Nov 11 15:53:44 2011],1,0,<- C_GetSlotInfo,Message
[Fri Nov 11 15:53:44 2011],1,0,-> C_GetSlotInfo(3565006925,000000001D1CD650),Message
[Fri Nov 11 15:53:44 2011],1,0,Slot Name is: -729960371 - Virtual Smart Card Reader,Message
[Fri Nov 11 15:53:44 2011],1,0,inserted b ,Message
[Fri Nov 11 15:53:44 2011],1,0,<- C_GetSlotInfo,Message
[Fri Nov 11 15:53:44 2011],1,0,-> C_GetSlotInfo(3565006925,000000001D1CD600),Message
[Fri Nov 11 15:53:44 2011],1,0,Slot Name is: -729960371 - Virtual Smart Card Reader,Message
[Fri Nov 11 15:53:44 2011],1,0,inserted b ,Message
[Fri Nov 11 15:53:44 2011],1,0,<- C_GetSlotInfo,Message
[Fri Nov 11 15:53:44 2011],1,0,-> C_GetTokenInfo(3565006925,000000001D1CD610),Message
[Fri Nov 11 15:53:44 2011],1,0,Call LX_isInserted 3565006925,Message
[Fri Nov 11 15:53:44 2011],1,0,LX_isInserted OK,Message
[Fri Nov 11 15:53:44 2011],1,0,Call LX_getTokenInfo,Message
[Fri Nov 11 15:53:44 2011],1,0,LX_getTokenInfo OK,Message
[Fri Nov 11 15:53:44 2011],1,0,<- C_GetTokenInfo,Message
[Fri Nov 11 15:53:44 2011],1,0,-> C_OpenSession(3565006925,6,0000000000000000,0000000000000000,000000001D1CD648),Message
[Fri Nov 11 15:53:44 2011],1,0,Slot ID 3565006925,-729960371,d47db04d),Message
[Fri Nov 11 15:53:44 2011],1,0,CKF_RW_SESSION,Message
[Fri Nov 11 15:53:44 2011],1,0,g_slotTable.size() 1, -729960371,Message
[Fri Nov 11 15:53:44 2011],1,0,Create new Session with slot:-729960371-Virtual Smart Card Reader,Message
[Fri Nov 11 15:53:44 2011],1,0,CSession(), slotid: -729960371, slotname: Virtual Smart Card Reader,Message
[Fri Nov 11 15:53:44 2011],1,0,-> getSessionData, slotID: -729960371,Message
[Fri Nov 11 15:53:44 2011],1,0,s_sessionDataTbl does not contains slot -729960371,Message
[Fri Nov 11 15:53:44 2011],1,0,->e<- Unexpected exception,Message
[Fri Nov 11 15:53:54 2011],1,0,-> C_Finalize(0000000000000000),Message
[Fri Nov 11 15:53:54 2011],1,0,Finalize OK,Message
[Fri Nov 11 15:53:54 2011],1,0,DeleteCriticalSection OK,Message
[Fri Nov 11 15:53:54 2011],1,0,LX_close OK,Message
[Fri Nov 11 15:53:54 2011],1,0,<- C_Finalize,Message
[Fri Nov 11 15:53:54 2011],1,0, ************* STOP LIBRARY ****************,Message
 

 

[Fri Nov 11 15:53:44 2011],1,0,--> DLL_PROCESS_ATTACH,dllmain
[Fri Nov 11 15:53:44 2011],1,0,<-- DLL_PROCESS_ATTACH,dllmain
[Fri Nov 11 15:53:44 2011],1,0,,--> GetSlotList
[Fri Nov 11 15:53:44 2011],1,0,--> IsCardInserted,IsCardInserted
[Fri Nov 11 15:53:44 2011],1,0,CARD_INSERTED,IsCardInserted
[Fri Nov 11 15:53:44 2011],1,0,,--> GetSlotList
[Fri Nov 11 15:53:44 2011],1,0,,--> GetSlotList
[Fri Nov 11 15:53:44 2011],1,0,--> IsCardInserted,IsCardInserted
[Fri Nov 11 15:53:44 2011],1,0,CARD_INSERTED,IsCardInserted
[Fri Nov 11 15:53:44 2011],1,0,--> IsCardInserted,IsCardInserted
[Fri Nov 11 15:53:44 2011],1,0,CARD_INSERTED,IsCardInserted
[Fri Nov 11 15:53:44 2011],1,0,--> IsCardInserted,IsCardInserted
[Fri Nov 11 15:53:44 2011],1,0,CARD_INSERTED,IsCardInserted
[Fri Nov 11 15:53:44 2011],1,0,--> IsCardInserted,IsCardInserted
[Fri Nov 11 15:53:44 2011],1,0,CARD_INSERTED,IsCardInserted
[Fri Nov 11 15:53:44 2011],1,0,--> GetTokenInfo,GetTokenInfo
[Fri Nov 11 15:53:44 2011],1,0,<-- GetICC_ID,GetICC_ID
[Fri Nov 11 15:53:54 2011],1,0,--> DLL_PROCESS_DETACH,dllmain
[Fri Nov 11 15:53:54 2011],1,0,<-- DLL_PROCESS_DETACH,dllmain
 

11/11/2011 4:45:58 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: PKCS#11 software HSM

it raises an exception that would not generate.

I don't understand why on our PCs it doesn't happen.

Try again with this new version and let me know.

vcki2.zip

11/11/2011 4:51:14 PM
Gravatar
Total Posts 13

Re: PKCS#11 software HSM

now Different error :

exception : 183
exception : SESSION_READ_ONLY_EXISTS

 

[Fri Nov 11 16:49:09 2011],1,0, ************* START LIBRARY ****************,Message
[Fri Nov 11 16:49:09 2011],1,0,-> DLL_PROCESS_ATTACH,Message
[Fri Nov 11 16:49:09 2011],1,0,LX: virtuallx,Message
[Fri Nov 11 16:49:09 2011],1,0,-> C_GetFunctionList(000000001D26D6A8),Message
[Fri Nov 11 16:49:09 2011],1,0,<- C_GetFunctionList(000000001D26D6A8),Message
[Fri Nov 11 16:49:09 2011],1,0,-> C_Initialize(0000000000000000),Message
[Fri Nov 11 16:49:09 2011],1,0, * No init args ptr: no multithreading requested, but enabling anyway,Message
[Fri Nov 11 16:49:09 2011],1,0,<- C_Initialize,Message
[Fri Nov 11 16:49:09 2011],1,0,-> C_GetInfo(000000001D26D7B0),Message
[Fri Nov 11 16:49:09 2011],1,0,<- C_GetInfo(000000001D26D7B0),Message
[Fri Nov 11 16:49:09 2011],1,0,-> C_GetSlotList(0,0000000000000000 000000001D26D678),Message
[Fri Nov 11 16:49:09 2011],1,0,<- C_GetSlotList,Message
[Fri Nov 11 16:49:09 2011],1,0,-> C_GetSlotList(0,000000001BF57C80 000000001D26D678),Message
[Fri Nov 11 16:49:09 2011],1,0,<- C_GetSlotList,Message
[Fri Nov 11 16:49:09 2011],1,0,-> C_GetSlotInfo(3565006925,000000001D26D710),Message
[Fri Nov 11 16:49:09 2011],1,0,Slot Name is: -729960371 - Virtual Smart Card Reader,Message
[Fri Nov 11 16:49:09 2011],1,0,inserted b ,Message
[Fri Nov 11 16:49:09 2011],1,0,<- C_GetSlotInfo,Message
[Fri Nov 11 16:49:09 2011],1,0,-> C_GetSlotInfo(3565006925,000000001D26D700),Message
[Fri Nov 11 16:49:09 2011],1,0,Slot Name is: -729960371 - Virtual Smart Card Reader,Message
[Fri Nov 11 16:49:09 2011],1,0,inserted b ,Message
[Fri Nov 11 16:49:09 2011],1,0,<- C_GetSlotInfo,Message
[Fri Nov 11 16:49:09 2011],1,0,-> C_GetSlotInfo(3565006925,000000001D26D6B0),Message
[Fri Nov 11 16:49:09 2011],1,0,Slot Name is: -729960371 - Virtual Smart Card Reader,Message
[Fri Nov 11 16:49:09 2011],1,0,inserted b ,Message
[Fri Nov 11 16:49:09 2011],1,0,<- C_GetSlotInfo,Message
[Fri Nov 11 16:49:09 2011],1,0,-> C_GetTokenInfo(3565006925,000000001D26D6C0),Message
[Fri Nov 11 16:49:09 2011],1,0,Call LX_isInserted 3565006925,Message
[Fri Nov 11 16:49:09 2011],1,0,LX_isInserted OK,Message
[Fri Nov 11 16:49:09 2011],1,0,Call LX_getTokenInfo,Message
[Fri Nov 11 16:49:09 2011],1,0,LX_getTokenInfo OK,Message
[Fri Nov 11 16:49:09 2011],1,0,<- C_GetTokenInfo,Message
[Fri Nov 11 16:49:09 2011],1,0,-> C_OpenSession(3565006925,6,0000000000000000,0000000000000000,000000001D26D6F8),Message
[Fri Nov 11 16:49:09 2011],1,0,Slot ID 3565006925,-729960371,d47db04d),Message
[Fri Nov 11 16:49:09 2011],1,0,CKF_RW_SESSION,Message
[Fri Nov 11 16:49:09 2011],1,0,g_slotTable.size() 1, -729960371,Message
[Fri Nov 11 16:49:09 2011],1,0,Create new Session with slot:-729960371-Virtual Smart Card Reader,Message
[Fri Nov 11 16:49:09 2011],1,0,CSession(), slotid: -729960371, slotname: Virtual Smart Card Reader,Message
[Fri Nov 11 16:49:09 2011],1,0,-> getSessionData, slotID: -729960371, Virtual Smart Card Reader,Message
[Fri Nov 11 16:49:09 2011],1,0,s_sessionDataTbl does not contains slot -729960371,Message
[Fri Nov 11 16:49:09 2011],1,0,Create new SessionData for slot Virtual Smart Card Reader,Message
[Fri Nov 11 16:49:09 2011],3,0,<- new SessionData raises an unexpected exception,Error
[Fri Nov 11 16:49:09 2011],1,0,->e<- Create Session error B7,Message
 

[Fri Nov 11 16:49:09 2011],1,0,--> DLL_PROCESS_ATTACH,dllmain
[Fri Nov 11 16:49:09 2011],1,0,<-- DLL_PROCESS_ATTACH,dllmain
[Fri Nov 11 16:49:09 2011],1,0,,--> GetSlotList
[Fri Nov 11 16:49:09 2011],1,0,--> IsCardInserted,IsCardInserted
[Fri Nov 11 16:49:09 2011],1,0,CARD_INSERTED,IsCardInserted
[Fri Nov 11 16:49:09 2011],1,0,,--> GetSlotList
[Fri Nov 11 16:49:09 2011],1,0,,--> GetSlotList
[Fri Nov 11 16:49:09 2011],1,0,--> IsCardInserted,IsCardInserted
[Fri Nov 11 16:49:09 2011],1,0,CARD_INSERTED,IsCardInserted
[Fri Nov 11 16:49:09 2011],1,0,--> IsCardInserted,IsCardInserted
[Fri Nov 11 16:49:09 2011],1,0,CARD_INSERTED,IsCardInserted
[Fri Nov 11 16:49:09 2011],1,0,--> IsCardInserted,IsCardInserted
[Fri Nov 11 16:49:09 2011],1,0,CARD_INSERTED,IsCardInserted
[Fri Nov 11 16:49:09 2011],1,0,--> IsCardInserted,IsCardInserted
[Fri Nov 11 16:49:09 2011],1,0,CARD_INSERTED,IsCardInserted
[Fri Nov 11 16:49:09 2011],1,0,--> GetTokenInfo,GetTokenInfo
[Fri Nov 11 16:49:09 2011],1,0,<-- GetICC_ID,GetICC_ID
 

Regards,

Robert

11/11/2011 5:09:44 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: PKCS#11 software HSM

Maybe I understand.

I'm sorry to ask you again, but we cannot reproduce the bug because on our PCs it works, and the only way to find and fix it is by asking you to try and send the log.

Try with this new version:


vcki3.zip

11/11/2011 5:36:13 PM
Gravatar
Total Posts 13

Re: PKCS#11 software HSM

Sorry, I'm not in the office until Monday. I will try on Monday. Regards, Robert
11/14/2011 8:59:18 AM
Gravatar
Total Posts 13

Re: PKCS#11 software HSM

[Mon Nov 14 08:58:07 2011],1,0, ************* START LIBRARY ****************,Message
[Mon Nov 14 08:58:07 2011],1,0,-> DLL_PROCESS_ATTACH,Message
[Mon Nov 14 08:58:07 2011],1,0,LX: virtuallx,Message
[Mon Nov 14 08:58:07 2011],1,0,-> C_GetFunctionList(000000001D40D538),Message
[Mon Nov 14 08:58:07 2011],1,0,<- C_GetFunctionList(000000001D40D538),Message
[Mon Nov 14 08:58:07 2011],1,0,-> C_Initialize(0000000000000000),Message
[Mon Nov 14 08:58:07 2011],1,0, * No init args ptr: no multithreading requested, but enabling anyway,Message
[Mon Nov 14 08:58:07 2011],1,0,<- C_Initialize,Message
[Mon Nov 14 08:58:07 2011],1,0,-> C_GetInfo(000000001D40D640),Message
[Mon Nov 14 08:58:07 2011],1,0,<- C_GetInfo(000000001D40D640),Message
[Mon Nov 14 08:58:07 2011],1,0,-> C_GetSlotList(0,0000000000000000 000000001D40D508),Message
[Mon Nov 14 08:58:07 2011],1,0,<- C_GetSlotList,Message
[Mon Nov 14 08:58:07 2011],1,0,-> C_GetSlotList(0,000000001B157C80 000000001D40D508),Message
[Mon Nov 14 08:58:07 2011],1,0,<- C_GetSlotList,Message
[Mon Nov 14 08:58:07 2011],1,0,-> C_GetSlotInfo(3565006925,000000001D40D5A0),Message
[Mon Nov 14 08:58:07 2011],1,0,Slot Name is: -729960371 - Virtual Smart Card Reader,Message
[Mon Nov 14 08:58:07 2011],1,0,inserted b ,Message
[Mon Nov 14 08:58:07 2011],1,0,<- C_GetSlotInfo,Message
[Mon Nov 14 08:58:07 2011],1,0,-> C_GetSlotInfo(3565006925,000000001D40D590),Message
[Mon Nov 14 08:58:07 2011],1,0,Slot Name is: -729960371 - Virtual Smart Card Reader,Message
[Mon Nov 14 08:58:07 2011],1,0,inserted b ,Message
[Mon Nov 14 08:58:07 2011],1,0,<- C_GetSlotInfo,Message
[Mon Nov 14 08:58:07 2011],1,0,-> C_GetSlotInfo(3565006925,000000001D40D540),Message
[Mon Nov 14 08:58:07 2011],1,0,Slot Name is: -729960371 - Virtual Smart Card Reader,Message
[Mon Nov 14 08:58:07 2011],1,0,inserted b ,Message
[Mon Nov 14 08:58:07 2011],1,0,<- C_GetSlotInfo,Message
[Mon Nov 14 08:58:07 2011],1,0,-> C_GetTokenInfo(3565006925,000000001D40D550),Message
[Mon Nov 14 08:58:07 2011],1,0,Call LX_isInserted 3565006925,Message
[Mon Nov 14 08:58:07 2011],1,0,LX_isInserted OK,Message
[Mon Nov 14 08:58:07 2011],1,0,Call LX_getTokenInfo,Message
[Mon Nov 14 08:58:07 2011],1,0,LX_getTokenInfo OK,Message
[Mon Nov 14 08:58:07 2011],1,0,<- C_GetTokenInfo,Message
[Mon Nov 14 08:58:07 2011],1,0,-> C_OpenSession(3565006925,6,0000000000000000,0000000000000000,000000001D40D588),Message
[Mon Nov 14 08:58:07 2011],1,0,Slot ID 3565006925,-729960371,d47db04d),Message
[Mon Nov 14 08:58:07 2011],1,0,CKF_RW_SESSION,Message
[Mon Nov 14 08:58:07 2011],1,0,g_slotTable.size() 1, -729960371,Message
[Mon Nov 14 08:58:07 2011],1,0,Create new Session with slot:-729960371-Virtual Smart Card Reader,Message
[Mon Nov 14 08:58:07 2011],1,0,CSession(), slotid: -729960371, slotname: Virtual Smart Card Reader,Message
[Mon Nov 14 08:58:07 2011],1,0,-> getSessionData, slotID: -729960371, Virtual Smart Card Reader,Message
[Mon Nov 14 08:58:07 2011],1,0,s_sessionDataTbl does not contains slot -729960371,Message
[Mon Nov 14 08:58:07 2011],1,0,Create new SessionData for slot Virtual Smart Card Reader,Message
[Mon Nov 14 08:58:07 2011],3,0,<- new SessionData raises an unexpected exception,Error
[Mon Nov 14 08:58:07 2011],1,0,->e<- Create Session error 5,Message
[Mon Nov 14 08:58:09 2011],1,0,-> C_Finalize(0000000000000000),Message
[Mon Nov 14 08:58:09 2011],1,0,Finalize OK,Message
[Mon Nov 14 08:58:09 2011],1,0,DeleteCriticalSection OK,Message
[Mon Nov 14 08:58:09 2011],1,0,LX_close OK,Message
[Mon Nov 14 08:58:09 2011],1,0,<- C_Finalize,Message
[Mon Nov 14 08:58:09 2011],1,0, ************* STOP LIBRARY ****************,Message

 

 

[Mon Nov 14 08:58:07 2011],1,0,--> DLL_PROCESS_ATTACH,dllmain
[Mon Nov 14 08:58:07 2011],1,0,<-- DLL_PROCESS_ATTACH,dllmain
[Mon Nov 14 08:58:07 2011],1,0,,--> GetSlotList
[Mon Nov 14 08:58:07 2011],1,0,--> IsCardInserted,IsCardInserted
[Mon Nov 14 08:58:07 2011],1,0,CARD_INSERTED,IsCardInserted
[Mon Nov 14 08:58:07 2011],1,0,,--> GetSlotList
[Mon Nov 14 08:58:07 2011],1,0,,--> GetSlotList
[Mon Nov 14 08:58:07 2011],1,0,--> IsCardInserted,IsCardInserted
[Mon Nov 14 08:58:07 2011],1,0,CARD_INSERTED,IsCardInserted
[Mon Nov 14 08:58:07 2011],1,0,--> IsCardInserted,IsCardInserted
[Mon Nov 14 08:58:07 2011],1,0,CARD_INSERTED,IsCardInserted
[Mon Nov 14 08:58:07 2011],1,0,--> IsCardInserted,IsCardInserted
[Mon Nov 14 08:58:07 2011],1,0,CARD_INSERTED,IsCardInserted
[Mon Nov 14 08:58:07 2011],1,0,--> IsCardInserted,IsCardInserted
[Mon Nov 14 08:58:07 2011],1,0,CARD_INSERTED,IsCardInserted
[Mon Nov 14 08:58:07 2011],1,0,--> GetTokenInfo,GetTokenInfo
[Mon Nov 14 08:58:07 2011],1,0,<-- GetICC_ID,GetICC_ID
[Mon Nov 14 08:58:09 2011],1,0,--> DLL_PROCESS_DETACH,dllmain
[Mon Nov 14 08:58:09 2011],1,0,<-- DLL_PROCESS_DETACH,dllmain

 

Regards,

Robert
 

11/14/2011 10:43:54 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: PKCS#11 software HSM

Hi Robert,

this is the piece of code that raises the exception:

 WriteMessage("Create new SessionData for slot %s", szReader);
pSessionData = new CSessionData(slotID, szReader);
WriteMessage("new CSessionData created for slot %s", szReader); 

it seems as the new operator raises an exception.

Now we added a catch to bad_alloc exception to see if actually is the new operator.

Try this version and let me know:

vcki4.zip