Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Achou.Wang
accel-ppp
提交
2065efc2
A
accel-ppp
项目概览
Achou.Wang
/
accel-ppp
通知
6
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
accel-ppp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2065efc2
编写于
5月 28, 2012
作者:
K
Kozlov Dmitry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
auth_chap*: use previous challenge value in packet resend instead of generating new one
上级
0d19e3bb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
31 addition
and
21 deletion
+31
-21
accel-pppd/auth/auth_chap_md5.c
accel-pppd/auth/auth_chap_md5.c
+9
-7
accel-pppd/auth/auth_mschap_v1.c
accel-pppd/auth/auth_mschap_v1.c
+9
-7
accel-pppd/auth/auth_mschap_v2.c
accel-pppd/auth/auth_mschap_v2.c
+13
-7
未找到文件。
accel-pppd/auth/auth_chap_md5.c
浏览文件 @
2065efc2
...
...
@@ -79,7 +79,7 @@ struct chap_auth_data_t
int
started
:
1
;
};
static
void
chap_send_challenge
(
struct
chap_auth_data_t
*
ad
);
static
void
chap_send_challenge
(
struct
chap_auth_data_t
*
ad
,
int
new
);
static
void
chap_recv
(
struct
ppp_handler_t
*
h
);
static
void
chap_timeout_timer
(
struct
triton_timer_t
*
t
);
static
void
chap_restart_timer
(
struct
triton_timer_t
*
t
);
...
...
@@ -134,7 +134,7 @@ static int chap_start(struct ppp_t *ppp, struct auth_data_t *auth)
ppp_register_chan_handler
(
ppp
,
&
d
->
h
);
chap_send_challenge
(
d
);
chap_send_challenge
(
d
,
1
);
return
0
;
}
...
...
@@ -168,7 +168,7 @@ static void chap_timeout_timer(struct triton_timer_t *t)
ppp_auth_failed
(
d
->
ppp
,
NULL
);
}
else
{
--
d
->
id
;
chap_send_challenge
(
d
);
chap_send_challenge
(
d
,
0
);
}
}
...
...
@@ -176,7 +176,7 @@ static void chap_restart_timer(struct triton_timer_t *t)
{
struct
chap_auth_data_t
*
d
=
container_of
(
t
,
typeof
(
*
d
),
interval
);
chap_send_challenge
(
d
);
chap_send_challenge
(
d
,
1
);
}
static
int
lcp_send_conf_req
(
struct
ppp_t
*
ppp
,
struct
auth_data_t
*
d
,
uint8_t
*
ptr
)
...
...
@@ -224,7 +224,7 @@ static void chap_send_success(struct chap_auth_data_t *ad)
ppp_chan_send
(
ad
->
ppp
,
&
msg
,
ntohs
(
msg
.
hdr
.
len
)
+
2
);
}
static
void
chap_send_challenge
(
struct
chap_auth_data_t
*
ad
)
static
void
chap_send_challenge
(
struct
chap_auth_data_t
*
ad
,
int
new
)
{
struct
chap_challenge_t
msg
=
{
.
hdr
.
proto
=
htons
(
PPP_CHAP
),
...
...
@@ -234,7 +234,9 @@ static void chap_send_challenge(struct chap_auth_data_t *ad)
.
val_size
=
VALUE_SIZE
,
};
read
(
urandom_fd
,
ad
->
val
,
VALUE_SIZE
);
if
(
new
)
read
(
urandom_fd
,
ad
->
val
,
VALUE_SIZE
);
memcpy
(
msg
.
val
,
ad
->
val
,
VALUE_SIZE
);
if
(
conf_ppp_verbose
)
{
...
...
@@ -379,7 +381,7 @@ static int chap_restart(struct ppp_t *ppp, struct auth_data_t *auth)
{
struct
chap_auth_data_t
*
d
=
container_of
(
auth
,
typeof
(
*
d
),
auth
);
chap_send_challenge
(
d
);
chap_send_challenge
(
d
,
1
);
return
0
;
}
...
...
accel-pppd/auth/auth_mschap_v1.c
浏览文件 @
2065efc2
...
...
@@ -78,7 +78,7 @@ struct chap_auth_data_t
int
started
:
1
;
};
static
void
chap_send_challenge
(
struct
chap_auth_data_t
*
ad
);
static
void
chap_send_challenge
(
struct
chap_auth_data_t
*
ad
,
int
new
);
static
void
chap_recv
(
struct
ppp_handler_t
*
h
);
static
int
chap_check_response
(
struct
chap_auth_data_t
*
ad
,
struct
chap_response_t
*
res
,
const
char
*
name
);
static
void
chap_timeout_timer
(
struct
triton_timer_t
*
t
);
...
...
@@ -135,7 +135,7 @@ static int chap_start(struct ppp_t *ppp, struct auth_data_t *auth)
ppp_register_chan_handler
(
ppp
,
&
d
->
h
);
chap_send_challenge
(
d
);
chap_send_challenge
(
d
,
1
);
return
0
;
}
...
...
@@ -169,7 +169,7 @@ static void chap_timeout_timer(struct triton_timer_t *t)
ppp_auth_failed
(
d
->
ppp
,
NULL
);
}
else
{
--
d
->
id
;
chap_send_challenge
(
d
);
chap_send_challenge
(
d
,
0
);
}
}
...
...
@@ -177,7 +177,7 @@ static void chap_restart_timer(struct triton_timer_t *t)
{
struct
chap_auth_data_t
*
d
=
container_of
(
t
,
typeof
(
*
d
),
interval
);
chap_send_challenge
(
d
);
chap_send_challenge
(
d
,
1
);
}
static
int
lcp_send_conf_req
(
struct
ppp_t
*
ppp
,
struct
auth_data_t
*
d
,
uint8_t
*
ptr
)
...
...
@@ -227,7 +227,7 @@ static void chap_send_success(struct chap_auth_data_t *ad)
_free
(
hdr
);
}
static
void
chap_send_challenge
(
struct
chap_auth_data_t
*
ad
)
static
void
chap_send_challenge
(
struct
chap_auth_data_t
*
ad
,
int
new
)
{
struct
chap_challenge_t
msg
=
{
.
hdr
.
proto
=
htons
(
PPP_CHAP
),
...
...
@@ -237,7 +237,9 @@ static void chap_send_challenge(struct chap_auth_data_t *ad)
.
val_size
=
VALUE_SIZE
,
};
read
(
urandom_fd
,
ad
->
val
,
VALUE_SIZE
);
if
(
new
)
read
(
urandom_fd
,
ad
->
val
,
VALUE_SIZE
);
memcpy
(
msg
.
val
,
ad
->
val
,
VALUE_SIZE
);
if
(
conf_ppp_verbose
)
{
...
...
@@ -446,7 +448,7 @@ static int chap_restart(struct ppp_t *ppp, struct auth_data_t *auth)
{
struct
chap_auth_data_t
*
d
=
container_of
(
auth
,
typeof
(
*
d
),
auth
);
chap_send_challenge
(
d
);
chap_send_challenge
(
d
,
1
);
return
0
;
}
...
...
accel-pppd/auth/auth_mschap_v2.c
浏览文件 @
2065efc2
...
...
@@ -78,7 +78,7 @@ struct chap_auth_data_t
int
started
:
1
;
};
static
void
chap_send_challenge
(
struct
chap_auth_data_t
*
ad
);
static
void
chap_send_challenge
(
struct
chap_auth_data_t
*
ad
,
int
new
);
static
void
chap_recv
(
struct
ppp_handler_t
*
h
);
static
int
chap_check_response
(
struct
chap_auth_data_t
*
ad
,
struct
chap_response_t
*
msg
,
const
char
*
name
);
static
void
chap_timeout_timer
(
struct
triton_timer_t
*
t
);
...
...
@@ -136,7 +136,7 @@ static int chap_start(struct ppp_t *ppp, struct auth_data_t *auth)
ppp_register_chan_handler
(
ppp
,
&
d
->
h
);
chap_send_challenge
(
d
);
chap_send_challenge
(
d
,
1
);
return
0
;
}
...
...
@@ -170,7 +170,7 @@ static void chap_timeout_timer(struct triton_timer_t *t)
ppp_auth_failed
(
d
->
ppp
,
NULL
);
}
else
{
--
d
->
id
;
chap_send_challenge
(
d
);
chap_send_challenge
(
d
,
0
);
}
}
...
...
@@ -178,7 +178,7 @@ static void chap_restart_timer(struct triton_timer_t *t)
{
struct
chap_auth_data_t
*
d
=
container_of
(
t
,
typeof
(
*
d
),
interval
);
chap_send_challenge
(
d
);
chap_send_challenge
(
d
,
1
);
}
static
int
lcp_send_conf_req
(
struct
ppp_t
*
ppp
,
struct
auth_data_t
*
d
,
uint8_t
*
ptr
)
...
...
@@ -300,7 +300,7 @@ static int generate_response(struct chap_auth_data_t *ad, struct chap_response_t
return
0
;
}
static
void
chap_send_challenge
(
struct
chap_auth_data_t
*
ad
)
static
void
chap_send_challenge
(
struct
chap_auth_data_t
*
ad
,
int
new
)
{
struct
chap_challenge_t
msg
=
{
.
hdr
.
proto
=
htons
(
PPP_CHAP
),
...
...
@@ -310,7 +310,9 @@ static void chap_send_challenge(struct chap_auth_data_t *ad)
.
val_size
=
VALUE_SIZE
,
};
read
(
urandom_fd
,
ad
->
val
,
VALUE_SIZE
);
if
(
new
)
read
(
urandom_fd
,
ad
->
val
,
VALUE_SIZE
);
memcpy
(
msg
.
val
,
ad
->
val
,
VALUE_SIZE
);
if
(
conf_ppp_verbose
)
{
...
...
@@ -582,7 +584,7 @@ static int chap_restart(struct ppp_t *ppp, struct auth_data_t *auth)
{
struct
chap_auth_data_t
*
d
=
container_of
(
auth
,
typeof
(
*
d
),
auth
);
chap_send_challenge
(
d
);
chap_send_challenge
(
d
,
1
);
return
0
;
}
...
...
@@ -604,12 +606,16 @@ static void chap_recv(struct ppp_handler_t *h)
{
struct
chap_auth_data_t
*
d
=
container_of
(
h
,
typeof
(
*
d
),
h
);
struct
chap_hdr_t
*
hdr
=
(
struct
chap_hdr_t
*
)
d
->
ppp
->
buf
;
static
int
drop
=
1
;
if
(
d
->
ppp
->
buf_size
<
sizeof
(
*
hdr
)
||
ntohs
(
hdr
->
len
)
<
HDR_LEN
||
ntohs
(
hdr
->
len
)
<
d
->
ppp
->
buf_size
-
2
)
{
log_ppp_warn
(
"mschap-v2: short packet received
\n
"
);
return
;
}
if
(
drop
--
==
1
)
return
;
if
(
hdr
->
code
==
CHAP_RESPONSE
)
chap_recv_response
(
d
,
hdr
);
else
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录