Lines Matching refs:key

61 void sctp_auth_key_put(struct sctp_auth_bytes *key)  in sctp_auth_key_put()  argument
63 if (!key) in sctp_auth_key_put()
66 if (atomic_dec_and_test(&key->refcnt)) { in sctp_auth_key_put()
67 kzfree(key); in sctp_auth_key_put()
75 struct sctp_auth_bytes *key; in sctp_auth_create_key() local
82 key = kmalloc(sizeof(struct sctp_auth_bytes) + key_len, gfp); in sctp_auth_create_key()
83 if (!key) in sctp_auth_create_key()
86 key->len = key_len; in sctp_auth_create_key()
87 atomic_set(&key->refcnt, 1); in sctp_auth_create_key()
90 return key; in sctp_auth_create_key()
113 sctp_auth_key_put(sh_key->key); in sctp_auth_shkey_free()
114 sh_key->key = NULL; in sctp_auth_shkey_free()
267 if (ep_key->key) in sctp_auth_asoc_set_secret()
268 auth_len += ep_key->key->len; in sctp_auth_asoc_set_secret()
274 if (ep_key->key) { in sctp_auth_asoc_set_secret()
275 memcpy(secret->data, ep_key->key->data, ep_key->key->len); in sctp_auth_asoc_set_secret()
276 offset += ep_key->key->len; in sctp_auth_asoc_set_secret()
371 new->key = sh_key->key; in sctp_auth_asoc_copy_shkeys()
372 sctp_auth_key_hold(new->key); in sctp_auth_asoc_copy_shkeys()
431 struct sctp_shared_key *key; in sctp_auth_get_shkey() local
434 key_for_each(key, &asoc->endpoint_shared_keys) { in sctp_auth_get_shkey()
435 if (key->key_id == key_id) in sctp_auth_get_shkey()
436 return key; in sctp_auth_get_shkey()
828 struct sctp_auth_bytes *key; in sctp_auth_set_key() local
858 key = sctp_auth_create_key(auth_key->sca_keylength, GFP_KERNEL); in sctp_auth_set_key()
859 if (!key) in sctp_auth_set_key()
862 memcpy(key->data, &auth_key->sca_key[0], auth_key->sca_keylength); in sctp_auth_set_key()
869 sctp_auth_key_put(cur_key->key); in sctp_auth_set_key()
873 cur_key->key = key; in sctp_auth_set_key()
886 struct sctp_shared_key *key; in sctp_auth_set_active_key() local
896 key_for_each(key, sh_keys) { in sctp_auth_set_active_key()
897 if (key->key_id == key_id) { in sctp_auth_set_active_key()
919 struct sctp_shared_key *key; in sctp_auth_del_key_id() local
938 key_for_each(key, sh_keys) { in sctp_auth_del_key_id()
939 if (key->key_id == key_id) { in sctp_auth_del_key_id()
949 list_del_init(&key->key_list); in sctp_auth_del_key_id()
950 sctp_auth_shkey_free(key); in sctp_auth_del_key_id()