| /xnu-8796.141.3/bsd/netinet6/ |
| H A D | esp_chachapoly.c | 92 esp_chachapoly_mature(struct secasvar *sav) in esp_chachapoly_mature() argument 96 ESP_CHECK_ARG(sav); in esp_chachapoly_mature() 98 if ((sav->flags & SADB_X_EXT_OLD) != 0) { in esp_chachapoly_mature() 100 ntohl(sav->spi)); in esp_chachapoly_mature() 103 if ((sav->flags & SADB_X_EXT_DERIV) != 0) { in esp_chachapoly_mature() 105 ntohl(sav->spi)); in esp_chachapoly_mature() 109 if (sav->alg_enc != SADB_X_EALG_CHACHA20POLY1305) { in esp_chachapoly_mature() 111 sav->alg_enc, ntohl(sav->spi)); in esp_chachapoly_mature() 115 if (sav->key_enc == NULL) { in esp_chachapoly_mature() 117 ntohl(sav->spi)); in esp_chachapoly_mature() [all …]
|
| H A D | esp_core.c | 313 esp_schedule(const struct esp_algorithm *algo, struct secasvar *sav) in esp_schedule() argument 318 if (_KEYBITS(sav->key_enc) < algo->keymin || in esp_schedule() 319 _KEYBITS(sav->key_enc) > algo->keymax) { in esp_schedule() 322 "needs %d to %d bits\n", algo->name, _KEYBITS(sav->key_enc), in esp_schedule() 329 if (sav->sched && sav->schedlen != 0) { in esp_schedule() 335 if (((sav->flags & SADB_X_EXT_IIV) != 0) && in esp_schedule() 336 (sav->alg_enc != SADB_X_EALG_AES_GCM) && in esp_schedule() 337 (sav->alg_enc != SADB_X_EALG_CHACHA20POLY1305)) { in esp_schedule() 351 sav->schedlen = (*algo->schedlen)(algo); in esp_schedule() 352 if ((signed) sav->schedlen < 0) { in esp_schedule() [all …]
|
| H A D | ah_output.c | 133 if (isr->sav == NULL) { in ah_hdrsiz() 136 if (isr->sav->state != SADB_SASTATE_MATURE in ah_hdrsiz() 137 && isr->sav->state != SADB_SASTATE_DYING) { in ah_hdrsiz() 142 algo = ah_algorithm_lookup(isr->sav->alg_auth); in ah_hdrsiz() 154 hdrsiz = (((*algo->sumsiz)(isr->sav) + 3) & ~(4 - 1)); in ah_hdrsiz() 155 if (isr->sav->flags & SADB_X_EXT_OLD) { in ah_hdrsiz() 185 ah4_output(struct mbuf *m, struct secasvar *sav) in ah4_output() argument 200 if ((sav->flags & SADB_X_EXT_OLD) == 0 && sav->replay[0] == NULL) { in ah4_output() 206 (u_int32_t)ntohl(sav->spi))); in ah4_output() 212 algo = ah_algorithm_lookup(sav->alg_auth); in ah4_output() [all …]
|
| H A D | ah_input.c | 130 struct secasvar *sav = NULL; in ah4_input() local 161 if ((sav = key_allocsa(AF_INET, in ah4_input() 172 (uint64_t)VM_KERNEL_ADDRPERM(sav))); in ah4_input() 173 if (sav->state != SADB_SASTATE_MATURE in ah4_input() 174 && sav->state != SADB_SASTATE_DYING) { in ah4_input() 182 algo = ah_algorithm_lookup(sav->alg_auth); in ah4_input() 191 siz = (*algo->sumsiz)(sav); in ah4_input() 200 sizoff = (sav->flags & SADB_X_EXT_OLD) ? 0 : 4; in ah4_input() 259 if ((sav->flags & SADB_X_EXT_OLD) == 0 && sav->replay[0] != NULL) { in ah4_input() 260 if (ipsec_chkreplay(ntohl(((struct newah *)ah)->ah_seq), sav, 0)) { in ah4_input() [all …]
|
| H A D | ah_core.c | 233 ah_sumsiz_1216(struct secasvar *sav) in ah_sumsiz_1216() argument 235 if (!sav) { in ah_sumsiz_1216() 238 if (sav->flags & SADB_X_EXT_OLD) { in ah_sumsiz_1216() 246 ah_sumsiz_zero(struct secasvar *sav) in ah_sumsiz_zero() argument 248 if (!sav) { in ah_sumsiz_zero() 255 ah_none_mature(struct secasvar *sav) in ah_none_mature() argument 257 if (sav->sah->saidx.proto == IPPROTO_AH) { in ah_none_mature() 268 __unused struct secasvar *sav) in ah_none_init() argument 292 __unused struct secasvar *sav) in ah_keyed_md5_mature() argument 299 ah_keyed_md5_init(struct ah_algorithm_state *state, struct secasvar *sav) in ah_keyed_md5_init() argument [all …]
|
| H A D | esp_output.c | 114 int, struct secasvar *sav); 134 struct secasvar *sav; in esp_hdrsiz() 143 sav = isr->sav; in esp_hdrsiz() 149 if (sav == NULL) { in esp_hdrsiz() 152 if (sav->state != SADB_SASTATE_MATURE in esp_hdrsiz() 153 && sav->state != SADB_SASTATE_DYING) { in esp_hdrsiz() 158 algo = esp_algorithm_lookup(sav->alg_enc); in esp_hdrsiz() 162 ivlen = sav->ivlen; in esp_hdrsiz() 174 if (sav->flags & SADB_X_EXT_OLD) { in esp_hdrsiz() 179 aalgo = ah_algorithm_lookup(sav->alg_auth); in esp_hdrsiz() [all …]
|
| H A D | esp_input.c | 171 esp_input_log(struct mbuf *m, struct secasvar *sav, u_int32_t spi, u_int32_t seq) in esp_input_log() argument 174 (sav->sah->ipsec_if->if_xflags & IFXF_MPK_LOG) == IFXF_MPK_LOG) { in esp_input_log() 219 struct secasvar *sav = NULL; in esp4_input_extended() local 273 if ((sav = key_allocsa_extended(AF_INET, in esp4_input_extended() 284 (uint64_t)VM_KERNEL_ADDRPERM(sav))); in esp4_input_extended() 285 if (sav->state != SADB_SASTATE_MATURE in esp4_input_extended() 286 && sav->state != SADB_SASTATE_DYING) { in esp4_input_extended() 293 algo = esp_algorithm_lookup(sav->alg_enc); in esp4_input_extended() 303 ivlen = sav->ivlen; in esp4_input_extended() 306 ipsec4_logpacketstr(ip, spi), ipsec_logsastr(sav))); in esp4_input_extended() [all …]
|
| H A D | ipsec.c | 254 …ic int ipsec6_update_routecache_and_output(struct ipsec_output_state *state, struct secasvar *sav); 255 static int ipsec46_encapsulate(struct ipsec_output_state *state, struct secasvar *sav); 259 int ipsec_send_natt_keepalive(struct secasvar *sav); 260 bool ipsec_fill_offload_frame(ifnet_t ifp, struct secasvar *sav, struct ifnet_keepalive_offload_fra… 1962 if (isr->sav != NULL in ipsec_in_reject() 1963 && isr->sav->flags == SADB_X_EXT_NONE in ipsec_in_reject() 1964 && isr->sav->alg_auth != SADB_AALG_NONE) { in ipsec_in_reject() 2275 ipsec4_encapsulate(struct mbuf *m, struct secasvar *sav) in ipsec4_encapsulate() argument 2283 if (((struct sockaddr *)&sav->sah->saidx.src)->sa_family in ipsec4_encapsulate() 2284 != ((struct sockaddr *)&sav->sah->saidx.dst)->sa_family in ipsec4_encapsulate() [all …]
|
| H A D | esp_rijndael.c | 106 struct secasvar *sav) in esp_aes_schedule() argument 109 aes_ctx *ctx = (aes_ctx*)sav->sched; in esp_aes_schedule() 111 …aes_decrypt_key((const unsigned char *) _KEYBUF(sav->key_enc), _KEYLEN(sav->key_enc), &ctx->decryp… in esp_aes_schedule() 112 …aes_encrypt_key((const unsigned char *) _KEYBUF(sav->key_enc), _KEYLEN(sav->key_enc), &ctx->encryp… in esp_aes_schedule() 150 struct secasvar *sav, in esp_cbc_decrypt_aes() argument 173 if (sav->flags & SADB_X_EXT_OLD) { in esp_cbc_decrypt_aes() 320 (aes_decrypt_ctx*)(&(((aes_ctx*)sav->sched)->decrypt))); in esp_cbc_decrypt_aes() 365 struct secasvar *sav, in esp_cbc_encrypt_aes() argument 388 if (sav->flags & SADB_X_EXT_OLD) { in esp_cbc_encrypt_aes() 400 m_copyback(m, (int)ivoff, ivlen, sav->iv); in esp_cbc_encrypt_aes() [all …]
|
| H A D | ah.h | 64 struct secasvar *sav; member
|
| /xnu-8796.141.3/bsd/netkey/ |
| H A D | key.c | 340 #define KEY_CHKSASTATE(head, sav, name) \ argument 341 if ((head) != (sav)) { \ 343 (name), (head), (sav))); \ 524 int ipsec_send_natt_keepalive(struct secasvar *sav); 525 bool ipsec_fill_offload_frame(ifnet_t ifp, struct secasvar *sav, struct ifnet_keepalive_offload_fra… 569 key_get_flowid(struct secasvar *sav) in key_get_flowid() argument 573 struct secashead *sah = sav->sah; in key_get_flowid() 605 ASSERT(sav->spi != 0); in key_get_flowid() 606 fk.ffk_spi = sav->spi;; in key_get_flowid() 610 flowidns_allocate_flowid(FLOWIDNS_DOMAIN_IPSEC, &fk, &sav->flowid); in key_get_flowid() [all …]
|
| H A D | key_debug.c | 612 kdebug_secasv(sav) in kdebug_secasv() argument 613 struct secasvar *sav; in kdebug_secasv() 616 if (sav == NULL) { 621 kdebug_secasindex(&sav->sah->saidx); 624 sav->refcnt, sav->state, sav->alg_auth, sav->alg_enc); 626 (u_int32_t)ntohl(sav->spi), sav->flags); 628 if (sav->key_auth != NULL) { 629 kdebug_sadb_key((struct sadb_ext *)sav->key_auth); 631 if (sav->key_enc != NULL) { 632 kdebug_sadb_key((struct sadb_ext *)sav->key_enc); [all …]
|
| H A D | key.h | 66 struct secasvar **sav); 93 extern void key_delsav(struct secasvar *sav);
|
| /xnu-8796.141.3/bsd/netinet/ |
| H A D | ip_input.c | 3665 struct secasvar *sav; in ip_forward() local 3693 sav = key_allocsa_policy(&saidx); in ip_forward() 3694 if (sav != NULL) { in ip_forward() 3696 if (sav->sah != NULL) { in ip_forward() 3697 ro = (struct route *)&sav->sah->sa_route; in ip_forward() 3708 key_freesav(sav, KEY_SADB_LOCKED); in ip_forward()
|