Lines Matching refs:asoc

225 				    const struct sctp_association *asoc,  in sctp_auth_make_local_vector()  argument
229 (sctp_random_param_t *)asoc->c.auth_random, in sctp_auth_make_local_vector()
230 (sctp_chunks_param_t *)asoc->c.auth_chunks, in sctp_auth_make_local_vector()
231 (sctp_hmac_algo_param_t *)asoc->c.auth_hmacs, in sctp_auth_make_local_vector()
237 const struct sctp_association *asoc, in sctp_auth_make_peer_vector() argument
240 return sctp_auth_make_key_vector(asoc->peer.peer_random, in sctp_auth_make_peer_vector()
241 asoc->peer.peer_chunks, in sctp_auth_make_peer_vector()
242 asoc->peer.peer_hmacs, in sctp_auth_make_peer_vector()
291 const struct sctp_association *asoc, in sctp_auth_asoc_create_secret() argument
315 local_key_vector = sctp_auth_make_local_vector(asoc, gfp); in sctp_auth_asoc_create_secret()
316 peer_key_vector = sctp_auth_make_peer_vector(asoc, gfp); in sctp_auth_asoc_create_secret()
358 struct sctp_association *asoc, in sctp_auth_asoc_copy_shkeys() argument
364 BUG_ON(!list_empty(&asoc->endpoint_shared_keys)); in sctp_auth_asoc_copy_shkeys()
373 list_add(&new->key_list, &asoc->endpoint_shared_keys); in sctp_auth_asoc_copy_shkeys()
379 sctp_auth_destroy_keys(&asoc->endpoint_shared_keys); in sctp_auth_asoc_copy_shkeys()
387 int sctp_auth_asoc_init_active_key(struct sctp_association *asoc, gfp_t gfp) in sctp_auth_asoc_init_active_key() argument
396 if (!asoc->ep->auth_enable || !asoc->peer.auth_capable) in sctp_auth_asoc_init_active_key()
404 ep_key = sctp_auth_get_shkey(asoc, asoc->active_key_id); in sctp_auth_asoc_init_active_key()
407 secret = sctp_auth_asoc_create_secret(asoc, ep_key, gfp); in sctp_auth_asoc_init_active_key()
411 sctp_auth_key_put(asoc->asoc_shared_key); in sctp_auth_asoc_init_active_key()
412 asoc->asoc_shared_key = secret; in sctp_auth_asoc_init_active_key()
417 list_for_each_entry(chunk, &asoc->outqueue.out_chunk_list, list) { in sctp_auth_asoc_init_active_key()
418 if (sctp_auth_send_cid(chunk->chunk_hdr->type, asoc)) in sctp_auth_asoc_init_active_key()
428 const struct sctp_association *asoc, in sctp_auth_get_shkey() argument
434 key_for_each(key, &asoc->endpoint_shared_keys) { in sctp_auth_get_shkey()
526 struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc) in sctp_auth_asoc_get_hmac() argument
534 if (asoc->default_hmac_id) in sctp_auth_asoc_get_hmac()
535 return &sctp_hmac_list[asoc->default_hmac_id]; in sctp_auth_asoc_get_hmac()
540 hmacs = asoc->peer.peer_hmacs; in sctp_auth_asoc_get_hmac()
585 int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc, in sctp_auth_asoc_verify_hmac_id() argument
591 if (!asoc) in sctp_auth_asoc_verify_hmac_id()
594 hmacs = (struct sctp_hmac_algo_param *)asoc->c.auth_hmacs; in sctp_auth_asoc_verify_hmac_id()
606 void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc, in sctp_auth_asoc_set_default_hmac() argument
615 if (asoc->default_hmac_id) in sctp_auth_asoc_set_default_hmac()
620 ep = asoc->ep; in sctp_auth_asoc_set_default_hmac()
630 asoc->default_hmac_id = id; in sctp_auth_asoc_set_default_hmac()
674 int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc) in sctp_auth_send_cid() argument
676 if (!asoc) in sctp_auth_send_cid()
679 if (!asoc->ep->auth_enable || !asoc->peer.auth_capable) in sctp_auth_send_cid()
682 return __sctp_auth_cid(chunk, asoc->peer.peer_chunks); in sctp_auth_send_cid()
686 int sctp_auth_recv_cid(sctp_cid_t chunk, const struct sctp_association *asoc) in sctp_auth_recv_cid() argument
688 if (!asoc) in sctp_auth_recv_cid()
691 if (!asoc->ep->auth_enable) in sctp_auth_recv_cid()
695 (struct sctp_chunks_param *)asoc->c.auth_chunks); in sctp_auth_recv_cid()
707 void sctp_auth_calculate_hmac(const struct sctp_association *asoc, in sctp_auth_calculate_hmac() argument
727 if (key_id == asoc->active_key_id) in sctp_auth_calculate_hmac()
728 asoc_key = asoc->asoc_shared_key; in sctp_auth_calculate_hmac()
732 ep_key = sctp_auth_get_shkey(asoc, key_id); in sctp_auth_calculate_hmac()
736 asoc_key = sctp_auth_asoc_create_secret(asoc, ep_key, gfp); in sctp_auth_calculate_hmac()
747 desc.tfm = asoc->ep->auth_hmacs[hmac_id]; in sctp_auth_calculate_hmac()
824 struct sctp_association *asoc, in sctp_auth_set_key() argument
835 if (asoc) in sctp_auth_set_key()
836 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_set_key()
883 struct sctp_association *asoc, in sctp_auth_set_active_key() argument
891 if (asoc) in sctp_auth_set_active_key()
892 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_set_active_key()
906 if (asoc) { in sctp_auth_set_active_key()
907 asoc->active_key_id = key_id; in sctp_auth_set_active_key()
908 sctp_auth_asoc_init_active_key(asoc, GFP_KERNEL); in sctp_auth_set_active_key()
916 struct sctp_association *asoc, in sctp_auth_del_key_id() argument
926 if (asoc) { in sctp_auth_del_key_id()
927 if (asoc->active_key_id == key_id) in sctp_auth_del_key_id()
930 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_del_key_id()