Lines Matching defs:handle

163 static KMF_RETURN AddPlugin(KMF_HANDLE_T handle, KMF_PLUGIN *plugin);
212 FindPlugin(KMF_HANDLE_T handle, KMF_KEYSTORE_TYPE kstype)
218 if (handle == NULL)
221 node = handle->plugins;
307 ret = AddPlugin(handle, pluginrec);
373 AddPlugin(KMF_HANDLE_T handle, KMF_PLUGIN *plugin)
377 if (handle == NULL || plugin == NULL)
381 if (handle->plugins == NULL) {
382 handle->plugins = (KMF_PLUGIN_LIST *)malloc(
384 if (handle->plugins == NULL)
386 handle->plugins->plugin = plugin;
387 handle->plugins->next = NULL;
390 n = handle->plugins;
414 Cleanup_KMF_Handle(KMF_HANDLE_T handle)
416 if (handle != NULL) {
417 while (handle->plugins != NULL) {
418 KMF_PLUGIN_LIST *next = handle->plugins->next;
420 DestroyPlugin(handle->plugins->plugin);
421 free(handle->plugins);
422 handle->plugins = next;
424 kmf_free_policy_record(handle->policy);
425 free(handle->policy);
426 free(handle->mapstate);
428 free(handle);
432 Cleanup_PK11_Session(KMF_HANDLE_T handle)
434 if (handle != NULL) {
436 if (handle->pk11handle != NULL) {
437 (void) C_CloseSession(handle->pk11handle);
438 handle->pk11handle = NULL;
447 KMF_HANDLE *handle = NULL;
453 handle = (KMF_HANDLE *)malloc(sizeof (KMF_HANDLE));
454 if (handle == NULL)
457 (void) memset(handle, 0, sizeof (KMF_HANDLE));
458 handle->plugins = NULL;
500 /* Initialize the handle with the policy */
501 ret = kmf_set_policy((void *)handle,
513 handle->mapstate = malloc(sizeof (KMF_MAPPER_STATE));
514 if (handle->mapstate == NULL) {
518 handle->mapstate->lastmappererr = KMF_OK;
519 handle->mapstate->options = NULL;
525 (void) kmf_cert_to_name_mapping_initialize(handle, 0, NULL);
527 CLEAR_ERROR(handle, ret);
530 Cleanup_KMF_Handle(handle);
531 handle = NULL;
534 *outhandle = (KMF_HANDLE_T)handle;
539 kmf_configure_keystore(KMF_HANDLE_T handle,
555 if (handle == NULL)
558 CLEAR_ERROR(handle, ret);
572 plugin = FindPlugin(handle, kstype);
574 return (plugin->funclist->ConfigureKeystore(handle, num_args,
583 kmf_finalize(KMF_HANDLE_T handle)
587 CLEAR_ERROR(handle, ret);
592 Cleanup_PK11_Session(handle);
594 Cleanup_KMF_Handle(handle);
626 kmf_get_plugin_error_str(KMF_HANDLE_T handle, char **msgstr)
631 if (handle == NULL || msgstr == NULL)
636 if (handle->lasterr.errcode == 0) {
640 if (handle->lasterr.kstype == -1) { /* System error */
641 char *str = strerror(handle->lasterr.errcode);
650 plugin = FindPlugin(handle, handle->lasterr.kstype);
655 ret = plugin->funclist->GetErrorString(handle, msgstr);
674 kmf_read_input_file(KMF_HANDLE_T handle, char *filename, KMF_DATA *pdata)
683 if (handle) {
684 CLEAR_ERROR(handle, ret);
694 SET_SYS_ERROR(handle, errno);
699 SET_SYS_ERROR(handle, errno);
722 SET_SYS_ERROR(handle, errno);
1148 kmf_free_kmf_cert(KMF_HANDLE_T handle, KMF_X509_DER_CERT *kmf_cert)
1153 CLEAR_ERROR(handle, ret);
1160 plugin = FindPlugin(handle, kmf_cert->kmf_private.keystore_type);
1163 plugin->funclist->FreeKMFCert(handle, kmf_cert);
1325 kmf_free_kmf_key(KMF_HANDLE_T handle, KMF_KEY_HANDLE *key)
1336 CLEAR_ERROR(handle, ret);
1348 plugin = FindPlugin(handle, key->kstype);
1350 (void) plugin->funclist->DeleteKey(handle, i, attlist);
1505 kmf_create_ocsp_request(KMF_HANDLE_T handle,
1525 if (handle == NULL)
1528 CLEAR_ERROR(handle, ret);
1540 plugin = FindPlugin(handle, KMF_KEYSTORE_OPENSSL);
1551 return (createReqFn(handle, num_args, attrlist));
1556 kmf_get_ocsp_status_for_cert(KMF_HANDLE_T handle,
1583 if (handle == NULL)
1586 CLEAR_ERROR(handle, ret);
1598 plugin = FindPlugin(handle, KMF_KEYSTORE_OPENSSL);
1609 return (getCertStatusFn(handle, num_args, attrlist));
2689 kmf_get_plugin_info(KMF_HANDLE_T handle, char *keystore_name,
2697 * Although handle is not really used in the function, we will
2698 * check the handle to make sure that kmf_initialize() is called
2701 if (handle == NULL || keystore_name == NULL || kstype == NULL)