Lines Matching refs:uid
55 static inline sec_tag_t tls_credential_uid_to_tag(psa_storage_uid_t uid) in tls_credential_uid_to_tag() argument
57 return (uid & 0xffffffff); in tls_credential_uid_to_tag()
61 static inline int tls_credential_uid_to_type(psa_storage_uid_t uid) in tls_credential_uid_to_type() argument
63 return ((uid >> 32) & 0xffff); in tls_credential_uid_to_type()
95 static int credentials_toc_update(unsigned int slot, psa_storage_uid_t uid) in credentials_toc_update() argument
103 credentials_toc[slot] = uid; in credentials_toc_update()
113 static unsigned int tls_credential_toc_find_slot(psa_storage_uid_t uid) in tls_credential_toc_find_slot() argument
118 if (credentials_toc[slot] == uid) { in tls_credential_toc_find_slot()
184 static struct tls_credential *credential_get_from_uid(psa_storage_uid_t uid) in credential_get_from_uid() argument
190 if (tls_credential_toc_find_slot(uid) == CRED_MAX_SLOTS) { in credential_get_from_uid()
199 status = psa_ps_get_info(uid, &info); in credential_get_from_uid()
209 status = psa_ps_get(uid, 0, info.size, (void *)credential->buf, in credential_get_from_uid()
217 credential->tag = tls_credential_uid_to_tag(uid); in credential_get_from_uid()
218 credential->type = tls_credential_uid_to_type(uid); in credential_get_from_uid()
235 psa_storage_uid_t uid; in credential_next_get() local
241 uid = tls_credential_get_uid(iter->tag, iter->type); in credential_next_get()
243 slot = tls_credential_toc_find_slot(uid); in credential_next_get()
252 uid = credentials_toc[slot]; in credential_next_get()
253 if (uid == 0) { in credential_next_get()
257 if (tls_credential_uid_to_type(uid) != TLS_CREDENTIAL_NONE && in credential_next_get()
258 tls_credential_uid_to_tag(uid) == tag) { in credential_next_get()
259 return credential_get_from_uid(uid); in credential_next_get()
269 psa_storage_uid_t uid; in credential_next_tag_get() local
275 uid = credentials_toc[slot]; in credential_next_tag_get()
278 if (uid == 0) { in credential_next_tag_get()
281 if (tls_credential_uid_to_type(uid) == TLS_CREDENTIAL_NONE) { in credential_next_tag_get()
285 candidate = tls_credential_uid_to_tag(uid); in credential_next_tag_get()
329 psa_storage_uid_t uid = tls_credential_get_uid(tag, type); in tls_credential_add() local
343 if (tls_credential_toc_find_slot(uid) != CRED_MAX_SLOTS) { in tls_credential_add()
356 status = psa_ps_set(uid, credlen, cred, create_flags); in tls_credential_add()
362 ret = credentials_toc_update(slot, uid); in tls_credential_add()
374 psa_storage_uid_t uid = tls_credential_get_uid(tag, type); in tls_credential_get() local
387 slot = tls_credential_toc_find_slot(uid); in tls_credential_get()
393 status = psa_ps_get_info(uid, &info); in tls_credential_get()
407 status = psa_ps_get(uid, 0, info.size, cred, credlen); in tls_credential_get()
421 psa_storage_uid_t uid = tls_credential_get_uid(tag, type); in tls_credential_delete() local
434 slot = tls_credential_toc_find_slot(uid); in tls_credential_delete()
445 status = psa_ps_remove(uid); in tls_credential_delete()