Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
7e951160
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
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看板
提交
7e951160
编写于
2月 04, 2011
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unneeded functions, make some functions and variables static.
上级
06b433ac
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
39 deletion
+23
-39
fips/fips.c
fips/fips.c
+21
-26
fips/fips_locl.h
fips/fips_locl.h
+0
-11
fips/utl/fips_lck.c
fips/utl/fips_lck.c
+1
-1
fips/utl/fips_mem.c
fips/utl/fips_mem.c
+1
-1
未找到文件。
fips/fips.c
浏览文件 @
7e951160
...
...
@@ -70,13 +70,24 @@
static
int
fips_selftest_fail
;
static
int
fips_mode
;
static
int
fips_started
=
0
;
static
const
void
*
fips_rand_check
;
static
int
fips_is_owning_thread
(
void
);
static
int
fips_set_owning_thread
(
void
);
static
int
fips_clear_owning_thread
(
void
);
static
unsigned
char
*
fips_signature_witness
(
void
);
static
void
fips_w_lock
(
void
)
{
CRYPTO_w_lock
(
CRYPTO_LOCK_FIPS
);
}
static
void
fips_w_unlock
(
void
)
{
CRYPTO_w_unlock
(
CRYPTO_LOCK_FIPS
);
}
static
void
fips_r_lock
(
void
)
{
CRYPTO_r_lock
(
CRYPTO_LOCK_FIPS
);
}
static
void
fips_r_unlock
(
void
)
{
CRYPTO_r_unlock
(
CRYPTO_LOCK_FIPS
);
}
static
void
fips_set_mode
(
int
onoff
)
{
int
owning_thread
=
fips_is_owning_thread
();
if
(
fips_
is_started
()
)
if
(
fips_
started
)
{
if
(
!
owning_thread
)
fips_w_lock
();
fips_mode
=
onoff
;
...
...
@@ -88,7 +99,7 @@ static void fips_set_rand_check(const void *rand_check)
{
int
owning_thread
=
fips_is_owning_thread
();
if
(
fips_
is_started
()
)
if
(
fips_
started
)
{
if
(
!
owning_thread
)
fips_w_lock
();
fips_rand_check
=
rand_check
;
...
...
@@ -101,7 +112,7 @@ int FIPS_mode(void)
int
ret
=
0
;
int
owning_thread
=
fips_is_owning_thread
();
if
(
fips_
is_started
()
)
if
(
fips_
started
)
{
if
(
!
owning_thread
)
fips_r_lock
();
ret
=
fips_mode
;
...
...
@@ -115,7 +126,7 @@ const void *FIPS_rand_check(void)
const
void
*
ret
=
0
;
int
owning_thread
=
fips_is_owning_thread
();
if
(
fips_
is_started
()
)
if
(
fips_
started
)
{
if
(
!
owning_thread
)
fips_r_lock
();
ret
=
fips_rand_check
;
...
...
@@ -127,7 +138,7 @@ const void *FIPS_rand_check(void)
int
FIPS_selftest_failed
(
void
)
{
int
ret
=
0
;
if
(
fips_
is_started
()
)
if
(
fips_
started
)
{
int
owning_thread
=
fips_is_owning_thread
();
...
...
@@ -256,7 +267,7 @@ int FIPS_mode_set(int onoff)
int
ret
=
0
;
fips_w_lock
();
fips_s
et_started
()
;
fips_s
tarted
=
1
;
fips_set_owning_thread
();
if
(
onoff
)
...
...
@@ -344,30 +355,14 @@ end:
return
ret
;
}
void
fips_w_lock
(
void
)
{
CRYPTO_w_lock
(
CRYPTO_LOCK_FIPS
);
}
void
fips_w_unlock
(
void
)
{
CRYPTO_w_unlock
(
CRYPTO_LOCK_FIPS
);
}
void
fips_r_lock
(
void
)
{
CRYPTO_r_lock
(
CRYPTO_LOCK_FIPS
);
}
void
fips_r_unlock
(
void
)
{
CRYPTO_r_unlock
(
CRYPTO_LOCK_FIPS
);
}
static
int
fips_started
=
0
;
static
CRYPTO_THREADID
fips_thread
;
static
int
fips_thread_set
=
0
;
void
fips_set_started
(
void
)
{
fips_started
=
1
;
}
int
fips_is_started
(
void
)
{
return
fips_started
;
}
int
fips_is_owning_thread
(
void
)
static
int
fips_is_owning_thread
(
void
)
{
int
ret
=
0
;
if
(
fips_
is_started
()
)
if
(
fips_
started
)
{
CRYPTO_r_lock
(
CRYPTO_LOCK_FIPS2
);
if
(
fips_thread_set
)
...
...
@@ -386,7 +381,7 @@ int fips_set_owning_thread(void)
{
int
ret
=
0
;
if
(
fips_
is_started
()
)
if
(
fips_
started
)
{
CRYPTO_w_lock
(
CRYPTO_LOCK_FIPS2
);
if
(
!
fips_thread_set
)
...
...
@@ -403,7 +398,7 @@ int fips_clear_owning_thread(void)
{
int
ret
=
0
;
if
(
fips_
is_started
()
)
if
(
fips_
started
)
{
CRYPTO_w_lock
(
CRYPTO_LOCK_FIPS2
);
if
(
fips_thread_set
)
...
...
fips/fips_locl.h
浏览文件 @
7e951160
...
...
@@ -53,17 +53,6 @@
extern
"C"
{
#endif
void
fips_w_lock
(
void
);
void
fips_w_unlock
(
void
);
void
fips_r_lock
(
void
);
void
fips_r_unlock
(
void
);
int
fips_is_started
(
void
);
void
fips_set_started
(
void
);
int
fips_is_owning_thread
(
void
);
int
fips_set_owning_thread
(
void
);
int
fips_clear_owning_thread
(
void
);
unsigned
char
*
fips_signature_witness
(
void
);
#define FIPS_MAX_CIPHER_TEST_SIZE 16
#ifdef __cplusplus
...
...
fips/utl/fips_lck.c
浏览文件 @
7e951160
...
...
@@ -58,7 +58,7 @@
/* FIPS locking callbacks */
void
(
*
fips_lck_cb
)(
int
mode
,
int
type
,
const
char
*
file
,
int
line
)
=
0
;
static
void
(
*
fips_lck_cb
)(
int
mode
,
int
type
,
const
char
*
file
,
int
line
)
=
0
;
void
FIPS_lock
(
int
mode
,
int
type
,
const
char
*
file
,
int
line
)
{
...
...
fips/utl/fips_mem.c
浏览文件 @
7e951160
...
...
@@ -72,7 +72,7 @@ static void fips_free_def(void *x)
static
void
*
(
*
fips_malloc_cb
)(
int
num
,
const
char
*
file
,
int
line
)
=
fips_malloc_def
;
void
(
*
fips_free_cb
)(
void
*
)
=
static
void
(
*
fips_free_cb
)(
void
*
)
=
fips_free_def
;
void
*
FIPS_malloc
(
int
num
,
const
char
*
file
,
int
line
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录