Lines Matching refs:hdr
483 const struct ikev2_hdr *hdr,
491 os_memcpy(data->i_spi, hdr->i_spi, IKEV2_SPI_LEN);
687 const struct ikev2_hdr *hdr,
696 &data->keys, 1, hdr, pl->encrypted,
714 /* Expect to receive IKE_SA_INIT: HDR, SAi1, KEi, Ni */
728 * HDR, SK {IDi, [CERT,] [CERTREQ,] [IDr,]
767 const struct ikev2_hdr *hdr;
775 if (wpabuf_len(buf) < sizeof(*hdr)) {
776 wpa_printf(MSG_INFO, "IKEV2: Too short frame to include HDR");
781 hdr = (const struct ikev2_hdr *) wpabuf_head(buf);
783 message_id = WPA_GET_BE32(hdr->message_id);
784 length = WPA_GET_BE32(hdr->length);
787 hdr->i_spi, IKEV2_SPI_LEN);
789 hdr->r_spi, IKEV2_SPI_LEN);
792 hdr->next_payload, hdr->version, hdr->exchange_type);
796 if (hdr->version != IKEV2_VERSION) {
797 wpa_printf(MSG_INFO, "IKEV2: Unsupported HDR version 0x%x "
798 "(expected 0x%x)", hdr->version, IKEV2_VERSION);
803 wpa_printf(MSG_INFO, "IKEV2: Invalid length (HDR: %lu != "
809 if (ikev2_validate_rx_state(data, hdr->exchange_type, message_id) < 0)
812 if ((hdr->flags & (IKEV2_HDR_INITIATOR | IKEV2_HDR_RESPONSE)) !=
815 hdr->flags);
820 if (os_memcmp(data->i_spi, hdr->i_spi, IKEV2_SPI_LEN) != 0) {
825 if (os_memcmp(data->r_spi, hdr->r_spi, IKEV2_SPI_LEN) != 0) {
832 pos = (const u8 *) (hdr + 1);
833 if (ikev2_parse_payloads(&pl, hdr->next_payload, pos, end) < 0)
838 if (ikev2_process_sa_init(data, hdr, &pl) < 0) {
849 if (ikev2_process_sa_auth(data, hdr, &pl) < 0) {
864 struct ikev2_hdr *hdr;
866 wpa_printf(MSG_DEBUG, "IKEV2: Adding HDR");
868 /* HDR - RFC 4306, Sect. 3.1 */
869 hdr = wpabuf_put(msg, sizeof(*hdr));
870 os_memcpy(hdr->i_spi, data->i_spi, IKEV2_SPI_LEN);
871 os_memcpy(hdr->r_spi, data->r_spi, IKEV2_SPI_LEN);
872 hdr->next_payload = next_payload;
873 hdr->version = IKEV2_VERSION;
874 hdr->exchange_type = exchange_type;
875 hdr->flags = IKEV2_HDR_RESPONSE;
876 WPA_PUT_BE32(hdr->message_id, message_id);
1129 /* build IKE_SA_INIT: HDR, SAr1, KEr, Nr, [CERTREQ], [SK{IDr}] */
1208 /* build IKE_SA_AUTH: HDR, SK {IDr, [CERT,] AUTH} */
1248 /* HDR, SK{N} */
1268 /* HDR, N */