Lines Matching refs:asoc
237 const struct sctp_association *asoc, in sctp_auth_make_local_vector() argument
241 (struct sctp_random_param *)asoc->c.auth_random, in sctp_auth_make_local_vector()
242 (struct sctp_chunks_param *)asoc->c.auth_chunks, in sctp_auth_make_local_vector()
243 (struct sctp_hmac_algo_param *)asoc->c.auth_hmacs, gfp); in sctp_auth_make_local_vector()
248 const struct sctp_association *asoc, in sctp_auth_make_peer_vector() argument
251 return sctp_auth_make_key_vector(asoc->peer.peer_random, in sctp_auth_make_peer_vector()
252 asoc->peer.peer_chunks, in sctp_auth_make_peer_vector()
253 asoc->peer.peer_hmacs, in sctp_auth_make_peer_vector()
302 const struct sctp_association *asoc, in sctp_auth_asoc_create_secret() argument
326 local_key_vector = sctp_auth_make_local_vector(asoc, gfp); in sctp_auth_asoc_create_secret()
327 peer_key_vector = sctp_auth_make_peer_vector(asoc, gfp); in sctp_auth_asoc_create_secret()
369 struct sctp_association *asoc, in sctp_auth_asoc_copy_shkeys() argument
375 BUG_ON(!list_empty(&asoc->endpoint_shared_keys)); in sctp_auth_asoc_copy_shkeys()
384 list_add(&new->key_list, &asoc->endpoint_shared_keys); in sctp_auth_asoc_copy_shkeys()
390 sctp_auth_destroy_keys(&asoc->endpoint_shared_keys); in sctp_auth_asoc_copy_shkeys()
398 int sctp_auth_asoc_init_active_key(struct sctp_association *asoc, gfp_t gfp) in sctp_auth_asoc_init_active_key() argument
407 if (!asoc->ep->auth_enable || !asoc->peer.auth_capable) in sctp_auth_asoc_init_active_key()
415 ep_key = sctp_auth_get_shkey(asoc, asoc->active_key_id); in sctp_auth_asoc_init_active_key()
418 secret = sctp_auth_asoc_create_secret(asoc, ep_key, gfp); in sctp_auth_asoc_init_active_key()
422 sctp_auth_key_put(asoc->asoc_shared_key); in sctp_auth_asoc_init_active_key()
423 asoc->asoc_shared_key = secret; in sctp_auth_asoc_init_active_key()
424 asoc->shkey = ep_key; in sctp_auth_asoc_init_active_key()
429 list_for_each_entry(chunk, &asoc->outqueue.out_chunk_list, list) { in sctp_auth_asoc_init_active_key()
430 if (sctp_auth_send_cid(chunk->chunk_hdr->type, asoc)) { in sctp_auth_asoc_init_active_key()
433 chunk->shkey = asoc->shkey; in sctp_auth_asoc_init_active_key()
445 const struct sctp_association *asoc, in sctp_auth_get_shkey() argument
451 key_for_each(key, &asoc->endpoint_shared_keys) { in sctp_auth_get_shkey()
544 struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc) in sctp_auth_asoc_get_hmac() argument
552 if (asoc->default_hmac_id) in sctp_auth_asoc_get_hmac()
553 return &sctp_hmac_list[asoc->default_hmac_id]; in sctp_auth_asoc_get_hmac()
558 hmacs = asoc->peer.peer_hmacs; in sctp_auth_asoc_get_hmac()
604 int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc, in sctp_auth_asoc_verify_hmac_id() argument
610 if (!asoc) in sctp_auth_asoc_verify_hmac_id()
613 hmacs = (struct sctp_hmac_algo_param *)asoc->c.auth_hmacs; in sctp_auth_asoc_verify_hmac_id()
626 void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc, in sctp_auth_asoc_set_default_hmac() argument
635 if (asoc->default_hmac_id) in sctp_auth_asoc_set_default_hmac()
640 ep = asoc->ep; in sctp_auth_asoc_set_default_hmac()
650 asoc->default_hmac_id = id; in sctp_auth_asoc_set_default_hmac()
694 int sctp_auth_send_cid(enum sctp_cid chunk, const struct sctp_association *asoc) in sctp_auth_send_cid() argument
696 if (!asoc) in sctp_auth_send_cid()
699 if (!asoc->ep->auth_enable || !asoc->peer.auth_capable) in sctp_auth_send_cid()
702 return __sctp_auth_cid(chunk, asoc->peer.peer_chunks); in sctp_auth_send_cid()
706 int sctp_auth_recv_cid(enum sctp_cid chunk, const struct sctp_association *asoc) in sctp_auth_recv_cid() argument
708 if (!asoc) in sctp_auth_recv_cid()
711 if (!asoc->ep->auth_enable) in sctp_auth_recv_cid()
715 (struct sctp_chunks_param *)asoc->c.auth_chunks); in sctp_auth_recv_cid()
727 void sctp_auth_calculate_hmac(const struct sctp_association *asoc, in sctp_auth_calculate_hmac() argument
745 if (key_id == asoc->active_key_id) in sctp_auth_calculate_hmac()
746 asoc_key = asoc->asoc_shared_key; in sctp_auth_calculate_hmac()
749 asoc_key = sctp_auth_asoc_create_secret(asoc, ep_key, gfp); in sctp_auth_calculate_hmac()
759 tfm = asoc->ep->auth_hmacs[hmac_id]; in sctp_auth_calculate_hmac()
845 struct sctp_association *asoc, in sctp_auth_set_key() argument
856 if (asoc) in sctp_auth_set_key()
857 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_set_key()
892 struct sctp_association *asoc, in sctp_auth_set_active_key() argument
900 if (asoc) in sctp_auth_set_active_key()
901 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_set_active_key()
915 if (asoc) { in sctp_auth_set_active_key()
916 asoc->active_key_id = key_id; in sctp_auth_set_active_key()
917 sctp_auth_asoc_init_active_key(asoc, GFP_KERNEL); in sctp_auth_set_active_key()
925 struct sctp_association *asoc, in sctp_auth_del_key_id() argument
935 if (asoc) { in sctp_auth_del_key_id()
936 if (asoc->active_key_id == key_id) in sctp_auth_del_key_id()
939 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_del_key_id()
965 struct sctp_association *asoc, __u16 key_id) in sctp_auth_deact_key_id() argument
974 if (asoc) { in sctp_auth_deact_key_id()
975 if (asoc->active_key_id == key_id) in sctp_auth_deact_key_id()
978 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_deact_key_id()
1000 if (asoc && !list_empty(&key->key_list) && in sctp_auth_deact_key_id()
1004 ev = sctp_ulpevent_make_authkey(asoc, key->key_id, in sctp_auth_deact_key_id()
1007 asoc->stream.si->enqueue_event(&asoc->ulpq, ev); in sctp_auth_deact_key_id()