Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
badb910f
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,发现更多精彩内容 >>
提交
badb910f
编写于
7月 24, 2001
作者:
B
Bodo Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Avoid race condition.
Submitted by: Travis Vitek <vitek@roguewave.com>
上级
3866752e
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
7 addition
and
4 deletion
+7
-4
CHANGES
CHANGES
+5
-0
crypto/rand/md_rand.c
crypto/rand/md_rand.c
+2
-4
未找到文件。
CHANGES
浏览文件 @
badb910f
...
@@ -12,6 +12,11 @@
...
@@ -12,6 +12,11 @@
*) applies to 0.9.6a/0.9.6b and 0.9.7
*) applies to 0.9.6a/0.9.6b and 0.9.7
+) applies to 0.9.7 only
+) applies to 0.9.7 only
*) In crypto/rand/md_rand.c, set 'locking_thread' to current thread's ID
*before* setting the 'crypto_lock_rand' flag. The previous code had
a race condition if 0 is a valid thread ID.
[Travis Vitek <vitek@roguewave.com>]
+) Cleanup of EVP macros.
+) Cleanup of EVP macros.
[Ben Laurie]
[Ben Laurie]
...
...
crypto/rand/md_rand.c
浏览文件 @
badb910f
...
@@ -361,8 +361,8 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
...
@@ -361,8 +361,8 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
CRYPTO_w_lock
(
CRYPTO_LOCK_RAND
);
CRYPTO_w_lock
(
CRYPTO_LOCK_RAND
);
/* prevent ssleay_rand_bytes() from trying to obtain the lock again */
/* prevent ssleay_rand_bytes() from trying to obtain the lock again */
crypto_lock_rand
=
1
;
locking_thread
=
CRYPTO_thread_id
();
locking_thread
=
CRYPTO_thread_id
();
crypto_lock_rand
=
1
;
if
(
!
initialized
)
if
(
!
initialized
)
{
{
...
@@ -435,7 +435,6 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
...
@@ -435,7 +435,6 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
/* before unlocking, we must clear 'crypto_lock_rand' */
/* before unlocking, we must clear 'crypto_lock_rand' */
crypto_lock_rand
=
0
;
crypto_lock_rand
=
0
;
locking_thread
=
0
;
CRYPTO_w_unlock
(
CRYPTO_LOCK_RAND
);
CRYPTO_w_unlock
(
CRYPTO_LOCK_RAND
);
while
(
num
>
0
)
while
(
num
>
0
)
...
@@ -528,8 +527,8 @@ static int ssleay_rand_status(void)
...
@@ -528,8 +527,8 @@ static int ssleay_rand_status(void)
CRYPTO_w_lock
(
CRYPTO_LOCK_RAND
);
CRYPTO_w_lock
(
CRYPTO_LOCK_RAND
);
/* prevent ssleay_rand_bytes() from trying to obtain the lock again */
/* prevent ssleay_rand_bytes() from trying to obtain the lock again */
crypto_lock_rand
=
1
;
locking_thread
=
CRYPTO_thread_id
();
locking_thread
=
CRYPTO_thread_id
();
crypto_lock_rand
=
1
;
}
}
if
(
!
initialized
)
if
(
!
initialized
)
...
@@ -544,7 +543,6 @@ static int ssleay_rand_status(void)
...
@@ -544,7 +543,6 @@ static int ssleay_rand_status(void)
{
{
/* before unlocking, we must clear 'crypto_lock_rand' */
/* before unlocking, we must clear 'crypto_lock_rand' */
crypto_lock_rand
=
0
;
crypto_lock_rand
=
0
;
locking_thread
=
0
;
CRYPTO_w_unlock
(
CRYPTO_LOCK_RAND
);
CRYPTO_w_unlock
(
CRYPTO_LOCK_RAND
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录