EldoS | Feel safer!

Software components for data protection, secure storage and transfer

PKCS#11 TElPkcs11CertStorage freeing problems (freezing app)

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#23344
Posted: 02/04/2013 07:23:05
by Jan Białokozowicz (Standard support level)
Joined: 08/20/2012
Posts: 8

Quote
Eugene Mayevski wrote:
Hmm, what made you think that you need to free session objects?


I think i tried to use standard "try finally" to "use and clean" objects. And since OpenSession gives me reference to session i thought i can close and free it.
And i tought you handle this somehow in your code.

Quote
Eugene Mayevski wrote:
Sessions are managed by the storage, you should not create or destroy session objects.


But can i use TElPKCS11CertStorage.CloseSession() and TElPKCS11SessionInfo.Close() ?. Are those safe to use?
#23345
Posted: 02/04/2013 07:28:39
by Eugene Mayevski (EldoS Corp.)

Quote
Jan Białokozowicz wrote:
And i tought you handle this somehow in your code.


There's no easy way (short of hooking a memory manager which would be a complete overkill) to know about this.

Quote
Jan Białokozowicz wrote:


But can i use TElPKCS11CertStorage.CloseSession() and TElPKCS11SessionInfo.Close() ?. Are those safe to use?


Use CloseSession method as a complement to OpenSession.


Sincerely yours
Eugene Mayevski
#23346
Posted: 02/04/2013 07:37:57
by Jan Białokozowicz (Standard support level)
Joined: 08/20/2012
Posts: 8

Ok, it cleared some things for me now :).

Thank you again for quick response :)

TL;DR for this cause is:

Don't free TElPKCS11SessionInfo objects implictly.

Reply

Statistics

Topic viewed 2296 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!