Lines Matching refs:sa
157 struct sa_list *sa; in esp_print_decrypt_buffer_by_ikev2() local
166 for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) { in esp_print_decrypt_buffer_by_ikev2()
167 if (sa->spi == 0 in esp_print_decrypt_buffer_by_ikev2()
168 && initiator == sa->initiator in esp_print_decrypt_buffer_by_ikev2()
169 && memcmp(spii, sa->spii, 8) == 0 in esp_print_decrypt_buffer_by_ikev2()
170 && memcmp(spir, sa->spir, 8) == 0) in esp_print_decrypt_buffer_by_ikev2()
174 if(sa == NULL) return 0; in esp_print_decrypt_buffer_by_ikev2()
175 if(sa->evp == NULL) return 0; in esp_print_decrypt_buffer_by_ikev2()
181 end = end - sa->authlen; in esp_print_decrypt_buffer_by_ikev2()
183 buf = buf + sa->ivlen; in esp_print_decrypt_buffer_by_ikev2()
191 if (EVP_CipherInit(ctx, sa->evp, sa->secret, NULL, 0) < 0) in esp_print_decrypt_buffer_by_ikev2()
206 struct sa_list *sa, int sa_def) in esp_print_addsa() argument
216 *nsa = *sa; in esp_print_addsa()
283 char *decode, struct sa_list *sa) in espprint_decode_encalgo() argument
313 sa->evp = NULL; in espprint_decode_encalgo()
314 sa->authlen = 0; in espprint_decode_encalgo()
315 sa->ivlen = 0; in espprint_decode_encalgo()
319 sa->evp = evp; in espprint_decode_encalgo()
320 sa->authlen = authlen; in espprint_decode_encalgo()
321 sa->ivlen = EVP_CIPHER_iv_length(evp); in espprint_decode_encalgo()
328 sa->secretlen = espprint_decode_hex(ndo, sa->secret, sizeof(sa->secret), colon); in espprint_decode_encalgo()
329 if(sa->secretlen == 0) return 0; in espprint_decode_encalgo()
333 if (i < sizeof(sa->secret)) { in espprint_decode_encalgo()
334 memcpy(sa->secret, colon, i); in espprint_decode_encalgo()
335 sa->secretlen = i; in espprint_decode_encalgo()
337 memcpy(sa->secret, colon, sizeof(sa->secret)); in espprint_decode_encalgo()
338 sa->secretlen = sizeof(sa->secret); in espprint_decode_encalgo()
352 char *decode, struct sa_list *sa) in espprint_decode_authalgo() argument
365 sa->authlen = 12; in espprint_decode_authalgo()
600 struct sa_list *sa = NULL; in esp_print() local
659 for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) { in esp_print()
660 if (sa->spi == EXTRACT_32BITS(&esp->esp_spi) && in esp_print()
661 sa->daddr_version == 6 && in esp_print()
662 UNALIGNED_MEMCMP(&sa->daddr.in6, &ip6->ip6_dst, in esp_print()
675 for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) { in esp_print()
676 if (sa->spi == EXTRACT_32BITS(&esp->esp_spi) && in esp_print()
677 sa->daddr_version == 4 && in esp_print()
678 UNALIGNED_MEMCMP(&sa->daddr.in4, &ip->ip_dst, in esp_print()
691 if (sa == NULL) in esp_print()
692 sa = ndo->ndo_sa_default; in esp_print()
695 if (sa == NULL) in esp_print()
707 ivlen = sa->ivlen; in esp_print()
708 secret = sa->secret; in esp_print()
709 ep = ep - sa->authlen; in esp_print()
711 if (sa->evp) { in esp_print()
714 if (EVP_CipherInit(ctx, sa->evp, secret, NULL, 0) < 0) in esp_print()