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
395 if (!asoc->ep->auth_enable || !asoc->peer.auth_capable) in sctp_auth_asoc_init_active_key()
403 ep_key = sctp_auth_get_shkey(asoc, asoc->active_key_id); in sctp_auth_asoc_init_active_key()
406 secret = sctp_auth_asoc_create_secret(asoc, ep_key, gfp); in sctp_auth_asoc_init_active_key()
410 sctp_auth_key_put(asoc->asoc_shared_key); in sctp_auth_asoc_init_active_key()
411 asoc->asoc_shared_key = secret; in sctp_auth_asoc_init_active_key()
419 const struct sctp_association *asoc, in sctp_auth_get_shkey() argument
425 key_for_each(key, &asoc->endpoint_shared_keys) { in sctp_auth_get_shkey()
517 struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc) in sctp_auth_asoc_get_hmac() argument
525 if (asoc->default_hmac_id) in sctp_auth_asoc_get_hmac()
526 return &sctp_hmac_list[asoc->default_hmac_id]; in sctp_auth_asoc_get_hmac()
531 hmacs = asoc->peer.peer_hmacs; in sctp_auth_asoc_get_hmac()
576 int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc, in sctp_auth_asoc_verify_hmac_id() argument
582 if (!asoc) in sctp_auth_asoc_verify_hmac_id()
585 hmacs = (struct sctp_hmac_algo_param *)asoc->c.auth_hmacs; in sctp_auth_asoc_verify_hmac_id()
597 void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc, in sctp_auth_asoc_set_default_hmac() argument
606 if (asoc->default_hmac_id) in sctp_auth_asoc_set_default_hmac()
611 ep = asoc->ep; in sctp_auth_asoc_set_default_hmac()
621 asoc->default_hmac_id = id; in sctp_auth_asoc_set_default_hmac()
665 int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc) in sctp_auth_send_cid() argument
667 if (!asoc) in sctp_auth_send_cid()
670 if (!asoc->ep->auth_enable || !asoc->peer.auth_capable) in sctp_auth_send_cid()
673 return __sctp_auth_cid(chunk, asoc->peer.peer_chunks); in sctp_auth_send_cid()
677 int sctp_auth_recv_cid(sctp_cid_t chunk, const struct sctp_association *asoc) in sctp_auth_recv_cid() argument
679 if (!asoc) in sctp_auth_recv_cid()
682 if (!asoc->ep->auth_enable) in sctp_auth_recv_cid()
686 (struct sctp_chunks_param *)asoc->c.auth_chunks); in sctp_auth_recv_cid()
698 void sctp_auth_calculate_hmac(const struct sctp_association *asoc, in sctp_auth_calculate_hmac() argument
718 if (key_id == asoc->active_key_id) in sctp_auth_calculate_hmac()
719 asoc_key = asoc->asoc_shared_key; in sctp_auth_calculate_hmac()
723 ep_key = sctp_auth_get_shkey(asoc, key_id); in sctp_auth_calculate_hmac()
727 asoc_key = sctp_auth_asoc_create_secret(asoc, ep_key, gfp); in sctp_auth_calculate_hmac()
738 desc.tfm = asoc->ep->auth_hmacs[hmac_id]; in sctp_auth_calculate_hmac()
815 struct sctp_association *asoc, in sctp_auth_set_key() argument
826 if (asoc) in sctp_auth_set_key()
827 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_set_key()
874 struct sctp_association *asoc, in sctp_auth_set_active_key() argument
882 if (asoc) in sctp_auth_set_active_key()
883 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_set_active_key()
897 if (asoc) { in sctp_auth_set_active_key()
898 asoc->active_key_id = key_id; in sctp_auth_set_active_key()
899 sctp_auth_asoc_init_active_key(asoc, GFP_KERNEL); in sctp_auth_set_active_key()
907 struct sctp_association *asoc, in sctp_auth_del_key_id() argument
917 if (asoc) { in sctp_auth_del_key_id()
918 if (asoc->active_key_id == key_id) in sctp_auth_del_key_id()
921 sh_keys = &asoc->endpoint_shared_keys; in sctp_auth_del_key_id()