p11_kit_initialize_registered in a constructor

Stef Walter stef at thewalter.net
Sun Dec 1 07:29:24 PST 2013


On 30.11.2013 16:27, Nikos Mavrogiannopoulos wrote:
> Hello,
>  Would using p11_kit_initialize_registered() in a library constructor
> work? I can think of issues with error reporting, but I cannot think of
> anything that would inherently prevent that, or am I wrong?

If loading other libraries (including those that might in turn link in a
library constructor) from a library constructor is okay, then I would
imagine it's fine.

On the other hand, the behavior of C_Initialize for various PKCS#11
modules is far from well-behaved. Some of them take many tens of seconds
to complete.

I would suggest using the new p11-kit API, and loading the modules, but
not initializing them until use.

Cheers,

Stef



-- 

stef at thewalter.net
http://stef.thewalter.net


More information about the p11-glue mailing list