** API and ABI modifications:
GNUTLS_CERT_SIGNATURE_FAILURE: Added
GNUTLS_CAMELLIA_192_CBC: Added
+gnutls_pkcs11_advset_pin_function: Added
+gnutls_pkcs11_advset_token_function: Added
gnutls_privkey_import_tpm_raw: Added
gnutls_privkey_import_pkcs11_url: Added
gnutls_privkey_import_openpgp_raw: Added
that provides a middleware to control access to resources over the
multiple users.
+To avoid conflicts with multiple registered callbacks for PIN and token functions,
+the following two functions set the callbacks if they have not already been set.
+@showfuncB{gnutls_pkcs11_advset_pin_function,gnutls_pkcs11_advset_token_function}
+
Moreover PKCS #11 modules must be reinitialized on the child processes
after a @funcintref{fork}. @acronym{GnuTLS} provides @funcref{gnutls_pkcs11_reinit}
to be called for this purpose.
void gnutls_pkcs11_set_pin_function (gnutls_pkcs11_pin_callback_t fn,
void *userdata);
+
+void gnutls_pkcs11_advset_token_function (gnutls_pkcs11_token_callback_t fn,
+ void *userdata);
+
+void gnutls_pkcs11_advset_pin_function (gnutls_pkcs11_pin_callback_t fn,
+ void *userdata);
+
int gnutls_pkcs11_add_provider (const char *name, const char *params);
int gnutls_pkcs11_obj_init (gnutls_pkcs11_obj_t * obj);
p11_kit_finalize_module (providers[i].module);
}
active_providers = 0;
-
+
if (initialized_registered != 0)
p11_kit_finalize_registered ();
initialized_registered = 0;
+
+ gnutls_pkcs11_set_pin_function (NULL, NULL);
+ gnutls_pkcs11_set_token_function (NULL, NULL);
}
/**
_gnutls_pin_data = userdata;
}
+/**
+ * gnutls_pkcs11_advset_pin_function:
+ * @fn: The PIN callback, a gnutls_pkcs11_pin_callback_t() function.
+ * @userdata: data to be supplied to callback
+ *
+ * This function will set a callback function to be used when a PIN is
+ * required for PKCS 11 operations. See
+ * gnutls_pkcs11_pin_callback_t() on how the callback should behave.
+ *
+ * This function unlike gnutls_pkcs11_set_pin_function() will only
+ * set the provided function if it has not previously been set.
+ *
+ * Since: 3.1.0
+ **/
+void
+gnutls_pkcs11_advset_pin_function (gnutls_pkcs11_pin_callback_t fn,
+ void *userdata)
+{
+ if (_gnutls_pin_func == NULL)
+ {
+ _gnutls_pin_func = fn;
+ _gnutls_pin_data = userdata;
+ }
+}
+
/**
* gnutls_pkcs11_set_token_function:
* @fn: The token callback
_gnutls_token_data = userdata;
}
+/**
+ * gnutls_pkcs11_advset_token_function:
+ * @fn: The token callback
+ * @userdata: data to be supplied to callback
+ *
+ * This function will set a callback function to be used when a token
+ * needs to be inserted to continue PKCS 11 operations.
+ *
+ * This function unlike gnutls_pkcs11_set_token_function() will only
+ * set the provided function if it has not previously been set.
+ *
+ * Since: 3.1.0
+ **/
+void
+gnutls_pkcs11_advset_token_function (gnutls_pkcs11_token_callback_t fn,
+ void *userdata)
+{
+ if (_gnutls_token_func==NULL)
+ {
+ _gnutls_token_func = fn;
+ _gnutls_token_data = userdata;
+ }
+}
+
int
pkcs11_url_to_info (const char *url, struct p11_kit_uri **info)
{