version 1.1.1.3, 2019/10/22 13:49:55
|
version 1.1.1.4, 2021/03/17 00:39:23
|
Line 23
|
Line 23
|
static void EapRadiusProxyFinish(Link l, AuthData auth); |
static void EapRadiusProxyFinish(Link l, AuthData auth); |
static void EapRadiusSendMsg(void *ptr); |
static void EapRadiusSendMsg(void *ptr); |
static void EapRadiusSendMsgTimeout(void *ptr); |
static void EapRadiusSendMsgTimeout(void *ptr); |
static int EapSetCommand(Context ctx, int ac, char *av[], void *arg); | static int EapSetCommand(Context ctx, int ac, const char *const av[], const void *arg); |
|
|
/* Set menu options */ |
/* Set menu options */ |
enum { |
enum { |
Line 52
|
Line 52
|
EapSetCommand, NULL, 2, (void *) SET_YES }, |
EapSetCommand, NULL, 2, (void *) SET_YES }, |
{ "no [opt ...]", "Disable and deny option", |
{ "no [opt ...]", "Disable and deny option", |
EapSetCommand, NULL, 2, (void *) SET_NO }, |
EapSetCommand, NULL, 2, (void *) SET_NO }, |
{ NULL }, | { NULL, NULL, NULL, NULL, 0, NULL }, |
}; |
}; |
|
|
/* |
/* |
* INTERNAL VARIABLES |
* INTERNAL VARIABLES |
*/ |
*/ |
|
|
static struct confinfo gConfList[] = { | static const struct confinfo gConfList[] = { |
{ 0, EAP_CONF_RADIUS, "radius-proxy" }, |
{ 0, EAP_CONF_RADIUS, "radius-proxy" }, |
{ 1, EAP_CONF_MD5, "md5" }, |
{ 1, EAP_CONF_MD5, "md5" }, |
{ 0, 0, NULL }, |
{ 0, 0, NULL }, |
Line 225 EapSendNak(Link l, u_char id, u_char type)
|
Line 225 EapSendNak(Link l, u_char id, u_char type)
|
int i = 0; |
int i = 0; |
u_char nak_type = 0; |
u_char nak_type = 0; |
|
|
|
(void)type; |
for (i = 0; i < EAP_NUM_TYPES; i++) { |
for (i = 0; i < EAP_NUM_TYPES; i++) { |
if (eap->peer_types[i] != 0) { |
if (eap->peer_types[i] != 0) { |
nak_type = eap->peer_types[i]; |
nak_type = eap->peer_types[i]; |
Line 272 EapInput(Link l, AuthData auth, const u_char *pkt, u_s
|
Line 273 EapInput(Link l, AuthData auth, const u_char *pkt, u_s
|
Auth const a = &l->lcp.auth; |
Auth const a = &l->lcp.auth; |
EapInfo const eap = &a->eap; |
EapInfo const eap = &a->eap; |
int data_len = len - 1, i, acc_type; |
int data_len = len - 1, i, acc_type; |
u_char *data = NULL, type = 0; | const u_char *data = NULL; |
| u_char type = 0; |
|
|
if (pkt != NULL) { |
if (pkt != NULL) { |
data = data_len > 0 ? (u_char *) &pkt[1] : NULL; | data = data_len > 0 ? &pkt[1] : NULL; |
type = pkt[0]; |
type = pkt[0]; |
} |
} |
|
|
Line 393 static void
|
Line 395 static void
|
EapRadiusProxy(Link l, AuthData auth, const u_char *pkt, u_short len) |
EapRadiusProxy(Link l, AuthData auth, const u_char *pkt, u_short len) |
{ |
{ |
int data_len = len - 1; |
int data_len = len - 1; |
u_char *data = NULL, type = 0; | const u_char *data = NULL; |
| u_char type = 0; |
Auth const a = &l->lcp.auth; |
Auth const a = &l->lcp.auth; |
EapInfo const eap = &a->eap; |
EapInfo const eap = &a->eap; |
struct fsmheader lh; |
struct fsmheader lh; |
Line 401 EapRadiusProxy(Link l, AuthData auth, const u_char *pk
|
Line 404 EapRadiusProxy(Link l, AuthData auth, const u_char *pk
|
Log(LG_AUTH, ("[%s] EAP: Proxying packet to RADIUS", l->name)); |
Log(LG_AUTH, ("[%s] EAP: Proxying packet to RADIUS", l->name)); |
|
|
if (pkt != NULL) { |
if (pkt != NULL) { |
data = data_len > 0 ? (u_char *) &pkt[1] : NULL; | data = data_len > 0 ? &pkt[1] : NULL; |
type = pkt[0]; |
type = pkt[0]; |
} |
} |
|
|
Line 413 EapRadiusProxy(Link l, AuthData auth, const u_char *pk
|
Line 416 EapRadiusProxy(Link l, AuthData auth, const u_char *pk
|
data_len = AUTH_MAX_AUTHNAME - 1; |
data_len = AUTH_MAX_AUTHNAME - 1; |
} |
} |
memset(eap->identity, 0, sizeof(eap->identity)); |
memset(eap->identity, 0, sizeof(eap->identity)); |
strncpy(eap->identity, (char *) data, data_len); | strncpy(eap->identity, (const char *)data, data_len); |
Log(LG_AUTH, ("[%s] EAP: Identity: %s", l->name, eap->identity)); |
Log(LG_AUTH, ("[%s] EAP: Identity: %s", l->name, eap->identity)); |
} |
} |
|
|
Line 498 EapRadiusSendMsg(void *ptr)
|
Line 501 EapRadiusSendMsg(void *ptr)
|
Mbuf bp; |
Mbuf bp; |
Link l = (Link)ptr; |
Link l = (Link)ptr; |
Auth const a = &l->lcp.auth; |
Auth const a = &l->lcp.auth; |
FsmHeader const f = (FsmHeader)a->params.eapmsg; | FsmHeader const f = (FsmHeader)(void *)a->params.eapmsg; |
char buf[32]; |
char buf[32]; |
|
|
if (a->params.eapmsg_len > 4) { |
if (a->params.eapmsg_len > 4) { |
Line 555 EapIdentTimeout(void *ptr)
|
Line 558 EapIdentTimeout(void *ptr)
|
*/ |
*/ |
|
|
int |
int |
EapStat(Context ctx, int ac, char *av[], void *arg) | EapStat(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
EapInfo const eap = &ctx->lnk->lcp.auth.eap; |
EapInfo const eap = &ctx->lnk->lcp.auth.eap; |
|
|
|
(void)ac; |
|
(void)av; |
|
(void)arg; |
|
|
Printf("\tIdentity : %s\r\n", eap->identity); |
Printf("\tIdentity : %s\r\n", eap->identity); |
Printf("EAP options\r\n"); |
Printf("EAP options\r\n"); |
OptStat(ctx, &eap->conf.options, gConfList); |
OptStat(ctx, &eap->conf.options, gConfList); |
Line 647 EapTypeSupported(u_char type)
|
Line 654 EapTypeSupported(u_char type)
|
*/ |
*/ |
|
|
static int |
static int |
EapSetCommand(Context ctx, int ac, char *av[], void *arg) | EapSetCommand(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
EapInfo const eap = &ctx->lnk->lcp.auth.eap; |
EapInfo const eap = &ctx->lnk->lcp.auth.eap; |
|
|