Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
720b3598
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
接近 2 年 前同步成功
通知
12
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看板
提交
720b3598
编写于
1月 21, 2000
作者:
B
Bodo Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Avoid integer overflow in entropy counter.
Slightly clarify the RAND_... documentation.
上级
60b52453
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
10 deletion
+14
-10
crypto/rand/md_rand.c
crypto/rand/md_rand.c
+3
-2
doc/crypto/RAND_add.pod
doc/crypto/RAND_add.pod
+1
-1
doc/crypto/RAND_bytes.pod
doc/crypto/RAND_bytes.pod
+10
-7
未找到文件。
crypto/rand/md_rand.c
浏览文件 @
720b3598
...
...
@@ -138,7 +138,7 @@ static int state_num=0,state_index=0;
static
unsigned
char
state
[
STATE_SIZE
+
MD_DIGEST_LENGTH
];
static
unsigned
char
md
[
MD_DIGEST_LENGTH
];
static
long
md_count
[
2
]
=
{
0
,
0
};
static
int
entropy
=
0
;
static
unsigned
entropy
=
0
;
const
char
*
RAND_version
=
"RAND"
OPENSSL_VERSION_PTEXT
;
...
...
@@ -286,7 +286,8 @@ static void ssleay_rand_add(const void *buf, int num, int add)
#ifndef THREADS
assert
(
md_c
[
1
]
==
md_count
[
1
]);
#endif
entropy
+=
add
;
if
(
entropy
<
ENTROPY_NEEDED
)
entropy
+=
add
;
}
static
void
ssleay_rand_seed
(
const
void
*
buf
,
int
num
)
...
...
doc/crypto/RAND_add.pod
浏览文件 @
720b3598
...
...
@@ -30,7 +30,7 @@ RAND_add() may be called with sensitive data such as user entered
passwords. The seed values cannot be recovered from the PRNG output.
OpenSSL makes sure that the PRNG state is unique for each thread. On
systems that provide C</dev/random>, the randomness device is used
systems that provide C</dev/
u
random>, the randomness device is used
to seed the PRNG transparently. However, on all other systems, the
application is responsible for seeding the PRNG by calling RAND_add()
or RAND_load_file(3).
...
...
doc/crypto/RAND_bytes.pod
浏览文件 @
720b3598
...
...
@@ -14,13 +14,16 @@ RAND_bytes, RAND_pseudo_bytes - Generate random data
=head1 DESCRIPTION
RAND_bytes() puts B<num> random bytes into B<buf>. An error occurs if
the PRNG has not been seeded with enough randomness.
RAND_pseudo_bytes() puts B<num> pseudo-random bytes into B<buf>. These
bytes are guaranteed to be unique, but not unpredictable. They can be
used for non-cryptographic purposes and for certain purposes in
cryptographic protocols, but not for key generation etc.
RAND_bytes() puts B<num> cryptographically strong pseudo-random bytes
into B<buf>. An error occurs if the PRNG has not been seeded with
enough randomness to ensure an unpredictable byte sequence.
RAND_pseudo_bytes() puts B<num> pseudo-random bytes into B<buf>.
Pseudo-random byte sequences generated by RAND_pseudo_bytes() will be
unique if they are of sufficient length, but are not necessarily
unpredictable. They can be used for non-cryptographic purposes and for
certain purposes in cryptographic protocols, but usually not for key
generation etc.
=head1 RETURN VALUES
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录