Lines Matching refs: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()
523 struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc) in sctp_auth_asoc_get_hmac() argument
531 if (asoc->default_hmac_id) in sctp_auth_asoc_get_hmac()
532 return &sctp_hmac_list[asoc->default_hmac_id]; in sctp_auth_asoc_get_hmac()
537 hmacs = asoc->peer.peer_hmacs; in sctp_auth_asoc_get_hmac()
583 int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc, in sctp_auth_asoc_verify_hmac_id() argument
589 if (!asoc) in sctp_auth_asoc_verify_hmac_id()
592 hmacs = (struct sctp_hmac_algo_param *)asoc->c.auth_hmacs; in sctp_auth_asoc_verify_hmac_id()
605 void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc, in sctp_auth_asoc_set_default_hmac() argument
614 if (asoc->default_hmac_id) in sctp_auth_asoc_set_default_hmac()
619 ep = asoc->ep; in sctp_auth_asoc_set_default_hmac()
629 asoc->default_hmac_id = id; in sctp_auth_asoc_set_default_hmac()
673 int sctp_auth_send_cid(enum sctp_cid chunk, const struct sctp_association *asoc) in sctp_auth_send_cid() argument
675 if (!asoc) in sctp_auth_send_cid()
678 if (!asoc->peer.auth_capable) in sctp_auth_send_cid()
681 return __sctp_auth_cid(chunk, asoc->peer.peer_chunks); in sctp_auth_send_cid()
685 int sctp_auth_recv_cid(enum sctp_cid chunk, const struct sctp_association *asoc) in sctp_auth_recv_cid() argument
687 if (!asoc) in sctp_auth_recv_cid()
690 if (!asoc->peer.auth_capable) in sctp_auth_recv_cid()
694 (struct sctp_chunks_param *)asoc->c.auth_chunks); in sctp_auth_recv_cid()
706 void sctp_auth_calculate_hmac(const struct sctp_association *asoc, in sctp_auth_calculate_hmac() argument
724 if (key_id == asoc->active_key_id) in sctp_auth_calculate_hmac()
725 asoc_key = asoc->asoc_shared_key; in sctp_auth_calculate_hmac()
728 asoc_key = sctp_auth_asoc_create_secret(asoc, ep_key, gfp); in sctp_auth_calculate_hmac()
738 tfm = asoc->ep->auth_hmacs[hmac_id]; in sctp_auth_calculate_hmac()
823 struct sctp_association *asoc, in sctp_auth_set_key() argument
834 if (asoc) { in sctp_auth_set_key()
835 if (!asoc->peer.auth_capable) in sctp_auth_set_key()
837 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_set_key()
875 struct sctp_association *asoc, in sctp_auth_set_active_key() argument
883 if (asoc) { in sctp_auth_set_active_key()
884 if (!asoc->peer.auth_capable) in sctp_auth_set_active_key()
886 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_set_active_key()
903 if (asoc) { in sctp_auth_set_active_key()
904 asoc->active_key_id = key_id; in sctp_auth_set_active_key()
905 sctp_auth_asoc_init_active_key(asoc, GFP_KERNEL); in sctp_auth_set_active_key()
913 struct sctp_association *asoc, in sctp_auth_del_key_id() argument
923 if (asoc) { in sctp_auth_del_key_id()
924 if (!asoc->peer.auth_capable) in sctp_auth_del_key_id()
926 if (asoc->active_key_id == key_id) in sctp_auth_del_key_id()
929 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_del_key_id()
957 struct sctp_association *asoc, __u16 key_id) in sctp_auth_deact_key_id() argument
966 if (asoc) { in sctp_auth_deact_key_id()
967 if (!asoc->peer.auth_capable) in sctp_auth_deact_key_id()
969 if (asoc->active_key_id == key_id) in sctp_auth_deact_key_id()
972 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_deact_key_id()
996 if (asoc && !list_empty(&key->key_list) && in sctp_auth_deact_key_id()
1000 ev = sctp_ulpevent_make_authkey(asoc, key->key_id, in sctp_auth_deact_key_id()
1003 asoc->stream.si->enqueue_event(&asoc->ulpq, ev); in sctp_auth_deact_key_id()