xref: /freebsd/contrib/wpa/src/eap_common/eap_ikev2_common.h (revision cdc58367265a2bd6e8f913db2bdc591699ee229f)
1 /*
2  * EAP-IKEv2 definitions
3  * Copyright (c) 2007, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef EAP_IKEV2_COMMON_H
10 #define EAP_IKEV2_COMMON_H
11 
12 #ifdef CCNS_PL
13 /* incorrect bit order */
14 #define IKEV2_FLAGS_LENGTH_INCLUDED 0x01
15 #define IKEV2_FLAGS_MORE_FRAGMENTS 0x02
16 #define IKEV2_FLAGS_ICV_INCLUDED 0x04
17 #else /* CCNS_PL */
18 #define IKEV2_FLAGS_LENGTH_INCLUDED 0x80
19 #define IKEV2_FLAGS_MORE_FRAGMENTS 0x40
20 #define IKEV2_FLAGS_ICV_INCLUDED 0x20
21 #endif /* CCNS_PL */
22 
23 #define IKEV2_FRAGMENT_SIZE 1400
24 
25 struct ikev2_keys;
26 
27 int eap_ikev2_derive_keymat(int prf, struct ikev2_keys *keys,
28 			    const u8 *i_nonce, size_t i_nonce_len,
29 			    const u8 *r_nonce, size_t r_nonce_len,
30 			    u8 *keymat);
31 struct wpabuf * eap_ikev2_build_frag_ack(u8 id, u8 code);
32 int eap_ikev2_validate_icv(int integ_alg, struct ikev2_keys *keys,
33 			   int initiator, const struct wpabuf *msg,
34 			   const u8 *pos, const u8 *end);
35 
36 #endif /* EAP_IKEV2_COMMON_H */
37