Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
4e8cb45c
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,发现更多精彩内容 >>
提交
4e8cb45c
编写于
3月 01, 2016
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add string ctrl operations to TLS1 PRF, update documentation.
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
cd8e4dec
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
36 addition
and
2 deletion
+36
-2
crypto/kdf/tls1_prf.c
crypto/kdf/tls1_prf.c
+26
-1
doc/crypto/EVP_PKEY_TLS1_PRF.pod
doc/crypto/EVP_PKEY_TLS1_PRF.pod
+10
-1
未找到文件。
crypto/kdf/tls1_prf.c
浏览文件 @
4e8cb45c
...
...
@@ -138,6 +138,31 @@ static int pkey_tls1_prf_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
}
}
static
int
pkey_tls1_prf_ctrl_str
(
EVP_PKEY_CTX
*
ctx
,
const
char
*
type
,
const
char
*
value
)
{
if
(
value
==
NULL
)
return
0
;
if
(
strcmp
(
type
,
"md"
)
==
0
)
{
TLS1_PRF_PKEY_CTX
*
kctx
=
ctx
->
data
;
const
EVP_MD
*
md
=
EVP_get_digestbyname
(
value
);
if
(
md
==
NULL
)
return
0
;
kctx
->
md
=
md
;
return
1
;
}
if
(
strcmp
(
type
,
"secret"
)
==
0
)
return
EVP_PKEY_CTX_str2ctrl
(
ctx
,
EVP_PKEY_CTRL_TLS_SECRET
,
value
);
if
(
strcmp
(
type
,
"hexsecret"
)
==
0
)
return
EVP_PKEY_CTX_hex2ctrl
(
ctx
,
EVP_PKEY_CTRL_TLS_SECRET
,
value
);
if
(
strcmp
(
type
,
"seed"
)
==
0
)
return
EVP_PKEY_CTX_str2ctrl
(
ctx
,
EVP_PKEY_CTRL_TLS_SEED
,
value
);
if
(
strcmp
(
type
,
"hexseed"
)
==
0
)
return
EVP_PKEY_CTX_hex2ctrl
(
ctx
,
EVP_PKEY_CTRL_TLS_SEED
,
value
);
return
-
2
;
}
static
int
pkey_tls1_prf_derive
(
EVP_PKEY_CTX
*
ctx
,
unsigned
char
*
key
,
size_t
*
keylen
)
{
...
...
@@ -176,7 +201,7 @@ const EVP_PKEY_METHOD tls1_prf_pkey_meth = {
0
,
pkey_tls1_prf_derive
,
pkey_tls1_prf_ctrl
,
0
pkey_tls1_prf_ctrl_str
};
static
int
tls1_prf_P_hash
(
const
EVP_MD
*
md
,
...
...
doc/crypto/EVP_PKEY_TLS1_PRF.pod
浏览文件 @
4e8cb45c
...
...
@@ -33,6 +33,14 @@ and any seed is reset.
EVP_PKEY_CTX_add1_tls1_prf_seed() sets the seed to B<seedlen> bytes of B<seed>.
If a seed is already set it is appended to the existing value.
=head1 STRING CTRLS
The TLS PRF also supports string based control operations using
EVP_PKEY_CTX_ctrl_str(). The B<type> parameters "secret" and "seed" use
the supplied B<value> parameter as a secret or seed value. The names
"hexsecret" and "hexseed" are similar except they take a hex string which
is converted to binary.
=head1 NOTES
All these functions are implemented as macros.
...
...
@@ -82,6 +90,7 @@ and seed value "seed":
=head1 SEE ALSO
L<EVP_PKEY_CTX_new(3)>,
L<EVP_PKEY_derive(3)>,
L<EVP_PKEY_CTX_ctrl(3)>,
L<EVP_PKEY_derive(3)>
=cut
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录