[gnutls-devel] Problem with double initialization of pkcs11

Alex elevener at mail.ru
Mon Jun 1 11:27:54 CEST 2015


Hello

I believe that string
  providers_initialized = 1;
should  be  moved  from function _gnutls_pkcs11_check_init to function
gnutls_pkcs11_init.

Right now there is a problem (at least on Windows/MinGW) that if you
call gnutls_pkcs11_init yourself any pcks11 operation that calls
_gnutls_pkcs11_check_init - it calls gnutls_pkcs11_init for the second
time.

So there is situation that if you call gnutls_pkcs11_init and then any
operation  -  you  have  to  call  gnutls_pkcs11_deinit twice for pkcs11
provider  to  be  finalized.  If  you  dont  call gnutls_pkcs11_init - if
you don't do any operation, provider isn't finalized by gnutls_pkcs11_deinit
at all.

Thanks,
  Alex




More information about the Gnutls-devel mailing list