Lines Matching refs:assoc

775 	sadb_sa_t *assoc = (sadb_sa_t *)ksi->ks_in_extv[SADB_EXT_SA];  in ah_add_sa_finish()  local
804 if (assoc->sadb_sa_flags & IPSA_F_INBOUND) { in ah_add_sa_finish()
808 if (assoc->sadb_sa_flags & IPSA_F_OUTBOUND) in ah_add_sa_finish()
811 if (assoc->sadb_sa_flags & IPSA_F_OUTBOUND) { in ah_add_sa_finish()
824 assoc->sadb_sa_flags |= IPSA_F_OUTBOUND; in ah_add_sa_finish()
835 assoc->sadb_sa_flags |= IPSA_F_INBOUND; in ah_add_sa_finish()
851 assoc->sadb_sa_flags |= IPSA_F_OUTBOUND; in ah_add_sa_finish()
855 assoc->sadb_sa_flags |= IPSA_F_INBOUND; in ah_add_sa_finish()
914 larval = ipsec_getassocbyspi(sq.inbound, sq.assoc->sadb_sa_spi, in ah_add_sa_finish()
1034 sadb_sa_t *assoc = (sadb_sa_t *)ksi->ks_in_extv[SADB_EXT_SA]; in ah_add_sa() local
1073 if (assoc == NULL) { in ah_add_sa()
1088 if ((assoc->sadb_sa_state != SADB_SASTATE_MATURE) && in ah_add_sa()
1089 (assoc->sadb_sa_state != SADB_X_SASTATE_ACTIVE_ELSEWHERE)) { in ah_add_sa()
1093 if (assoc->sadb_sa_encrypt != SADB_EALG_NONE) { in ah_add_sa()
1097 if (assoc->sadb_sa_flags & ~ahstack->ah_sadb.s_addflags) { in ah_add_sa()
1127 aalg = ipss->ipsec_alglists[IPSEC_ALG_AUTH][assoc->sadb_sa_auth]; in ah_add_sa()
1131 assoc->sadb_sa_auth)); in ah_add_sa()
1167 sadb_sa_t *assoc = (sadb_sa_t *)ksi->ks_in_extv[SADB_EXT_SA]; in ah_update_sa() local
1182 if ((assoc->sadb_sa_state != SADB_X_SASTATE_ACTIVE) || in ah_update_sa()
1202 sadb_sa_t *assoc = (sadb_sa_t *)ksi->ks_in_extv[SADB_EXT_SA]; in ah_del_sa() local
1209 if (assoc == NULL) { in ah_del_sa()
1548 ah_set_usetime(ipsa_t *assoc, boolean_t inbound) in ah_set_usetime() argument
1555 netstack_t *ns = assoc->ipsa_netstack; in ah_set_usetime()
1559 if (!assoc->ipsa_haspeer) { in ah_set_usetime()
1560 sadb_set_usetime(assoc); in ah_set_usetime()
1575 isv6 = (assoc->ipsa_addrfam == AF_INET6); in ah_set_usetime()
1580 ASSERT(assoc->ipsa_addrfam == AF_INET); in ah_set_usetime()
1583 inassoc = assoc; in ah_set_usetime()
1605 outassoc = assoc; in ah_set_usetime()
1647 ah_age_bytes(ipsa_t *assoc, uint64_t bytes, boolean_t inbound) in ah_age_bytes() argument
1654 netstack_t *ns = assoc->ipsa_netstack; in ah_age_bytes()
1658 if (!assoc->ipsa_haspeer) { in ah_age_bytes()
1659 return (sadb_age_bytes(ahstack->ah_pfkey_q, assoc, bytes, in ah_age_bytes()
1675 isv6 = (assoc->ipsa_addrfam == AF_INET6); in ah_age_bytes()
1680 ASSERT(assoc->ipsa_addrfam == AF_INET); in ah_age_bytes()
1683 inassoc = assoc; in ah_age_bytes()
1704 outassoc = assoc; in ah_age_bytes()
1902 sadb_sa_t *assoc; in ah_getspi() local
2006 assoc = (sadb_sa_t *)ksi->ks_in_extv[SADB_EXT_SPIRANGE]; in ah_getspi()
2007 assoc->sadb_sa_exttype = SADB_EXT_SA; in ah_getspi()
2008 assoc->sadb_sa_spi = newbie->ipsa_spi; in ah_getspi()
2009 *((uint64_t *)(&assoc->sadb_sa_replay)) = 0; in ah_getspi()
2040 ipsa_t *assoc; in ah_icmp_error_v6() local
2074 assoc = ipsec_getassocbyspi(isaf, ah->ah_spi, in ah_icmp_error_v6()
2078 if (assoc == NULL) { in ah_icmp_error_v6()
2096 IPSA_REFRELE(assoc); in ah_icmp_error_v6()
2141 ipsa_t *assoc; in ah_icmp_error_v4() local
2183 assoc = ipsec_getassocbyspi(hptr, ah->ah_spi, in ah_icmp_error_v4()
2187 if (assoc == NULL) { in ah_icmp_error_v4()
2205 IPSA_REFRELE(assoc); in ah_icmp_error_v4()
2548 ah_finish_up(ah_t *phdr_ah, ah_t *inbound_ah, ipsa_t *assoc, in ah_finish_up() argument
2574 phdr_ah->ah_spi = assoc->ipsa_spi; in ah_finish_up()
2577 htonl(atomic_inc_32_nv(&assoc->ipsa_replay)); in ah_finish_up()
2578 if (phdr_ah->ah_replay == 0 && assoc->ipsa_replay_wsize != 0) { in ah_finish_up()
2587 assoc->ipsa_dstaddr, assoc->ipsa_addrfam, in ah_finish_up()
2590 sadb_replay_delete(assoc); in ah_finish_up()
2608 ASSERT(inbound_ah->ah_spi == assoc->ipsa_spi); in ah_finish_up()
2635 ipsa_t *assoc = ira->ira_ipsec_ah_sa; in ah_log_bad_auth() local
2664 assoc->ipsa_spi, addr, af, ahstack->ipsecah_netstack); in ah_log_bad_auth()
2866 size_t skip_len, uint32_t ah_offset, ipsa_t *assoc) in ah_submit_req_inbound() argument
2871 uint_t icv_len = assoc->ipsa_mac_len; in ah_submit_req_inbound()
2875 boolean_t force = (assoc->ipsa_flags & IPSA_F_ASYNC); in ah_submit_req_inbound()
2916 IPSEC_CTX_TMPL(assoc, ipsa_authtmpl, IPSEC_ALG_AUTH, ctx_tmpl); in ah_submit_req_inbound()
2919 kef_rc = crypto_mac_verify(&assoc->ipsa_amech, in ah_submit_req_inbound()
2920 &ic->ic_crypto_data, &assoc->ipsa_kcfauthkey, ctx_tmpl, in ah_submit_req_inbound()
2965 size_t skip_len, ipsa_t *assoc) in ah_submit_req_outbound() argument
2970 uint_t icv_len = assoc->ipsa_mac_len; in ah_submit_req_outbound()
2974 boolean_t force = (assoc->ipsa_flags & IPSA_F_ASYNC); in ah_submit_req_outbound()
3015 kef_rc = crypto_mac(&assoc->ipsa_amech, &ic->ic_crypto_data, in ah_submit_req_outbound()
3016 &assoc->ipsa_kcfauthkey, assoc->ipsa_authtmpl, in ah_submit_req_outbound()
3051 ah_process_ip_options_v6(mblk_t *mp, ipsa_t *assoc, int *length_to_skip, in ah_process_ip_options_v6() argument
3145 assoc, ah_data_sz, ah_align_sz, ahstack)) { in ah_process_ip_options_v6()
3167 ah_process_ip_options_v4(mblk_t *mp, ipsa_t *assoc, int *length_to_skip, in ah_process_ip_options_v4() argument
3353 assoc, ah_data_sz, ah_align_sz, ahstack)) { in ah_process_ip_options_v4()
3383 ipsa_t *assoc; in ah_outbound() local
3405 assoc = ixa->ixa_ipsec_ah_sa; in ah_outbound()
3406 ASSERT(assoc != NULL); in ah_outbound()
3412 if (is_system_labeled() && (assoc->ipsa_otsl != NULL)) { in ah_outbound()
3427 label_hold(assoc->ipsa_otsl); in ah_outbound()
3428 ip_xmit_attr_replace_tsl(ixa, assoc->ipsa_otsl); in ah_outbound()
3430 data_mp = sadb_whack_label(data_mp, assoc, ixa, in ah_outbound()
3446 ah_align_sz = P2ALIGN(assoc->ipsa_mac_len + in ah_outbound()
3452 ah_align_sz = P2ALIGN(assoc->ipsa_mac_len + in ah_outbound()
3458 if (!ah_age_bytes(assoc, age_bytes, B_FALSE)) { in ah_outbound()
3462 ntohl(assoc->ipsa_spi), assoc->ipsa_dstaddr, AF_INET, in ah_outbound()
3483 phdr_mp = ah_process_ip_options_v4(data_mp, assoc, in ah_outbound()
3484 &length_to_skip, assoc->ipsa_mac_len, B_TRUE, ahstack); in ah_outbound()
3486 phdr_mp = ah_process_ip_options_v6(data_mp, assoc, in ah_outbound()
3487 &length_to_skip, assoc->ipsa_mac_len, B_TRUE, ahstack); in ah_outbound()
3514 data_mp = ah_submit_req_outbound(data_mp, ixa, length_to_skip, assoc); in ah_outbound()
3524 ipsa_t *assoc = ira->ira_ipsec_ah_sa; in ah_inbound() local
3533 ASSERT(assoc != NULL); in ah_inbound()
3546 if (!sadb_replay_peek(assoc, ah->ah_replay)) { in ah_inbound()
3593 phdr_mp = ah_process_ip_options_v4(data_mp, assoc, in ah_inbound()
3594 &length_to_skip, assoc->ipsa_mac_len, B_FALSE, ahstack); in ah_inbound()
3596 phdr_mp = ah_process_ip_options_v6(data_mp, assoc, in ah_inbound()
3597 &length_to_skip, assoc->ipsa_mac_len, B_FALSE, ahstack); in ah_inbound()
3617 assoc)); in ah_inbound()
3640 ipsa_t *assoc; in ah_auth_in_done() local
3647 assoc = ira->ira_ipsec_ah_sa; in ah_auth_in_done()
3668 ah_set_usetime(assoc, B_TRUE); in ah_auth_in_done()
3695 if (!sadb_replay_check(assoc, ah->ah_replay)) { in ah_auth_in_done()
3718 assoc->ipsa_spi, addr, af, ahstack->ipsecah_netstack); in ah_auth_in_done()
3737 if (!ah_age_bytes(assoc, length, B_TRUE)) { in ah_auth_in_done()
3742 assoc->ipsa_spi, assoc->ipsa_dstaddr, in ah_auth_in_done()
3767 if (!ah_age_bytes(assoc, length + sizeof (ip6_t), B_TRUE)) { in ah_auth_in_done()
3772 "expire.\n", assoc->ipsa_spi, &ip6h->ip6_dst, in ah_auth_in_done()
3832 if (is_system_labeled() && (assoc->ipsa_tsl != NULL)) { in ah_auth_in_done()
3833 if (!ip_recv_attr_replace_label(ira, assoc->ipsa_tsl)) { in ah_auth_in_done()
3841 if (assoc->ipsa_state == IPSA_STATE_IDLE) { in ah_auth_in_done()
3846 sadb_buf_pkt(assoc, mp, ira); in ah_auth_in_done()