#include "wpabuf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
const u8 * eap_hdr_validate(int vendor, EapType eap_type,
const struct wpabuf *msg, size_t *plen);
struct wpabuf * eap_msg_alloc(int vendor, EapType type, size_t payload_len,
u8 eap_get_id(const struct wpabuf *msg);
EapType eap_get_type(const struct wpabuf *msg);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_COMMON_H */
#ifndef EAP_DEFS_H
#define EAP_DEFS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* RFC 3748 - Extensible Authentication Protocol (EAP) */
#ifdef _MSC_VER
#define EAP_MSK_LEN 64
#define EAP_EMSK_LEN 64
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_DEFS_H */
#ifndef EAP_FAST_H
#define EAP_FAST_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define EAP_FAST_VERSION 1
#define EAP_FAST_KEY_LEN 64
#define EAP_FAST_SIMCK_LEN 40
int eap_fast_parse_tlv(struct eap_fast_tlv_parse *tlv,
int tlv_type, u8 *pos, int len);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_FAST_H */
#ifndef EAP_GPSK_COMMON_H
#define EAP_GPSK_COMMON_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define EAP_GPSK_OPCODE_GPSK_1 1
#define EAP_GPSK_OPCODE_GPSK_2 2
#define EAP_GPSK_OPCODE_GPSK_3 3
int eap_gpsk_compute_mic(const u8 *sk, size_t sk_len, int vendor,
int specifier, const u8 *data, size_t len, u8 *mic);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_GPSK_COMMON_H */
#ifndef EAP_IKEV2_COMMON_H
#define EAP_IKEV2_COMMON_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef CCNS_PL
/* incorrect bit order */
#define IKEV2_FLAGS_LENGTH_INCLUDED 0x01
int initiator, const struct wpabuf *msg,
const u8 *pos, const u8 *end);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_IKEV2_COMMON_H */
#ifndef EAP_PAX_COMMON_H
#define EAP_PAX_COMMON_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef _MSC_VER
#pragma pack(push, 1)
#endif /* _MSC_VER */
int eap_pax_initial_key_derivation(u8 mac_id, const u8 *ak, const u8 *e,
u8 *mk, u8 *ck, u8 *ick);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_PAX_COMMON_H */
#ifndef EAP_PEAP_COMMON_H
#define EAP_PEAP_COMMON_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void peap_prfplus(int version, const u8 *key, size_t key_len,
const char *label, const u8 *seed, size_t seed_len,
u8 *buf, size_t buf_len);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_PEAP_COMMON_H */
#ifndef EAP_PSK_COMMON_H
#define EAP_PSK_COMMON_H
+#ifdef __cplusplus
+extern "C" {
+#endif
#define EAP_PSK_RAND_LEN 16
#define EAP_PSK_MAC_LEN 16
int __must_check eap_psk_derive_keys(const u8 *kdk, const u8 *rand_p, u8 *tek,
u8 *msk, u8 *emsk);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_PSK_COMMON_H */
#include <openssl/evp.h>
#include <openssl/hmac.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* definition of a finite cyclic group
* TODO: support one based on a prime field
void H_Update(HMAC_CTX *, const u8 *, int);
void H_Final(HMAC_CTX *, u8 *);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_PWD_COMMON_H */
#ifndef EAP_SAKE_COMMON_H
#define EAP_SAKE_COMMON_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define EAP_SAKE_VERSION 2
#define EAP_SAKE_SUBTYPE_CHALLENGE 1
void eap_sake_add_attr(struct wpabuf *buf, u8 type, const u8 *data,
size_t len);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_SAKE_COMMON_H */
#ifndef EAP_SIM_COMMON_H
#define EAP_SIM_COMMON_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define EAP_SIM_NONCE_S_LEN 16
#define EAP_SIM_NONCE_MT_LEN 16
#define EAP_SIM_MAC_LEN 16
void eap_sim_report_notification(void *msg_ctx, int notification, int aka);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_SIM_COMMON_H */
#ifndef EAP_TLV_COMMON_H
#define EAP_TLV_COMMON_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* EAP-TLV TLVs (draft-josefsson-ppext-eap-tls-eap-10.txt) */
#define EAP_TLV_RESULT_TLV 3 /* Acknowledged Result */
#define EAP_TLV_NAK_TLV 4
#define EAP_TLV_ACTION_PROCESS_TLV 1
#define EAP_TLV_ACTION_NEGOTIATE_EAP 2
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_TLV_COMMON_H */
#ifndef EAP_TTLS_H
#define EAP_TTLS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct ttls_avp {
be32 avp_code;
be32 avp_length; /* 8-bit flags, 24-bit length;
#define EAP_TTLS_CHAP_CHALLENGE_LEN 16
#define EAP_TTLS_CHAP_PASSWORD_LEN 16
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_TTLS_H */
#ifndef EAP_WSC_COMMON_H
#define EAP_WSC_COMMON_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define EAP_VENDOR_TYPE_WSC 1
#define WSC_FLAGS_MF 0x01
struct wpabuf * eap_wsc_build_frag_ack(u8 id, u8 code);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_WSC_COMMON_H */
#include "eap_common/eap_defs.h"
#include "eap_peer/eap_methods.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct eap_sm;
struct wpa_config_blob;
struct wpabuf;
#endif /* IEEE8021X_EAPOL */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_H */
#ifndef EAP_CONFIG_H
#define EAP_CONFIG_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* struct eap_peer_config - EAP peer configuration/credentials
*/
struct wpa_config_blob *next;
};
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_CONFIG_H */
#include "eap_peer/eap.h"
#include "eap_common/eap_common.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* RFC 4137 - EAP Peer state machine */
typedef enum {
void eap_notify_pending(struct eap_sm *sm);
int eap_allowed_method(struct eap_sm *sm, int vendor, u32 method);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_I_H */
#include "eap_common/eap_defs.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
const struct eap_method * eap_peer_get_eap_method(int vendor, EapType method);
const struct eap_method * eap_peer_get_methods(size_t *count);
int eap_peer_tnc_register(void);
int eap_peer_pwd_register(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_METHODS_H */
#ifndef EAP_TLS_COMMON_H
#define EAP_TLS_COMMON_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* struct eap_ssl_data - TLS data for EAP methods
*/
int eap_peer_tls_phase2_nak(struct eap_method_type *types, size_t num_types,
struct eap_hdr *hdr, struct wpabuf **resp);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* EAP_TLS_COMMON_H */
#include "wpabuf.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Debugging function - conditional printf and hex dump. Driver wrappers can
* use these for debugging purposes. */
static inline void wpa_hexdump_buf(int level, const char *title,
const struct wpabuf *buf)
{
- wpa_hexdump(level, title, wpabuf_head(buf), wpabuf_len(buf));
+ wpa_hexdump(level, title, (const u8 *)wpabuf_head(buf), wpabuf_len(buf));
}
/**
static inline void wpa_hexdump_buf_key(int level, const char *title,
const struct wpabuf *buf)
{
- wpa_hexdump_key(level, title, wpabuf_head(buf), wpabuf_len(buf));
+ wpa_hexdump_key(level, title, (const u8 *)wpabuf_head(buf), wpabuf_len(buf));
}
/**
#define WPA_ASSERT(a) do { } while (0)
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* WPA_DEBUG_H */
#ifndef WPABUF_H
#define WPABUF_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Internal data structure for wpabuf. Please do not touch this directly from
* elsewhere. This is only defined in header file to allow inline functions
static inline const u8 * wpabuf_head_u8(const struct wpabuf *buf)
{
- return wpabuf_head(buf);
+ return (const u8 *)wpabuf_head(buf);
}
/**
static inline u8 * wpabuf_mhead_u8(struct wpabuf *buf)
{
- return wpabuf_mhead(buf);
+ return (u8 *)wpabuf_mhead(buf);
}
static inline void wpabuf_put_u8(struct wpabuf *buf, u8 data)
{
- u8 *pos = wpabuf_put(buf, 1);
+ u8 *pos = (u8 *)wpabuf_put(buf, 1);
*pos = data;
}
static inline void wpabuf_put_le16(struct wpabuf *buf, u16 data)
{
- u8 *pos = wpabuf_put(buf, 2);
+ u8 *pos = (u8 *)wpabuf_put(buf, 2);
WPA_PUT_LE16(pos, data);
}
static inline void wpabuf_put_le32(struct wpabuf *buf, u32 data)
{
- u8 *pos = wpabuf_put(buf, 4);
+ u8 *pos = (u8 *)wpabuf_put(buf, 4);
WPA_PUT_LE32(pos, data);
}
static inline void wpabuf_put_be16(struct wpabuf *buf, u16 data)
{
- u8 *pos = wpabuf_put(buf, 2);
+ u8 *pos = (u8 *)wpabuf_put(buf, 2);
WPA_PUT_BE16(pos, data);
}
static inline void wpabuf_put_be24(struct wpabuf *buf, u32 data)
{
- u8 *pos = wpabuf_put(buf, 3);
+ u8 *pos = (u8 *)wpabuf_put(buf, 3);
WPA_PUT_BE24(pos, data);
}
static inline void wpabuf_put_be32(struct wpabuf *buf, u32 data)
{
- u8 *pos = wpabuf_put(buf, 4);
+ u8 *pos = (u8 *)wpabuf_put(buf, 4);
WPA_PUT_BE32(pos, data);
}
wpabuf_put_data(dst, str, os_strlen(str));
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* WPABUF_H */