Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
d70fcb96
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
9
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d70fcb96
编写于
3月 12, 2011
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix warnings: signed/unisgned comparison, shadowing (in some cases global
functions such as rand() ).
上级
5e374d2e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
16 deletion
+16
-16
apps/s_client.c
apps/s_client.c
+2
-2
apps/srp.c
apps/srp.c
+5
-5
crypto/srp/srp_lib.c
crypto/srp/srp_lib.c
+2
-2
crypto/srp/srp_vfy.c
crypto/srp/srp_vfy.c
+3
-3
ssl/tls_srp.c
ssl/tls_srp.c
+4
-4
未找到文件。
apps/s_client.c
浏览文件 @
d70fcb96
...
...
@@ -403,11 +403,11 @@ static int SRP_Verify_N_and_g(const BIGNUM *N, const BIGNUM *g)
BIGNUM
*
r
=
BN_new
();
int
ret
=
g
!=
NULL
&&
N
!=
NULL
&&
bn_ctx
!=
NULL
&&
BN_is_odd
(
N
)
&&
BN_is_prime
(
N
,
SRP_NUMBER_ITERATIONS_FOR_PRIME
,
NULL
,
bn_ctx
,
NULL
)
&&
BN_is_prime
_ex
(
N
,
SRP_NUMBER_ITERATIONS_FOR_PRIME
,
bn_ctx
,
NULL
)
&&
p
!=
NULL
&&
BN_rshift1
(
p
,
N
)
&&
/* p = (N-1)/2 */
BN_is_prime
(
p
,
SRP_NUMBER_ITERATIONS_FOR_PRIME
,
NULL
,
bn_ctx
,
NULL
)
&&
BN_is_prime
_ex
(
p
,
SRP_NUMBER_ITERATIONS_FOR_PRIME
,
bn_ctx
,
NULL
)
&&
r
!=
NULL
&&
/* verify g^((N-1)/2) == -1 (mod N) */
...
...
apps/srp.c
浏览文件 @
d70fcb96
...
...
@@ -140,12 +140,12 @@ static int get_index(CA_DB *db, char* id, char type)
return
-
1
;
}
static
void
print_entry
(
CA_DB
*
db
,
BIO
*
bio
,
int
ind
e
x
,
int
verbose
,
char
*
s
)
static
void
print_entry
(
CA_DB
*
db
,
BIO
*
bio
,
int
indx
,
int
verbose
,
char
*
s
)
{
if
(
ind
e
x
>=
0
&&
verbose
)
if
(
indx
>=
0
&&
verbose
)
{
int
j
;
char
**
pp
=
sk_OPENSSL_PSTRING_value
(
db
->
db
->
data
,
ind
e
x
);
char
**
pp
=
sk_OPENSSL_PSTRING_value
(
db
->
db
->
data
,
indx
);
BIO_printf
(
bio
,
"%s
\"
%s
\"\n
"
,
s
,
pp
[
DB_srpid
]);
for
(
j
=
0
;
j
<
DB_NUMBER
;
j
++
)
{
...
...
@@ -696,10 +696,10 @@ bad:
}
else
{
char
**
pp
=
sk_OPENSSL_PSTRING_value
(
db
->
db
->
data
,
userindex
);
char
**
x
pp
=
sk_OPENSSL_PSTRING_value
(
db
->
db
->
data
,
userindex
);
BIO_printf
(
bio_err
,
"user
\"
%s
\"
revoked. t
\n
"
,
user
);
pp
[
DB_srptype
][
0
]
=
'R'
;
x
pp
[
DB_srptype
][
0
]
=
'R'
;
doupdatedb
=
1
;
}
...
...
crypto/srp/srp_lib.c
浏览文件 @
d70fcb96
...
...
@@ -326,7 +326,7 @@ int SRP_Verify_A_mod_N(BIGNUM *A, BIGNUM *N)
*/
char
*
SRP_check_known_gN_param
(
BIGNUM
*
g
,
BIGNUM
*
N
)
{
in
t
i
;
size_
t
i
;
if
((
g
==
NULL
)
||
(
N
==
NULL
))
return
0
;
...
...
@@ -343,7 +343,7 @@ char * SRP_check_known_gN_param(BIGNUM* g, BIGNUM* N)
SRP_gN
*
SRP_get_default_gN
(
const
char
*
id
)
{
in
t
i
;
size_
t
i
;
if
(
id
==
NULL
)
return
knowngN
;
...
...
crypto/srp/srp_vfy.c
浏览文件 @
d70fcb96
...
...
@@ -414,14 +414,14 @@ int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file)
else
if
(
pp
[
DB_srptype
][
0
]
==
DB_SRP_VALID
)
{
/* it is a user .... */
SRP_gN
*
gN
;
if
((
gN
=
SRP_get_gN_by_id
(
pp
[
DB_srpgN
],
SRP_gN_tab
))
!=
NULL
)
SRP_gN
*
l
gN
;
if
((
l
gN
=
SRP_get_gN_by_id
(
pp
[
DB_srpgN
],
SRP_gN_tab
))
!=
NULL
)
{
error_code
=
SRP_ERR_MEMORY
;
if
((
user_pwd
=
SRP_user_pwd_new
())
==
NULL
)
goto
err
;
SRP_user_pwd_set_gN
(
user_pwd
,
gN
->
g
,
gN
->
N
);
SRP_user_pwd_set_gN
(
user_pwd
,
lgN
->
g
,
l
gN
->
N
);
if
(
!
SRP_user_pwd_set_ids
(
user_pwd
,
pp
[
DB_srpid
],
pp
[
DB_srpinfo
]))
goto
err
;
...
...
ssl/tls_srp.c
浏览文件 @
d70fcb96
...
...
@@ -414,7 +414,7 @@ err:
int
SRP_Calc_A_param
(
SSL
*
s
)
{
unsigned
char
r
a
nd
[
SSL_MAX_MASTER_KEY_LENGTH
];
unsigned
char
rnd
[
SSL_MAX_MASTER_KEY_LENGTH
];
if
(
BN_num_bits
(
s
->
srp_ctx
.
N
)
<
s
->
srp_ctx
.
strength
)
return
0
;
...
...
@@ -423,10 +423,10 @@ int SRP_Calc_A_param(SSL *s)
!
SRP_check_known_gN_param
(
s
->
srp_ctx
.
g
,
s
->
srp_ctx
.
N
))
return
0
;
if
(
RAND_bytes
(
r
and
,
sizeof
(
ra
nd
))
<=
0
)
if
(
RAND_bytes
(
r
nd
,
sizeof
(
r
nd
))
<=
0
)
return
0
;
s
->
srp_ctx
.
a
=
BN_bin2bn
(
r
and
,
sizeof
(
ra
nd
),
s
->
srp_ctx
.
a
);
OPENSSL_cleanse
(
r
and
,
sizeof
(
ra
nd
));
s
->
srp_ctx
.
a
=
BN_bin2bn
(
r
nd
,
sizeof
(
r
nd
),
s
->
srp_ctx
.
a
);
OPENSSL_cleanse
(
r
nd
,
sizeof
(
r
nd
));
if
(
!
(
s
->
srp_ctx
.
A
=
SRP_Calc_A
(
s
->
srp_ctx
.
a
,
s
->
srp_ctx
.
N
,
s
->
srp_ctx
.
g
)))
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录