eap_ikev2_common.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * EAP-IKEv2 definitions
  3. * Copyright (c) 2007, Jouni Malinen <j@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. #ifndef EAP_IKEV2_COMMON_H
  15. #define EAP_IKEV2_COMMON_H
  16. #ifdef CCNS_PL
  17. /* incorrect bit order */
  18. #define IKEV2_FLAGS_LENGTH_INCLUDED 0x01
  19. #define IKEV2_FLAGS_MORE_FRAGMENTS 0x02
  20. #define IKEV2_FLAGS_ICV_INCLUDED 0x04
  21. #else /* CCNS_PL */
  22. #define IKEV2_FLAGS_LENGTH_INCLUDED 0x80
  23. #define IKEV2_FLAGS_MORE_FRAGMENTS 0x40
  24. #define IKEV2_FLAGS_ICV_INCLUDED 0x20
  25. #endif /* CCNS_PL */
  26. #define IKEV2_FRAGMENT_SIZE 1400
  27. struct ikev2_keys;
  28. int eap_ikev2_derive_keymat(int prf, struct ikev2_keys *keys,
  29. const u8 *i_nonce, size_t i_nonce_len,
  30. const u8 *r_nonce, size_t r_nonce_len,
  31. u8 *keymat);
  32. struct wpabuf * eap_ikev2_build_frag_ack(u8 id, u8 code);
  33. int eap_ikev2_validate_icv(int integ_alg, struct ikev2_keys *keys,
  34. int initiator, const struct wpabuf *msg,
  35. const u8 *pos, const u8 *end);
  36. #endif /* EAP_IKEV2_COMMON_H */