Lines Matching refs:ctrl
118 TEEC_SharedMemory *ctrl = NULL; in ck_slot_get_info() local
127 ctrl = ckteec_alloc_shm(sizeof(slot_id), CKTEEC_SHM_INOUT); in ck_slot_get_info()
128 if (!ctrl) { in ck_slot_get_info()
132 memcpy(ctrl->buffer, &slot_id, sizeof(slot_id)); in ck_slot_get_info()
140 rv = ckteec_invoke_ctrl_out(PKCS11_CMD_SLOT_INFO, ctrl, out, &out_size); in ck_slot_get_info()
172 ckteec_free_shm(ctrl); in ck_slot_get_info()
184 TEEC_SharedMemory *ctrl = NULL; in ck_token_get_info() local
193 ctrl = ckteec_alloc_shm(sizeof(slot_id), CKTEEC_SHM_INOUT); in ck_token_get_info()
194 if (!ctrl) { in ck_token_get_info()
198 memcpy(ctrl->buffer, &slot_id, sizeof(slot_id)); in ck_token_get_info()
206 rv = ckteec_invoke_ctrl_out(PKCS11_CMD_TOKEN_INFO, ctrl, in ck_token_get_info()
260 ckteec_free_shm(ctrl); in ck_token_get_info()
274 TEEC_SharedMemory *ctrl = NULL; in ck_token_mechanism_ids() local
291 ctrl = ckteec_alloc_shm(sizeof(slot_id), CKTEEC_SHM_INOUT); in ck_token_mechanism_ids()
292 if (!ctrl) { in ck_token_mechanism_ids()
296 memcpy(ctrl->buffer, &slot_id, sizeof(slot_id)); in ck_token_mechanism_ids()
305 ctrl, out, &out_size); in ck_token_mechanism_ids()
320 ckteec_free_shm(ctrl); in ck_token_mechanism_ids()
333 TEEC_SharedMemory *ctrl = NULL; in ck_token_mechanism_info() local
344 ctrl = ckteec_alloc_shm(sizeof(slot_id) + sizeof(mecha_type), in ck_token_mechanism_info()
346 if (!ctrl) { in ck_token_mechanism_info()
351 buf = ctrl->buffer; in ck_token_mechanism_info()
365 ctrl, out, &out_size); in ck_token_mechanism_info()
380 ckteec_free_shm(ctrl); in ck_token_mechanism_info()
397 TEEC_SharedMemory *ctrl = NULL; in ck_open_session() local
413 ctrl = ckteec_alloc_shm(sizeof(slot_id) + sizeof(u32_flags), in ck_open_session()
415 if (!ctrl) { in ck_open_session()
419 buf = (uint8_t *)ctrl->buffer; in ck_open_session()
432 ctrl, out, &out_size); in ck_open_session()
443 ckteec_free_shm(ctrl); in ck_open_session()
455 TEEC_SharedMemory *ctrl = NULL; in ck_close_session() local
459 ctrl = ckteec_alloc_shm(sizeof(session_handle), CKTEEC_SHM_INOUT); in ck_close_session()
460 if (!ctrl) { in ck_close_session()
464 memcpy(ctrl->buffer, &session_handle, sizeof(session_handle)); in ck_close_session()
466 rv = ckteec_invoke_ctrl(PKCS11_CMD_CLOSE_SESSION, ctrl); in ck_close_session()
469 ckteec_free_shm(ctrl); in ck_close_session()
480 TEEC_SharedMemory *ctrl = NULL; in ck_close_all_sessions() local
484 ctrl = ckteec_alloc_shm(sizeof(slot_id), CKTEEC_SHM_INOUT); in ck_close_all_sessions()
485 if (!ctrl) { in ck_close_all_sessions()
489 memcpy(ctrl->buffer, &slot_id, sizeof(slot_id)); in ck_close_all_sessions()
491 rv = ckteec_invoke_ctrl(PKCS11_CMD_CLOSE_ALL_SESSIONS, ctrl); in ck_close_all_sessions()
494 ckteec_free_shm(ctrl); in ck_close_all_sessions()
506 TEEC_SharedMemory *ctrl = NULL; in ck_get_session_info() local
516 ctrl = ckteec_alloc_shm(sizeof(session_handle), CKTEEC_SHM_INOUT); in ck_get_session_info()
517 if (!ctrl) { in ck_get_session_info()
521 memcpy(ctrl->buffer, &session_handle, sizeof(session_handle)); in ck_get_session_info()
532 ctrl, out, &out_size); in ck_get_session_info()
547 ckteec_free_shm(ctrl); in ck_get_session_info()
560 TEEC_SharedMemory *ctrl = NULL; in ck_init_token() local
576 ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT); in ck_init_token()
577 if (!ctrl) in ck_init_token()
580 buf = ctrl->buffer; in ck_init_token()
593 rv = ckteec_invoke_ctrl(PKCS11_CMD_INIT_TOKEN, ctrl); in ck_init_token()
595 ckteec_free_shm(ctrl); in ck_init_token()
607 TEEC_SharedMemory *ctrl = NULL; in ck_init_pin() local
620 ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT); in ck_init_pin()
621 if (!ctrl) in ck_init_pin()
624 buf = ctrl->buffer; in ck_init_pin()
634 rv = ckteec_invoke_ctrl(PKCS11_CMD_INIT_PIN, ctrl); in ck_init_pin()
636 ckteec_free_shm(ctrl); in ck_init_pin()
649 TEEC_SharedMemory *ctrl = NULL; in ck_set_pin() local
667 ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT); in ck_set_pin()
668 if (!ctrl) in ck_set_pin()
671 buf = ctrl->buffer; in ck_set_pin()
687 rv = ckteec_invoke_ctrl(PKCS11_CMD_SET_PIN, ctrl); in ck_set_pin()
689 ckteec_free_shm(ctrl); in ck_set_pin()
702 TEEC_SharedMemory *ctrl = NULL; in ck_login() local
716 ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT); in ck_login()
717 if (!ctrl) in ck_login()
720 buf = ctrl->buffer; in ck_login()
733 rv = ckteec_invoke_ctrl(PKCS11_CMD_LOGIN, ctrl); in ck_login()
735 ckteec_free_shm(ctrl); in ck_login()
746 TEEC_SharedMemory *ctrl = NULL; in ck_logout() local
750 ctrl = ckteec_alloc_shm(sizeof(session_handle), CKTEEC_SHM_INOUT); in ck_logout()
751 if (!ctrl) in ck_logout()
754 memcpy(ctrl->buffer, &session_handle, sizeof(session_handle)); in ck_logout()
756 rv = ckteec_invoke_ctrl(PKCS11_CMD_LOGOUT, ctrl); in ck_logout()
758 ckteec_free_shm(ctrl); in ck_logout()
768 TEEC_SharedMemory *ctrl = NULL; in ck_seed_random() local
780 ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT); in ck_seed_random()
781 if (!ctrl) in ck_seed_random()
784 memcpy(ctrl->buffer, &session_handle, sizeof(session_handle)); in ck_seed_random()
793 rv = ckteec_invoke_ctrl_in(PKCS11_CMD_SEED_RANDOM, ctrl, in_shm); in ck_seed_random()
797 ckteec_free_shm(ctrl); in ck_seed_random()
807 TEEC_SharedMemory *ctrl = NULL; in ck_generate_random() local
820 ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT); in ck_generate_random()
821 if (!ctrl) in ck_generate_random()
824 memcpy(ctrl->buffer, &session_handle, sizeof(session_handle)); in ck_generate_random()
833 rv = ckteec_invoke_ctrl_out(PKCS11_CMD_GENERATE_RANDOM, ctrl, out_shm, in ck_generate_random()
838 ckteec_free_shm(ctrl); in ck_generate_random()