Ensure PKCS #11 applications call C_Finalize() prior to calling dlclose()

A PKCS #11 application initializes the environment by calling dlopen() to load the PKCS #11 DLL into storage, and then calling C_Initialize(). Later, when processing is complete, the application terminates processing by calling C_Finalize(), and then calling dlclose(). Reinitialization, if desired, can be achieved by calling dlopen() and C_Initialize() a second time.

In releases prior to HCR7770, z/OS PKCS #11 allowed an application to implicitly finalize the environment by calling dlclose() without first calling C_Finalize(). Starting in HCR7770, this will no longer be supported. If an application does not call C_Finalize() prior to calling dlclose(), a subsequent attempt to re-initialize PKCS #11 by calling C_Initialize() will result in error CKR_FUNCTION_FAILED being returned.

PKCS #11 application developers should scan their source code for the following sequence of calls: dlopen(), C_Initialize(), processing functions, dlclose(), dlopen(), C_Initialize(). Change all such sequences to insert a call to C_Finalize() before the call to dlclose().