Lines Matching refs:ctrl

136 	TEEC_SharedMemory *ctrl = NULL;  in ck_slot_get_info()  local
145 ctrl = ckteec_alloc_shm(sizeof(slot_id), CKTEEC_SHM_INOUT); in ck_slot_get_info()
146 if (!ctrl) { in ck_slot_get_info()
150 memcpy(ctrl->buffer, &slot_id, sizeof(slot_id)); in ck_slot_get_info()
158 rv = ckteec_invoke_ctrl_out(PKCS11_CMD_SLOT_INFO, ctrl, out, &out_size); in ck_slot_get_info()
190 ckteec_free_shm(ctrl); in ck_slot_get_info()
202 TEEC_SharedMemory *ctrl = NULL; in ck_token_get_info() local
211 ctrl = ckteec_alloc_shm(sizeof(slot_id), CKTEEC_SHM_INOUT); in ck_token_get_info()
212 if (!ctrl) { in ck_token_get_info()
216 memcpy(ctrl->buffer, &slot_id, sizeof(slot_id)); in ck_token_get_info()
224 rv = ckteec_invoke_ctrl_out(PKCS11_CMD_TOKEN_INFO, ctrl, in ck_token_get_info()
282 ckteec_free_shm(ctrl); in ck_token_get_info()
296 TEEC_SharedMemory *ctrl = NULL; in ck_token_mechanism_ids() local
313 ctrl = ckteec_alloc_shm(sizeof(slot_id), CKTEEC_SHM_INOUT); in ck_token_mechanism_ids()
314 if (!ctrl) { in ck_token_mechanism_ids()
318 memcpy(ctrl->buffer, &slot_id, sizeof(slot_id)); in ck_token_mechanism_ids()
327 ctrl, out, &out_size); in ck_token_mechanism_ids()
342 ckteec_free_shm(ctrl); in ck_token_mechanism_ids()
355 TEEC_SharedMemory *ctrl = NULL; in ck_token_mechanism_info() local
366 ctrl = ckteec_alloc_shm(sizeof(slot_id) + sizeof(mecha_type), in ck_token_mechanism_info()
368 if (!ctrl) { in ck_token_mechanism_info()
373 buf = ctrl->buffer; in ck_token_mechanism_info()
387 ctrl, out, &out_size); in ck_token_mechanism_info()
402 ckteec_free_shm(ctrl); in ck_token_mechanism_info()
419 TEEC_SharedMemory *ctrl = NULL; in ck_open_session() local
435 ctrl = ckteec_alloc_shm(sizeof(slot_id) + sizeof(u32_flags), in ck_open_session()
437 if (!ctrl) { in ck_open_session()
441 buf = (uint8_t *)ctrl->buffer; in ck_open_session()
454 ctrl, out, &out_size); in ck_open_session()
465 ckteec_free_shm(ctrl); in ck_open_session()
477 TEEC_SharedMemory *ctrl = NULL; in ck_close_session() local
481 ctrl = ckteec_alloc_shm(sizeof(session_handle), CKTEEC_SHM_INOUT); in ck_close_session()
482 if (!ctrl) { in ck_close_session()
486 memcpy(ctrl->buffer, &session_handle, sizeof(session_handle)); in ck_close_session()
488 rv = ckteec_invoke_ctrl(PKCS11_CMD_CLOSE_SESSION, ctrl); in ck_close_session()
491 ckteec_free_shm(ctrl); in ck_close_session()
502 TEEC_SharedMemory *ctrl = NULL; in ck_close_all_sessions() local
506 ctrl = ckteec_alloc_shm(sizeof(slot_id), CKTEEC_SHM_INOUT); in ck_close_all_sessions()
507 if (!ctrl) { in ck_close_all_sessions()
511 memcpy(ctrl->buffer, &slot_id, sizeof(slot_id)); in ck_close_all_sessions()
513 rv = ckteec_invoke_ctrl(PKCS11_CMD_CLOSE_ALL_SESSIONS, ctrl); in ck_close_all_sessions()
516 ckteec_free_shm(ctrl); in ck_close_all_sessions()
528 TEEC_SharedMemory *ctrl = NULL; in ck_get_session_info() local
538 ctrl = ckteec_alloc_shm(sizeof(session_handle), CKTEEC_SHM_INOUT); in ck_get_session_info()
539 if (!ctrl) { in ck_get_session_info()
543 memcpy(ctrl->buffer, &session_handle, sizeof(session_handle)); in ck_get_session_info()
554 ctrl, out, &out_size); in ck_get_session_info()
569 ckteec_free_shm(ctrl); in ck_get_session_info()
582 TEEC_SharedMemory *ctrl = NULL; in ck_init_token() local
598 ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT); in ck_init_token()
599 if (!ctrl) in ck_init_token()
602 buf = ctrl->buffer; in ck_init_token()
615 rv = ckteec_invoke_ctrl(PKCS11_CMD_INIT_TOKEN, ctrl); in ck_init_token()
617 ckteec_free_shm(ctrl); in ck_init_token()
629 TEEC_SharedMemory *ctrl = NULL; in ck_init_pin() local
642 ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT); in ck_init_pin()
643 if (!ctrl) in ck_init_pin()
646 buf = ctrl->buffer; in ck_init_pin()
656 rv = ckteec_invoke_ctrl(PKCS11_CMD_INIT_PIN, ctrl); in ck_init_pin()
658 ckteec_free_shm(ctrl); in ck_init_pin()
671 TEEC_SharedMemory *ctrl = NULL; in ck_set_pin() local
689 ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT); in ck_set_pin()
690 if (!ctrl) in ck_set_pin()
693 buf = ctrl->buffer; in ck_set_pin()
709 rv = ckteec_invoke_ctrl(PKCS11_CMD_SET_PIN, ctrl); in ck_set_pin()
711 ckteec_free_shm(ctrl); in ck_set_pin()
724 TEEC_SharedMemory *ctrl = NULL; in ck_login() local
738 ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT); in ck_login()
739 if (!ctrl) in ck_login()
742 buf = ctrl->buffer; in ck_login()
755 rv = ckteec_invoke_ctrl(PKCS11_CMD_LOGIN, ctrl); in ck_login()
757 ckteec_free_shm(ctrl); in ck_login()
768 TEEC_SharedMemory *ctrl = NULL; in ck_logout() local
772 ctrl = ckteec_alloc_shm(sizeof(session_handle), CKTEEC_SHM_INOUT); in ck_logout()
773 if (!ctrl) in ck_logout()
776 memcpy(ctrl->buffer, &session_handle, sizeof(session_handle)); in ck_logout()
778 rv = ckteec_invoke_ctrl(PKCS11_CMD_LOGOUT, ctrl); in ck_logout()
780 ckteec_free_shm(ctrl); in ck_logout()
790 TEEC_SharedMemory *ctrl = NULL; in ck_seed_random() local
802 ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT); in ck_seed_random()
803 if (!ctrl) in ck_seed_random()
806 memcpy(ctrl->buffer, &session_handle, sizeof(session_handle)); in ck_seed_random()
815 rv = ckteec_invoke_ctrl_in(PKCS11_CMD_SEED_RANDOM, ctrl, in_shm); in ck_seed_random()
819 ckteec_free_shm(ctrl); in ck_seed_random()
829 TEEC_SharedMemory *ctrl = NULL; in ck_generate_random() local
842 ctrl = ckteec_alloc_shm(ctrl_size, CKTEEC_SHM_INOUT); in ck_generate_random()
843 if (!ctrl) in ck_generate_random()
846 memcpy(ctrl->buffer, &session_handle, sizeof(session_handle)); in ck_generate_random()
855 rv = ckteec_invoke_ctrl_out(PKCS11_CMD_GENERATE_RANDOM, ctrl, out_shm, in ck_generate_random()
860 ckteec_free_shm(ctrl); in ck_generate_random()