Home | History | Annotate | Download | only in eap_common
      1 /*
      2  * EAP-IKEv2 definitions
      3  * Copyright (c) 2007, Jouni Malinen <j (at) w1.fi>
      4  *
      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.
      8  *
      9  * Alternatively, this software may be distributed under the terms of BSD
     10  * license.
     11  *
     12  * See README and COPYING for more details.
     13  */
     14 
     15 #ifndef EAP_IKEV2_COMMON_H
     16 #define EAP_IKEV2_COMMON_H
     17 
     18 #ifdef CCNS_PL
     19 /* incorrect bit order */
     20 #define IKEV2_FLAGS_LENGTH_INCLUDED 0x01
     21 #define IKEV2_FLAGS_MORE_FRAGMENTS 0x02
     22 #define IKEV2_FLAGS_ICV_INCLUDED 0x04
     23 #else /* CCNS_PL */
     24 #define IKEV2_FLAGS_LENGTH_INCLUDED 0x80
     25 #define IKEV2_FLAGS_MORE_FRAGMENTS 0x40
     26 #define IKEV2_FLAGS_ICV_INCLUDED 0x20
     27 #endif /* CCNS_PL */
     28 
     29 #define IKEV2_FRAGMENT_SIZE 1400
     30 
     31 struct ikev2_keys;
     32 
     33 int eap_ikev2_derive_keymat(int prf, struct ikev2_keys *keys,
     34 			    const u8 *i_nonce, size_t i_nonce_len,
     35 			    const u8 *r_nonce, size_t r_nonce_len,
     36 			    u8 *keymat);
     37 struct wpabuf * eap_ikev2_build_frag_ack(u8 id, u8 code);
     38 int eap_ikev2_validate_icv(int integ_alg, struct ikev2_keys *keys,
     39 			   int initiator, const struct wpabuf *msg,
     40 			   const u8 *pos, const u8 *end);
     41 
     42 #endif /* EAP_IKEV2_COMMON_H */
     43