diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-01-23 20:04:04 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-01-23 20:04:52 +0100 |
commit | 5ed7b64a5ea61829a7e0691176ba31600355a247 (patch) | |
tree | 843f23ddeda8f36ab2702b5d5bd18f6eaa78fc52 /lib/pkcs11.c | |
parent | 134815f1c46b9b9a05cadbe2345be9b9d1326e49 (diff) | |
download | gnutls-5ed7b64a5ea61829a7e0691176ba31600355a247.tar.gz |
Added gnutls_pkcs11_reinit().
Diffstat (limited to 'lib/pkcs11.c')
-rw-r--r-- | lib/pkcs11.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/pkcs11.c b/lib/pkcs11.c index 8b1d3c5d78..a98847167f 100644 --- a/lib/pkcs11.c +++ b/lib/pkcs11.c @@ -566,6 +566,34 @@ gnutls_pkcs11_init (unsigned int flags, const char *deprecated_config_file) } /** + * gnutls_pkcs11_reinit: + * + * This function will reinitialize the PKCS 11 subsystem in gnutls. + * This is required by PKCS 11 when an application uses fork(). The + * reinitialization function must be called on the child. + * + * Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise a + * negative error value. + * + * Since: 3.0.0 + **/ +int gnutls_pkcs11_reinit (void) +{ + int rv; + + rv = p11_kit_initialize_registered (); + if (rv != CKR_OK) + { + gnutls_assert (); + _gnutls_debug_log ("Cannot initialize registered module: %s\n", + p11_kit_strerror (rv)); + return GNUTLS_E_INTERNAL_ERROR; + } + + return 0; +} + +/** * gnutls_pkcs11_deinit: * * This function will deinitialize the PKCS 11 subsystem in gnutls. |