Lines Matching refs:sa

131 	struct sa_list *sa;  in esp_print_decrypt_buffer_by_ikev2()  local
140 for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) { in esp_print_decrypt_buffer_by_ikev2()
141 if (sa->spi == 0 in esp_print_decrypt_buffer_by_ikev2()
142 && initiator == sa->initiator in esp_print_decrypt_buffer_by_ikev2()
143 && memcmp(spii, sa->spii, 8) == 0 in esp_print_decrypt_buffer_by_ikev2()
144 && memcmp(spir, sa->spir, 8) == 0) in esp_print_decrypt_buffer_by_ikev2()
148 if(sa == NULL) return 0; in esp_print_decrypt_buffer_by_ikev2()
149 if(sa->evp == NULL) return 0; in esp_print_decrypt_buffer_by_ikev2()
155 end = end - sa->authlen; in esp_print_decrypt_buffer_by_ikev2()
157 buf = buf + sa->ivlen; in esp_print_decrypt_buffer_by_ikev2()
163 if (EVP_CipherInit(&ctx, sa->evp, sa->secret, NULL, 0) < 0) in esp_print_decrypt_buffer_by_ikev2()
178 struct sa_list *sa, int sa_def) in esp_print_addsa() argument
188 *nsa = *sa; in esp_print_addsa()
255 char *decode, struct sa_list *sa) in espprint_decode_encalgo() argument
285 sa->evp = NULL; in espprint_decode_encalgo()
286 sa->authlen = 0; in espprint_decode_encalgo()
287 sa->ivlen = 0; in espprint_decode_encalgo()
291 sa->evp = evp; in espprint_decode_encalgo()
292 sa->authlen = authlen; in espprint_decode_encalgo()
293 sa->ivlen = EVP_CIPHER_iv_length(evp); in espprint_decode_encalgo()
300 sa->secretlen = espprint_decode_hex(ndo, sa->secret, sizeof(sa->secret), colon); in espprint_decode_encalgo()
301 if(sa->secretlen == 0) return 0; in espprint_decode_encalgo()
305 if (i < sizeof(sa->secret)) { in espprint_decode_encalgo()
306 memcpy(sa->secret, colon, i); in espprint_decode_encalgo()
307 sa->secretlen = i; in espprint_decode_encalgo()
309 memcpy(sa->secret, colon, sizeof(sa->secret)); in espprint_decode_encalgo()
310 sa->secretlen = sizeof(sa->secret); in espprint_decode_encalgo()
324 char *decode, struct sa_list *sa) in espprint_decode_authalgo() argument
337 sa->authlen = 12; in espprint_decode_authalgo()
568 struct sa_list *sa = NULL; in esp_print() local
630 for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) { in esp_print()
631 if (sa->spi == EXTRACT_32BITS(&esp->esp_spi) && in esp_print()
632 sa->daddr_version == 6 && in esp_print()
633 UNALIGNED_MEMCMP(&sa->daddr.in6, &ip6->ip6_dst, in esp_print()
647 for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) { in esp_print()
648 if (sa->spi == EXTRACT_32BITS(&esp->esp_spi) && in esp_print()
649 sa->daddr_version == 4 && in esp_print()
650 UNALIGNED_MEMCMP(&sa->daddr.in4, &ip->ip_dst, in esp_print()
663 if (sa == NULL) in esp_print()
664 sa = ndo->ndo_sa_default; in esp_print()
667 if (sa == NULL) in esp_print()
679 ivlen = sa->ivlen; in esp_print()
680 secret = sa->secret; in esp_print()
681 ep = ep - sa->authlen; in esp_print()
683 if (sa->evp) { in esp_print()
685 if (EVP_CipherInit(&ctx, sa->evp, secret, NULL, 0) < 0) in esp_print()