Lines Matching refs:client
73 return &session->client->object_handle_db; in get_object_handle_db()
78 return &session->client->session_list; in get_session_list()
83 struct pkcs11_client *client = NULL; in tee_session2client() local
85 TAILQ_FOREACH(client, &pkcs11_client_list, link) in tee_session2client()
86 if (client == tee_session) in tee_session2client()
89 return client; in tee_session2client()
93 struct pkcs11_client *client) in pkcs11_handle2session() argument
95 return handle_lookup(&client->session_handle_db, handle); in pkcs11_handle2session()
100 struct pkcs11_client *client = NULL; in register_client() local
102 client = TEE_Malloc(sizeof(*client), TEE_MALLOC_FILL_ZERO); in register_client()
103 if (!client) in register_client()
106 TAILQ_INSERT_HEAD(&pkcs11_client_list, client, link); in register_client()
107 TAILQ_INIT(&client->session_list); in register_client()
108 handle_db_init(&client->session_handle_db); in register_client()
109 handle_db_init(&client->object_handle_db); in register_client()
111 return client; in register_client()
114 void unregister_client(struct pkcs11_client *client) in unregister_client() argument
119 if (!client) { in unregister_client()
124 TAILQ_FOREACH_SAFE(session, &client->session_list, link, next) in unregister_client()
127 TAILQ_REMOVE(&pkcs11_client_list, client, link); in unregister_client()
128 handle_db_destroy(&client->object_handle_db); in unregister_client()
129 handle_db_destroy(&client->session_handle_db); in unregister_client()
130 TEE_Free(client); in unregister_client()
535 static void set_session_state(struct pkcs11_client *client, in set_session_state() argument
551 TAILQ_FOREACH(sess, &client->session_list, link) { in set_session_state()
586 enum pkcs11_rc entry_ck_open_session(struct pkcs11_client *client, in entry_ck_open_session() argument
603 if (!client || ptypes != exp_pt || in entry_ck_open_session()
638 TAILQ_FOREACH(session, &client->session_list, link) in entry_ck_open_session()
647 session->handle = handle_get(&client->session_handle_db, session); in entry_ck_open_session()
654 session->client = client; in entry_ck_open_session()
658 set_session_state(client, session, readonly); in entry_ck_open_session()
660 TAILQ_INSERT_HEAD(&client->session_list, session, link); in entry_ck_open_session()
684 TAILQ_REMOVE(&session->client->session_list, session, link); in close_ck_session()
685 handle_put(&session->client->session_handle_db, session->handle); in close_ck_session()
696 enum pkcs11_rc entry_ck_close_session(struct pkcs11_client *client, in entry_ck_close_session() argument
708 if (!client || ptypes != exp_pt) in entry_ck_close_session()
713 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_ck_close_session()
725 enum pkcs11_rc entry_ck_close_all_sessions(struct pkcs11_client *client, in entry_ck_close_all_sessions() argument
740 if (!client || ptypes != exp_pt) in entry_ck_close_all_sessions()
758 TAILQ_FOREACH_SAFE(session, &client->session_list, link, next) in entry_ck_close_all_sessions()
765 enum pkcs11_rc entry_ck_session_info(struct pkcs11_client *client, in entry_ck_session_info() argument
781 if (!client || ptypes != exp_pt || out->memref.size != sizeof(info)) in entry_ck_session_info()
786 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_ck_session_info()
812 struct pkcs11_client *client = NULL; in entry_ck_token_initialize() local
857 TAILQ_FOREACH(client, &pkcs11_client_list, link) in entry_ck_token_initialize()
858 TAILQ_FOREACH(sess, &client->session_list, link) in entry_ck_token_initialize()
1031 enum pkcs11_rc entry_ck_init_pin(struct pkcs11_client *client, in entry_ck_init_pin() argument
1045 if (!client || ptypes != exp_pt) in entry_ck_init_pin()
1050 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_ck_init_pin()
1192 enum pkcs11_rc entry_ck_set_pin(struct pkcs11_client *client, in entry_ck_set_pin() argument
1208 if (!client || ptypes != exp_pt) in entry_ck_set_pin()
1213 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_ck_set_pin()
1268 struct pkcs11_client *client = session->client; in session_login_user() local
1271 TAILQ_FOREACH(sess, &client->session_list, link) { in session_login_user()
1284 struct pkcs11_client *client = session->client; in session_login_so() local
1287 TAILQ_FOREACH(sess, &client->session_list, link) { in session_login_so()
1300 struct pkcs11_client *client = session->client; in session_logout() local
1303 TAILQ_FOREACH(sess, &client->session_list, link) { in session_logout()
1339 enum pkcs11_rc entry_ck_login(struct pkcs11_client *client, in entry_ck_login() argument
1355 if (!client || ptypes != exp_pt) in entry_ck_login()
1360 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_ck_login()
1387 TAILQ_FOREACH(sess, &client->session_list, link) in entry_ck_login()
1450 enum pkcs11_rc entry_ck_logout(struct pkcs11_client *client, in entry_ck_logout() argument
1462 if (!client || ptypes != exp_pt) in entry_ck_logout()
1467 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_ck_logout()
1516 enum pkcs11_rc entry_ck_seed_random(struct pkcs11_client *client, in entry_ck_seed_random() argument
1530 if (!client || ptypes != exp_pt) in entry_ck_seed_random()
1535 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_ck_seed_random()
1557 enum pkcs11_rc entry_ck_generate_random(struct pkcs11_client *client, in entry_ck_generate_random() argument
1574 if (!client || ptypes != exp_pt) in entry_ck_generate_random()
1579 rc = serialargs_get_session_from_handle(&ctrlargs, client, &session); in entry_ck_generate_random()