Lines Matching full:asoc

222 				    const struct sctp_association *asoc,  in sctp_auth_make_local_vector()  argument
226 (struct sctp_random_param *)asoc->c.auth_random, in sctp_auth_make_local_vector()
227 (struct sctp_chunks_param *)asoc->c.auth_chunks, in sctp_auth_make_local_vector()
228 (struct sctp_hmac_algo_param *)asoc->c.auth_hmacs, gfp); in sctp_auth_make_local_vector()
233 const struct sctp_association *asoc, in sctp_auth_make_peer_vector() argument
236 return sctp_auth_make_key_vector(asoc->peer.peer_random, in sctp_auth_make_peer_vector()
237 asoc->peer.peer_chunks, in sctp_auth_make_peer_vector()
238 asoc->peer.peer_hmacs, in sctp_auth_make_peer_vector()
287 const struct sctp_association *asoc, in sctp_auth_asoc_create_secret() argument
311 local_key_vector = sctp_auth_make_local_vector(asoc, gfp); in sctp_auth_asoc_create_secret()
312 peer_key_vector = sctp_auth_make_peer_vector(asoc, gfp); in sctp_auth_asoc_create_secret()
354 struct sctp_association *asoc, in sctp_auth_asoc_copy_shkeys() argument
360 BUG_ON(!list_empty(&asoc->endpoint_shared_keys)); in sctp_auth_asoc_copy_shkeys()
369 list_add(&new->key_list, &asoc->endpoint_shared_keys); in sctp_auth_asoc_copy_shkeys()
375 sctp_auth_destroy_keys(&asoc->endpoint_shared_keys); in sctp_auth_asoc_copy_shkeys()
383 int sctp_auth_asoc_init_active_key(struct sctp_association *asoc, gfp_t gfp) in sctp_auth_asoc_init_active_key() argument
392 if (!asoc->peer.auth_capable) in sctp_auth_asoc_init_active_key()
400 ep_key = sctp_auth_get_shkey(asoc, asoc->active_key_id); in sctp_auth_asoc_init_active_key()
403 secret = sctp_auth_asoc_create_secret(asoc, ep_key, gfp); in sctp_auth_asoc_init_active_key()
407 sctp_auth_key_put(asoc->asoc_shared_key); in sctp_auth_asoc_init_active_key()
408 asoc->asoc_shared_key = secret; in sctp_auth_asoc_init_active_key()
409 asoc->shkey = ep_key; in sctp_auth_asoc_init_active_key()
414 list_for_each_entry(chunk, &asoc->outqueue.out_chunk_list, list) { in sctp_auth_asoc_init_active_key()
415 if (sctp_auth_send_cid(chunk->chunk_hdr->type, asoc)) { in sctp_auth_asoc_init_active_key()
418 chunk->shkey = asoc->shkey; in sctp_auth_asoc_init_active_key()
430 const struct sctp_association *asoc, in sctp_auth_get_shkey() argument
436 key_for_each(key, &asoc->endpoint_shared_keys) { in sctp_auth_get_shkey()
524 struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc) in sctp_auth_asoc_get_hmac() argument
532 if (asoc->default_hmac_id) in sctp_auth_asoc_get_hmac()
533 return &sctp_hmac_list[asoc->default_hmac_id]; in sctp_auth_asoc_get_hmac()
538 hmacs = asoc->peer.peer_hmacs; in sctp_auth_asoc_get_hmac()
584 int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc, in sctp_auth_asoc_verify_hmac_id() argument
590 if (!asoc) in sctp_auth_asoc_verify_hmac_id()
593 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(enum sctp_cid chunk, const struct sctp_association *asoc) in sctp_auth_send_cid() argument
676 if (!asoc) in sctp_auth_send_cid()
679 if (!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(enum sctp_cid chunk, const struct sctp_association *asoc) in sctp_auth_recv_cid() argument
688 if (!asoc) in sctp_auth_recv_cid()
691 if (!asoc->peer.auth_capable) 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
725 if (key_id == asoc->active_key_id) in sctp_auth_calculate_hmac()
726 asoc_key = asoc->asoc_shared_key; in sctp_auth_calculate_hmac()
729 asoc_key = sctp_auth_asoc_create_secret(asoc, ep_key, gfp); in sctp_auth_calculate_hmac()
739 tfm = asoc->ep->auth_hmacs[hmac_id]; in sctp_auth_calculate_hmac()
818 struct sctp_association *asoc, in sctp_auth_set_key() argument
829 if (asoc) { in sctp_auth_set_key()
830 if (!asoc->peer.auth_capable) in sctp_auth_set_key()
832 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_set_key()
868 if (asoc && asoc->active_key_id == auth_key->sca_keynumber && in sctp_auth_set_key()
869 sctp_auth_asoc_init_active_key(asoc, GFP_KERNEL)) { in sctp_auth_set_key()
881 struct sctp_association *asoc, in sctp_auth_set_active_key() argument
889 if (asoc) { in sctp_auth_set_active_key()
890 if (!asoc->peer.auth_capable) in sctp_auth_set_active_key()
892 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_set_active_key()
909 if (asoc) { in sctp_auth_set_active_key()
910 __u16 active_key_id = asoc->active_key_id; in sctp_auth_set_active_key()
912 asoc->active_key_id = key_id; in sctp_auth_set_active_key()
913 if (sctp_auth_asoc_init_active_key(asoc, GFP_KERNEL)) { in sctp_auth_set_active_key()
914 asoc->active_key_id = active_key_id; in sctp_auth_set_active_key()
924 struct sctp_association *asoc, in sctp_auth_del_key_id() argument
934 if (asoc) { in sctp_auth_del_key_id()
935 if (!asoc->peer.auth_capable) in sctp_auth_del_key_id()
937 if (asoc->active_key_id == key_id) in sctp_auth_del_key_id()
940 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_del_key_id()
968 struct sctp_association *asoc, __u16 key_id) in sctp_auth_deact_key_id() argument
977 if (asoc) { in sctp_auth_deact_key_id()
978 if (!asoc->peer.auth_capable) in sctp_auth_deact_key_id()
980 if (asoc->active_key_id == key_id) in sctp_auth_deact_key_id()
983 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_deact_key_id()
1007 if (asoc && !list_empty(&key->key_list) && in sctp_auth_deact_key_id()
1011 ev = sctp_ulpevent_make_authkey(asoc, key->key_id, in sctp_auth_deact_key_id()
1014 asoc->stream.si->enqueue_event(&asoc->ulpq, ev); in sctp_auth_deact_key_id()