summaryrefslogtreecommitdiff
path: root/src/libcharon/plugins/eap_mschapv2
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcharon/plugins/eap_mschapv2')
-rw-r--r--src/libcharon/plugins/eap_mschapv2/Makefile.in27
-rw-r--r--src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c58
2 files changed, 50 insertions, 35 deletions
diff --git a/src/libcharon/plugins/eap_mschapv2/Makefile.in b/src/libcharon/plugins/eap_mschapv2/Makefile.in
index d96343a5c..c3b31cd9a 100644
--- a/src/libcharon/plugins/eap_mschapv2/Makefile.in
+++ b/src/libcharon/plugins/eap_mschapv2/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
@SET_MAKE@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -79,8 +89,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = src/libcharon/plugins/eap_mschapv2
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/config/libtool.m4 \
$(top_srcdir)/m4/config/ltoptions.m4 \
@@ -94,6 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/config/libtool.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -203,12 +212,14 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
+ATOMICLIB = @ATOMICLIB@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -258,6 +269,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@@ -292,6 +304,7 @@ PTHREADLIB = @PTHREADLIB@
PYTHON = @PYTHON@
PYTHONEGGINSTALLDIR = @PYTHONEGGINSTALLDIR@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PACKAGE_VERSION = @PYTHON_PACKAGE_VERSION@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
@@ -403,6 +416,7 @@ random_device = @random_device@
resolv_conf = @resolv_conf@
routing_table = @routing_table@
routing_table_prio = @routing_table_prio@
+runstatedir = @runstatedir@
s_plugins = @s_plugins@
sbindir = @sbindir@
scepclient_plugins = @scepclient_plugins@
@@ -461,7 +475,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libcharon/plugins/eap_mschapv2/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/libcharon/plugins/eap_mschapv2/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -775,6 +788,8 @@ uninstall-am: uninstall-pluginLTLIBRARIES
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-pluginLTLIBRARIES
+.PRECIOUS: Makefile
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c b/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c
index 16978f486..12f61f7f8 100644
--- a/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c
+++ b/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c
@@ -70,12 +70,12 @@ struct private_eap_mschapv2_t
/**
* EAP message identifier
*/
- u_int8_t identifier;
+ uint8_t identifier;
/**
* MS-CHAPv2-ID (session ID, increases with each retry)
*/
- u_int8_t mschapv2id;
+ uint8_t mschapv2id;
/**
* Number of retries
@@ -179,21 +179,21 @@ typedef struct eap_mschapv2_response_t eap_mschapv2_response_t;
struct eap_mschapv2_header_t
{
/** EAP code (REQUEST/RESPONSE) */
- u_int8_t code;
+ uint8_t code;
/** unique message identifier */
- u_int8_t identifier;
+ uint8_t identifier;
/** length of whole message */
- u_int16_t length;
+ uint16_t length;
/** EAP type */
- u_int8_t type;
+ uint8_t type;
/** MS-CHAPv2 OpCode */
- u_int8_t opcode;
+ uint8_t opcode;
/** MS-CHAPv2-ID (equals identifier) */
- u_int8_t ms_chapv2_id;
+ uint8_t ms_chapv2_id;
/** MS-Length (defined as length - 5) */
- u_int16_t ms_length;
+ uint16_t ms_length;
/** packet data (determined by OpCode) */
- u_int8_t data[];
+ uint8_t data[];
}__attribute__((__packed__));
/**
@@ -202,11 +202,11 @@ struct eap_mschapv2_header_t
struct eap_mschapv2_challenge_t
{
/** Value-Size */
- u_int8_t value_size;
+ uint8_t value_size;
/** Challenge */
- u_int8_t challenge[CHALLENGE_LEN];
+ uint8_t challenge[CHALLENGE_LEN];
/** Name */
- u_int8_t name[];
+ uint8_t name[];
}__attribute__((__packed__));
/**
@@ -215,21 +215,21 @@ struct eap_mschapv2_challenge_t
struct eap_mschapv2_response_t
{
/** Value-Size */
- u_int8_t value_size;
+ uint8_t value_size;
/** Response */
struct
{
/* Peer-Challenge*/
- u_int8_t peer_challenge[CHALLENGE_LEN];
+ uint8_t peer_challenge[CHALLENGE_LEN];
/* Reserved (=zero) */
- u_int8_t peer_reserved[8];
+ uint8_t peer_reserved[8];
/* NT-Response */
- u_int8_t nt_response[24];
+ uint8_t nt_response[24];
/* Flags (=zero) */
- u_int8_t flags;
+ uint8_t flags;
} response;
/** Name */
- u_int8_t name[];
+ uint8_t name[];
}__attribute__((__packed__));
/**
@@ -597,10 +597,10 @@ static chunk_t extract_username(chunk_t id)
/**
* Set the ms_length field using aligned write
*/
-static void set_ms_length(eap_mschapv2_header_t *eap, u_int16_t len)
+static void set_ms_length(eap_mschapv2_header_t *eap, uint16_t len)
{
len = htons(len - 5);
- memcpy(&eap->ms_length, &len, sizeof(u_int16_t));
+ memcpy(&eap->ms_length, &len, sizeof(uint16_t));
}
METHOD(eap_method_t, initiate_peer, status_t,
@@ -617,7 +617,7 @@ METHOD(eap_method_t, initiate_server, status_t,
eap_mschapv2_header_t *eap;
eap_mschapv2_challenge_t *cha;
const char *name = MSCHAPV2_HOST_NAME;
- u_int16_t len = CHALLENGE_PAYLOAD_LEN + sizeof(MSCHAPV2_HOST_NAME) - 1;
+ uint16_t len = CHALLENGE_PAYLOAD_LEN + sizeof(MSCHAPV2_HOST_NAME) - 1;
rng = lib->crypto->create_rng(lib->crypto, RNG_WEAK);
if (!rng || !rng->allocate_bytes(rng, CHALLENGE_LEN, &this->challenge))
@@ -690,7 +690,7 @@ static status_t process_peer_challenge(private_eap_mschapv2_t *this,
eap_mschapv2_challenge_t *cha;
eap_mschapv2_response_t *res;
chunk_t data, peer_challenge, userid, username, nt_hash;
- u_int16_t len = RESPONSE_PAYLOAD_LEN;
+ uint16_t len = RESPONSE_PAYLOAD_LEN;
data = in->get_data(in);
eap = (eap_mschapv2_header_t*)data.ptr;
@@ -779,7 +779,7 @@ static status_t process_peer_success(private_eap_mschapv2_t *this,
chunk_t data, auth_string = chunk_empty;
char *message, *token, *msg = NULL;
int message_len;
- u_int16_t len = SHORT_HEADER_LEN;
+ uint16_t len = SHORT_HEADER_LEN;
data = in->get_data(in);
eap = (eap_mschapv2_header_t*)data.ptr;
@@ -1011,7 +1011,7 @@ static status_t process_server_retry(private_eap_mschapv2_t *this,
rng_t *rng;
chunk_t hex;
char msg[FAILURE_MESSAGE_LEN];
- u_int16_t len = HEADER_LEN + FAILURE_MESSAGE_LEN - 1; /* no null byte */
+ uint16_t len = HEADER_LEN + FAILURE_MESSAGE_LEN - 1; /* no null byte */
if (++this->retries > MAX_RETRIES)
{
@@ -1127,7 +1127,7 @@ static status_t process_server_response(private_eap_mschapv2_t *this,
{
chunk_t hex;
char msg[AUTH_RESPONSE_LEN + sizeof(SUCCESS_MESSAGE)];
- u_int16_t len = HEADER_LEN + AUTH_RESPONSE_LEN + sizeof(SUCCESS_MESSAGE);
+ uint16_t len = HEADER_LEN + AUTH_RESPONSE_LEN + sizeof(SUCCESS_MESSAGE);
eap = alloca(len);
eap->code = EAP_REQUEST;
@@ -1213,7 +1213,7 @@ METHOD(eap_method_t, process_server, status_t,
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_mschapv2_t *this, u_int32_t *vendor)
+ private_eap_mschapv2_t *this, uint32_t *vendor)
{
*vendor = 0;
return EAP_MSCHAPV2;
@@ -1230,14 +1230,14 @@ METHOD(eap_method_t, get_msk, status_t,
return FAILED;
}
-METHOD(eap_method_t, get_identifier, u_int8_t,
+METHOD(eap_method_t, get_identifier, uint8_t,
private_eap_mschapv2_t *this)
{
return this->identifier;
}
METHOD(eap_method_t, set_identifier, void,
- private_eap_mschapv2_t *this, u_int8_t identifier)
+ private_eap_mschapv2_t *this, uint8_t identifier)
{
this->identifier = identifier;
}