Lines Matching refs:hdr
477 const struct ikev2_hdr *hdr,
485 os_memcpy(data->i_spi, hdr->i_spi, IKEV2_SPI_LEN);
681 const struct ikev2_hdr *hdr,
690 &data->keys, 1, hdr, pl->encrypted,
708 /* Expect to receive IKE_SA_INIT: HDR, SAi1, KEi, Ni */
722 * HDR, SK {IDi, [CERT,] [CERTREQ,] [IDr,]
761 const struct ikev2_hdr *hdr;
769 if (wpabuf_len(buf) < sizeof(*hdr)) {
770 wpa_printf(MSG_INFO, "IKEV2: Too short frame to include HDR");
775 hdr = (const struct ikev2_hdr *) wpabuf_head(buf);
777 message_id = WPA_GET_BE32(hdr->message_id);
778 length = WPA_GET_BE32(hdr->length);
781 hdr->i_spi, IKEV2_SPI_LEN);
783 hdr->r_spi, IKEV2_SPI_LEN);
786 hdr->next_payload, hdr->version, hdr->exchange_type);
790 if (hdr->version != IKEV2_VERSION) {
791 wpa_printf(MSG_INFO, "IKEV2: Unsupported HDR version 0x%x "
792 "(expected 0x%x)", hdr->version, IKEV2_VERSION);
797 wpa_printf(MSG_INFO, "IKEV2: Invalid length (HDR: %lu != "
803 if (ikev2_validate_rx_state(data, hdr->exchange_type, message_id) < 0)
806 if ((hdr->flags & (IKEV2_HDR_INITIATOR | IKEV2_HDR_RESPONSE)) !=
809 hdr->flags);
814 if (os_memcmp(data->i_spi, hdr->i_spi, IKEV2_SPI_LEN) != 0) {
819 if (os_memcmp(data->r_spi, hdr->r_spi, IKEV2_SPI_LEN) != 0) {
826 pos = (const u8 *) (hdr + 1);
827 if (ikev2_parse_payloads(&pl, hdr->next_payload, pos, end) < 0)
832 if (ikev2_process_sa_init(data, hdr, &pl) < 0) {
843 if (ikev2_process_sa_auth(data, hdr, &pl) < 0) {
858 struct ikev2_hdr *hdr;
860 wpa_printf(MSG_DEBUG, "IKEV2: Adding HDR");
862 /* HDR - RFC 4306, Sect. 3.1 */
863 hdr = wpabuf_put(msg, sizeof(*hdr));
864 os_memcpy(hdr->i_spi, data->i_spi, IKEV2_SPI_LEN);
865 os_memcpy(hdr->r_spi, data->r_spi, IKEV2_SPI_LEN);
866 hdr->next_payload = next_payload;
867 hdr->version = IKEV2_VERSION;
868 hdr->exchange_type = exchange_type;
869 hdr->flags = IKEV2_HDR_RESPONSE;
870 WPA_PUT_BE32(hdr->message_id, message_id);
1123 /* build IKE_SA_INIT: HDR, SAr1, KEr, Nr, [CERTREQ], [SK{IDr}] */
1202 /* build IKE_SA_AUTH: HDR, SK {IDr, [CERT,] AUTH} */
1242 /* HDR, SK{N} */
1262 /* HDR, N */