Lines Matching refs:key

46 void sctp_auth_key_put(struct sctp_auth_bytes *key)  in sctp_auth_key_put()  argument
48 if (!key) in sctp_auth_key_put()
51 if (refcount_dec_and_test(&key->refcnt)) { in sctp_auth_key_put()
52 kfree_sensitive(key); in sctp_auth_key_put()
60 struct sctp_auth_bytes *key; in sctp_auth_create_key() local
67 key = kmalloc(sizeof(struct sctp_auth_bytes) + key_len, gfp); in sctp_auth_create_key()
68 if (!key) in sctp_auth_create_key()
71 key->len = key_len; in sctp_auth_create_key()
72 refcount_set(&key->refcnt, 1); in sctp_auth_create_key()
75 return key; in sctp_auth_create_key()
99 sctp_auth_key_put(sh_key->key); in sctp_auth_shkey_destroy()
100 sh_key->key = NULL; in sctp_auth_shkey_destroy()
263 if (ep_key->key) in sctp_auth_asoc_set_secret()
264 auth_len += ep_key->key->len; in sctp_auth_asoc_set_secret()
270 if (ep_key->key) { in sctp_auth_asoc_set_secret()
271 memcpy(secret->data, ep_key->key->data, ep_key->key->len); in sctp_auth_asoc_set_secret()
272 offset += ep_key->key->len; in sctp_auth_asoc_set_secret()
367 new->key = sh_key->key; in sctp_auth_asoc_copy_shkeys()
368 sctp_auth_key_hold(new->key); in sctp_auth_asoc_copy_shkeys()
433 struct sctp_shared_key *key; in sctp_auth_get_shkey() local
436 key_for_each(key, &asoc->endpoint_shared_keys) { in sctp_auth_get_shkey()
437 if (key->key_id == key_id) { in sctp_auth_get_shkey()
438 if (!key->deactivated) in sctp_auth_get_shkey()
439 return key; in sctp_auth_get_shkey()
822 struct sctp_auth_bytes *key; in sctp_auth_set_key() local
851 key = sctp_auth_create_key(auth_key->sca_keylength, GFP_KERNEL); in sctp_auth_set_key()
852 if (!key) { in sctp_auth_set_key()
857 memcpy(key->data, &auth_key->sca_key[0], auth_key->sca_keylength); in sctp_auth_set_key()
858 cur_key->key = key; in sctp_auth_set_key()
884 struct sctp_shared_key *key; in sctp_auth_set_active_key() local
899 key_for_each(key, sh_keys) { in sctp_auth_set_active_key()
900 if (key->key_id == key_id) { in sctp_auth_set_active_key()
906 if (!found || key->deactivated) in sctp_auth_set_active_key()
927 struct sctp_shared_key *key; in sctp_auth_del_key_id() local
950 key_for_each(key, sh_keys) { in sctp_auth_del_key_id()
951 if (key->key_id == key_id) { in sctp_auth_del_key_id()
961 list_del_init(&key->key_list); in sctp_auth_del_key_id()
962 sctp_auth_shkey_release(key); in sctp_auth_del_key_id()
970 struct sctp_shared_key *key; in sctp_auth_deact_key_id() local
993 key_for_each(key, sh_keys) { in sctp_auth_deact_key_id()
994 if (key->key_id == key_id) { in sctp_auth_deact_key_id()
1007 if (asoc && !list_empty(&key->key_list) && in sctp_auth_deact_key_id()
1008 refcount_read(&key->refcnt) == 1) { in sctp_auth_deact_key_id()
1011 ev = sctp_ulpevent_make_authkey(asoc, key->key_id, in sctp_auth_deact_key_id()
1017 key->deactivated = 1; in sctp_auth_deact_key_id()