Lines Matching refs:assoc
763 sadb_sa_t *assoc = (sadb_sa_t *)ksi->ks_in_extv[SADB_EXT_SA]; in ah_add_sa_finish() local
792 if (assoc->sadb_sa_flags & IPSA_F_INBOUND) { in ah_add_sa_finish()
796 if (assoc->sadb_sa_flags & IPSA_F_OUTBOUND) in ah_add_sa_finish()
799 if (assoc->sadb_sa_flags & IPSA_F_OUTBOUND) { in ah_add_sa_finish()
812 assoc->sadb_sa_flags |= IPSA_F_OUTBOUND; in ah_add_sa_finish()
823 assoc->sadb_sa_flags |= IPSA_F_INBOUND; in ah_add_sa_finish()
839 assoc->sadb_sa_flags |= IPSA_F_OUTBOUND; in ah_add_sa_finish()
843 assoc->sadb_sa_flags |= IPSA_F_INBOUND; in ah_add_sa_finish()
902 larval = ipsec_getassocbyspi(sq.inbound, sq.assoc->sadb_sa_spi, in ah_add_sa_finish()
1022 sadb_sa_t *assoc = (sadb_sa_t *)ksi->ks_in_extv[SADB_EXT_SA]; in ah_add_sa() local
1061 if (assoc == NULL) { in ah_add_sa()
1076 if ((assoc->sadb_sa_state != SADB_SASTATE_MATURE) && in ah_add_sa()
1077 (assoc->sadb_sa_state != SADB_X_SASTATE_ACTIVE_ELSEWHERE)) { in ah_add_sa()
1081 if (assoc->sadb_sa_encrypt != SADB_EALG_NONE) { in ah_add_sa()
1085 if (assoc->sadb_sa_flags & ~ahstack->ah_sadb.s_addflags) { in ah_add_sa()
1115 aalg = ipss->ipsec_alglists[IPSEC_ALG_AUTH][assoc->sadb_sa_auth]; in ah_add_sa()
1119 assoc->sadb_sa_auth)); in ah_add_sa()
1155 sadb_sa_t *assoc = (sadb_sa_t *)ksi->ks_in_extv[SADB_EXT_SA]; in ah_update_sa() local
1170 if ((assoc->sadb_sa_state != SADB_X_SASTATE_ACTIVE) || in ah_update_sa()
1190 sadb_sa_t *assoc = (sadb_sa_t *)ksi->ks_in_extv[SADB_EXT_SA]; in ah_del_sa() local
1197 if (assoc == NULL) { in ah_del_sa()
1547 ah_set_usetime(ipsa_t *assoc, boolean_t inbound) in ah_set_usetime() argument
1554 netstack_t *ns = assoc->ipsa_netstack; in ah_set_usetime()
1558 if (!assoc->ipsa_haspeer) { in ah_set_usetime()
1559 sadb_set_usetime(assoc); in ah_set_usetime()
1574 isv6 = (assoc->ipsa_addrfam == AF_INET6); in ah_set_usetime()
1579 ASSERT(assoc->ipsa_addrfam == AF_INET); in ah_set_usetime()
1582 inassoc = assoc; in ah_set_usetime()
1604 outassoc = assoc; in ah_set_usetime()
1646 ah_age_bytes(ipsa_t *assoc, uint64_t bytes, boolean_t inbound) in ah_age_bytes() argument
1653 netstack_t *ns = assoc->ipsa_netstack; in ah_age_bytes()
1657 if (!assoc->ipsa_haspeer) { in ah_age_bytes()
1658 return (sadb_age_bytes(ahstack->ah_pfkey_q, assoc, bytes, in ah_age_bytes()
1674 isv6 = (assoc->ipsa_addrfam == AF_INET6); in ah_age_bytes()
1679 ASSERT(assoc->ipsa_addrfam == AF_INET); in ah_age_bytes()
1682 inassoc = assoc; in ah_age_bytes()
1703 outassoc = assoc; in ah_age_bytes()
1747 sadb_sa_t *assoc; in ah_getspi() local
1851 assoc = (sadb_sa_t *)ksi->ks_in_extv[SADB_EXT_SPIRANGE]; in ah_getspi()
1852 assoc->sadb_sa_exttype = SADB_EXT_SA; in ah_getspi()
1853 assoc->sadb_sa_spi = newbie->ipsa_spi; in ah_getspi()
1854 *((uint64_t *)(&assoc->sadb_sa_replay)) = 0; in ah_getspi()
1885 ipsa_t *assoc; in ah_icmp_error_v6() local
1919 assoc = ipsec_getassocbyspi(isaf, ah->ah_spi, in ah_icmp_error_v6()
1923 if (assoc == NULL) { in ah_icmp_error_v6()
1941 IPSA_REFRELE(assoc); in ah_icmp_error_v6()
1986 ipsa_t *assoc; in ah_icmp_error_v4() local
2028 assoc = ipsec_getassocbyspi(hptr, ah->ah_spi, in ah_icmp_error_v4()
2032 if (assoc == NULL) { in ah_icmp_error_v4()
2050 IPSA_REFRELE(assoc); in ah_icmp_error_v4()
2393 ah_finish_up(ah_t *phdr_ah, ah_t *inbound_ah, ipsa_t *assoc, in ah_finish_up() argument
2419 phdr_ah->ah_spi = assoc->ipsa_spi; in ah_finish_up()
2422 htonl(atomic_inc_32_nv(&assoc->ipsa_replay)); in ah_finish_up()
2423 if (phdr_ah->ah_replay == 0 && assoc->ipsa_replay_wsize != 0) { in ah_finish_up()
2432 assoc->ipsa_dstaddr, assoc->ipsa_addrfam, in ah_finish_up()
2435 sadb_replay_delete(assoc); in ah_finish_up()
2453 ASSERT(inbound_ah->ah_spi == assoc->ipsa_spi); in ah_finish_up()
2480 ipsa_t *assoc = ira->ira_ipsec_ah_sa; in ah_log_bad_auth() local
2509 assoc->ipsa_spi, addr, af, ahstack->ipsecah_netstack); in ah_log_bad_auth()
2711 size_t skip_len, uint32_t ah_offset, ipsa_t *assoc) in ah_submit_req_inbound() argument
2716 uint_t icv_len = assoc->ipsa_mac_len; in ah_submit_req_inbound()
2720 boolean_t force = (assoc->ipsa_flags & IPSA_F_ASYNC); in ah_submit_req_inbound()
2761 IPSEC_CTX_TMPL(assoc, ipsa_authtmpl, IPSEC_ALG_AUTH, ctx_tmpl); in ah_submit_req_inbound()
2764 kef_rc = crypto_mac_verify(&assoc->ipsa_amech, in ah_submit_req_inbound()
2765 &ic->ic_crypto_data, &assoc->ipsa_kcfauthkey, ctx_tmpl, in ah_submit_req_inbound()
2810 size_t skip_len, ipsa_t *assoc) in ah_submit_req_outbound() argument
2815 uint_t icv_len = assoc->ipsa_mac_len; in ah_submit_req_outbound()
2819 boolean_t force = (assoc->ipsa_flags & IPSA_F_ASYNC); in ah_submit_req_outbound()
2860 kef_rc = crypto_mac(&assoc->ipsa_amech, &ic->ic_crypto_data, in ah_submit_req_outbound()
2861 &assoc->ipsa_kcfauthkey, assoc->ipsa_authtmpl, in ah_submit_req_outbound()
2896 ah_process_ip_options_v6(mblk_t *mp, ipsa_t *assoc, int *length_to_skip, in ah_process_ip_options_v6() argument
2990 assoc, ah_data_sz, ah_align_sz, ahstack)) { in ah_process_ip_options_v6()
3012 ah_process_ip_options_v4(mblk_t *mp, ipsa_t *assoc, int *length_to_skip, in ah_process_ip_options_v4() argument
3198 assoc, ah_data_sz, ah_align_sz, ahstack)) { in ah_process_ip_options_v4()
3228 ipsa_t *assoc; in ah_outbound() local
3250 assoc = ixa->ixa_ipsec_ah_sa; in ah_outbound()
3251 ASSERT(assoc != NULL); in ah_outbound()
3257 if (is_system_labeled() && (assoc->ipsa_otsl != NULL)) { in ah_outbound()
3272 label_hold(assoc->ipsa_otsl); in ah_outbound()
3273 ip_xmit_attr_replace_tsl(ixa, assoc->ipsa_otsl); in ah_outbound()
3275 data_mp = sadb_whack_label(data_mp, assoc, ixa, in ah_outbound()
3291 ah_align_sz = P2ALIGN(assoc->ipsa_mac_len + in ah_outbound()
3297 ah_align_sz = P2ALIGN(assoc->ipsa_mac_len + in ah_outbound()
3303 if (!ah_age_bytes(assoc, age_bytes, B_FALSE)) { in ah_outbound()
3307 ntohl(assoc->ipsa_spi), assoc->ipsa_dstaddr, AF_INET, in ah_outbound()
3328 phdr_mp = ah_process_ip_options_v4(data_mp, assoc, in ah_outbound()
3329 &length_to_skip, assoc->ipsa_mac_len, B_TRUE, ahstack); in ah_outbound()
3331 phdr_mp = ah_process_ip_options_v6(data_mp, assoc, in ah_outbound()
3332 &length_to_skip, assoc->ipsa_mac_len, B_TRUE, ahstack); in ah_outbound()
3359 data_mp = ah_submit_req_outbound(data_mp, ixa, length_to_skip, assoc); in ah_outbound()
3369 ipsa_t *assoc = ira->ira_ipsec_ah_sa; in ah_inbound() local
3378 ASSERT(assoc != NULL); in ah_inbound()
3391 if (!sadb_replay_peek(assoc, ah->ah_replay)) { in ah_inbound()
3438 phdr_mp = ah_process_ip_options_v4(data_mp, assoc, in ah_inbound()
3439 &length_to_skip, assoc->ipsa_mac_len, B_FALSE, ahstack); in ah_inbound()
3441 phdr_mp = ah_process_ip_options_v6(data_mp, assoc, in ah_inbound()
3442 &length_to_skip, assoc->ipsa_mac_len, B_FALSE, ahstack); in ah_inbound()
3462 assoc)); in ah_inbound()
3485 ipsa_t *assoc; in ah_auth_in_done() local
3492 assoc = ira->ira_ipsec_ah_sa; in ah_auth_in_done()
3513 ah_set_usetime(assoc, B_TRUE); in ah_auth_in_done()
3540 if (!sadb_replay_check(assoc, ah->ah_replay)) { in ah_auth_in_done()
3563 assoc->ipsa_spi, addr, af, ahstack->ipsecah_netstack); in ah_auth_in_done()
3582 if (!ah_age_bytes(assoc, length, B_TRUE)) { in ah_auth_in_done()
3587 assoc->ipsa_spi, assoc->ipsa_dstaddr, in ah_auth_in_done()
3612 if (!ah_age_bytes(assoc, length + sizeof (ip6_t), B_TRUE)) { in ah_auth_in_done()
3617 "expire.\n", assoc->ipsa_spi, &ip6h->ip6_dst, in ah_auth_in_done()
3677 if (is_system_labeled() && (assoc->ipsa_tsl != NULL)) { in ah_auth_in_done()
3678 if (!ip_recv_attr_replace_label(ira, assoc->ipsa_tsl)) { in ah_auth_in_done()
3686 if (assoc->ipsa_state == IPSA_STATE_IDLE) { in ah_auth_in_done()
3691 sadb_buf_pkt(assoc, mp, ira); in ah_auth_in_done()