Lines Matching defs:objp

44 kernel_add_object_to_session(kernel_object_t *objp, kernel_session_t *sp)
51 sp->object_list = objp;
52 objp->next = NULL;
53 objp->prev = NULL;
55 sp->object_list->prev = objp;
56 objp->next = sp->object_list;
57 objp->prev = NULL;
58 sp->object_list = objp;
73 kernel_cleanup_object(kernel_object_t *objp)
78 if (objp->class == CKO_SECRET_KEY) {
79 if (OBJ_SEC(objp) != NULL && OBJ_SEC_VALUE(objp) != NULL) {
80 bzero(OBJ_SEC_VALUE(objp), OBJ_SEC_VALUE_LEN(objp));
81 free(OBJ_SEC_VALUE(objp));
82 OBJ_SEC_VALUE(objp) = NULL;
83 OBJ_SEC_VALUE_LEN(objp) = 0;
85 free(OBJ_SEC(objp));
86 OBJ_SEC(objp) = NULL;
88 kernel_cleanup_object_bigint_attrs(objp);
94 kernel_cleanup_extra_attr(objp);
342 kernel_remove_object_from_session(kernel_object_t *objp, kernel_session_t *sp)
355 if ((sp->object_list == NULL) || (objp == NULL) ||
356 (objp->magic_marker != KERNELTOKEN_OBJECT_MAGIC)) {
362 if (tmp_objp == objp) {
371 if (sp->object_list == objp) {
373 if (objp->next) {
374 sp->object_list = objp->next;
375 objp->next->prev = NULL;
382 if (objp->next) {
384 objp->prev->next = objp->next;
385 objp->next->prev = objp->prev;
388 objp->prev->next = NULL;
395 kernel_delete_object_cleanup(kernel_object_t *objp, boolean_t wrapper_only)
398 (void) pthread_mutex_lock(&objp->object_mutex);
403 if (objp->magic_marker != KERNELTOKEN_OBJECT_MAGIC) {
404 (void) pthread_mutex_unlock(&objp->object_mutex);
421 objp->obj_refcnt = 0;
424 while (objp->obj_refcnt != 0) {
432 objp->obj_delete_sync |= OBJECT_REFCNT_WAITING;
433 (void) pthread_cond_wait(&objp->obj_free_cond,
434 &objp->object_mutex);
437 objp->obj_delete_sync &= ~OBJECT_REFCNT_WAITING;
440 objp->magic_marker = 0;
442 (void) pthread_cond_destroy(&objp->obj_free_cond);
465 kernel_delete_session_object(kernel_session_t *sp, kernel_object_t *objp,
481 rv = kernel_remove_object_from_session(objp, sp);
496 kernel_delete_object_cleanup(objp, wrapper_only);
499 if (objp->is_lib_obj) {
505 kernel_cleanup_object(objp);
513 obj_destroy.od_handle = objp->k_handle;
534 objp->obj_delete_sync &= ~OBJECT_IS_DELETING;
536 (void) pthread_mutex_unlock(&objp->object_mutex);
538 (void) pthread_mutex_destroy(&objp->object_mutex);
540 kernel_object_delay_free(objp);
554 kernel_object_t *objp = sp->object_list;
558 while (objp) {
559 objp1 = objp->next;
569 (void) kernel_delete_session_object(sp, objp, B_TRUE,
572 objp = objp1;
749 kernel_add_token_object_to_slot(kernel_object_t *objp, kernel_slot_t *pslot)
756 pslot->sl_tobj_list = objp;
757 objp->next = NULL;
758 objp->prev = NULL;
760 pslot->sl_tobj_list->prev = objp;
761 objp->next = pslot->sl_tobj_list;
762 objp->prev = NULL;
763 pslot->sl_tobj_list = objp;
777 kernel_object_t *objp)
780 if (pslot->sl_tobj_list == objp) {
782 if (objp->next) {
783 pslot->sl_tobj_list = objp->next;
784 objp->next->prev = NULL;
791 if (objp->next) {
793 objp->prev->next = objp->next;
794 objp->next->prev = objp->prev;
797 objp->prev->next = NULL;
817 kernel_object_t *objp, boolean_t slot_lock_held, boolean_t wrapper_only)
832 kernel_remove_token_object_from_slot(pslot, objp);
839 kernel_delete_object_cleanup(objp, wrapper_only);
843 obj_destroy.od_handle = objp->k_handle;
868 (void) pthread_mutex_unlock(&objp->object_mutex);
870 (void) pthread_mutex_destroy(&objp->object_mutex);
872 kernel_object_delay_free(objp);
886 kernel_object_t *objp;
892 objp = pslot->sl_tobj_list;
893 while (objp) {
894 objp1 = objp->next;
901 if (objp->bool_attr_mask & PRIVATE_BOOL_ON) {
902 (void) kernel_delete_token_object(pslot, cur_sp, objp,
905 objp = objp1;
916 objp = session_p->object_list;
917 while (objp) {
918 objp1 = objp->next;
926 if (objp->bool_attr_mask & PRIVATE_BOOL_ON) {
928 objp, B_FALSE, B_TRUE);
931 objp = objp1;
1056 kernel_object_delay_free(kernel_object_t *objp)
1063 objp->next = NULL;
1065 obj_delay_freed.last = objp;
1066 obj_delay_freed.first = objp;
1068 obj_delay_freed.last->next = objp;
1069 obj_delay_freed.last = objp;