2 * IKEv2 initiator (RFC 4306) for EAP-IKEV2
3 * Copyright (c) 2007, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
18 #include "eap_common/ikev2_common.h"
20 struct ikev2_proposal_data {
29 struct ikev2_initiator_data {
30 enum { SA_INIT, SA_AUTH, CHILD_SA, IKEV2_DONE } state;
31 u8 i_spi[IKEV2_SPI_LEN];
32 u8 r_spi[IKEV2_SPI_LEN];
33 u8 i_nonce[IKEV2_NONCE_MAX_LEN];
35 u8 r_nonce[IKEV2_NONCE_MAX_LEN];
37 struct wpabuf *r_dh_public;
38 struct wpabuf *i_dh_private;
39 struct ikev2_proposal_data proposal;
40 const struct dh_group *dh;
41 struct ikev2_keys keys;
47 struct wpabuf *r_sign_msg;
48 struct wpabuf *i_sign_msg;
50 size_t shared_secret_len;
51 enum { PEER_AUTH_CERT, PEER_AUTH_SECRET } peer_auth;
55 const u8 * (*get_shared_secret)(void *ctx, const u8 *IDr,
56 size_t IDr_len, size_t *secret_len);
62 void ikev2_initiator_deinit(struct ikev2_initiator_data *data);
63 int ikev2_initiator_process(struct ikev2_initiator_data *data,
64 const struct wpabuf *buf);
65 struct wpabuf * ikev2_initiator_build(struct ikev2_initiator_data *data);