Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
965a1cb9
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
965a1cb9
编写于
4月 23, 2005
作者:
N
Nils Larsch
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change prototype of the ecdh KDF: make input parameter const and the outlen argument more flexible
上级
e9ad6665
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
29 addition
and
18 deletion
+29
-18
apps/speed.c
apps/speed.c
+5
-3
crypto/ecdh/ecdh.h
crypto/ecdh/ecdh.h
+2
-2
crypto/ecdh/ecdhtest.c
crypto/ecdh/ecdhtest.c
+4
-2
crypto/ecdh/ech_key.c
crypto/ecdh/ech_key.c
+3
-2
crypto/ecdh/ech_ossl.c
crypto/ecdh/ech_ossl.c
+7
-5
ssl/s3_clnt.c
ssl/s3_clnt.c
+4
-2
ssl/s3_srvr.c
ssl/s3_srvr.c
+4
-2
未找到文件。
apps/speed.c
浏览文件 @
965a1cb9
...
...
@@ -449,11 +449,13 @@ static double Time_F(int s)
static
const
int
KDF1_SHA1_len
=
20
;
static
void
*
KDF1_SHA1
(
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
outlen
)
static
void
*
KDF1_SHA1
(
const
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
*
outlen
)
{
#ifndef OPENSSL_NO_SHA
if
(
outlen
!=
SHA_DIGEST_LENGTH
)
if
(
*
outlen
<
SHA_DIGEST_LENGTH
)
return
NULL
;
else
*
outlen
=
SHA_DIGEST_LENGTH
;
return
SHA1
(
in
,
inlen
,
out
);
#else
return
NULL
;
...
...
@@ -2189,7 +2191,7 @@ int MAIN(int argc, char **argv)
* otherwise, use result (see section 4.8 of draft-ietf-tls-ecc-03.txt).
*/
int
field_size
,
outlen
;
void
*
(
*
kdf
)(
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
xoutlen
);
void
*
(
*
kdf
)(
const
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
*
xoutlen
);
field_size
=
EC_GROUP_get_degree
(
ecdh_a
[
j
]
->
group
);
if
(
field_size
<=
24
*
8
)
{
...
...
crypto/ecdh/ecdh.h
浏览文件 @
965a1cb9
...
...
@@ -92,7 +92,7 @@ struct ecdh_method
{
const
char
*
name
;
int
(
*
compute_key
)(
void
*
key
,
size_t
outlen
,
const
EC_POINT
*
pub_key
,
EC_KEY
*
ecdh
,
void
*
(
*
KDF
)(
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
outlen
));
void
*
(
*
KDF
)(
const
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
*
outlen
));
#if 0
int (*init)(EC_KEY *eckey);
int (*finish)(EC_KEY *eckey);
...
...
@@ -127,7 +127,7 @@ const ECDH_METHOD *ECDH_get_default_method(void);
int
ECDH_set_method
(
EC_KEY
*
,
const
ECDH_METHOD
*
);
int
ECDH_compute_key
(
void
*
out
,
size_t
outlen
,
const
EC_POINT
*
pub_key
,
EC_KEY
*
ecdh
,
void
*
(
*
KDF
)(
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
outlen
));
void
*
(
*
KDF
)(
const
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
*
outlen
));
int
ECDH_get_ex_new_index
(
long
argl
,
void
*
argp
,
CRYPTO_EX_new
*
new_func
,
CRYPTO_EX_dup
*
dup_func
,
CRYPTO_EX_free
*
free_func
);
...
...
crypto/ecdh/ecdhtest.c
浏览文件 @
965a1cb9
...
...
@@ -105,11 +105,13 @@ static const char rnd_seed[] = "string to make the random number generator think
static
const
int
KDF1_SHA1_len
=
20
;
static
void
*
KDF1_SHA1
(
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
outlen
)
static
void
*
KDF1_SHA1
(
const
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
*
outlen
)
{
#ifndef OPENSSL_NO_SHA
if
(
outlen
!=
SHA_DIGEST_LENGTH
)
if
(
*
outlen
<
SHA_DIGEST_LENGTH
)
return
NULL
;
else
*
outlen
=
SHA_DIGEST_LENGTH
;
return
SHA1
(
in
,
inlen
,
out
);
#else
return
NULL
;
...
...
crypto/ecdh/ech_key.c
浏览文件 @
965a1cb9
...
...
@@ -72,8 +72,9 @@
#include <openssl/engine.h>
#endif
int
ECDH_compute_key
(
void
*
out
,
size_t
outlen
,
const
EC_POINT
*
pub_key
,
EC_KEY
*
eckey
,
void
*
(
*
KDF
)(
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
outlen
))
int
ECDH_compute_key
(
void
*
out
,
size_t
outlen
,
const
EC_POINT
*
pub_key
,
EC_KEY
*
eckey
,
void
*
(
*
KDF
)(
const
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
*
outlen
))
{
ECDH_DATA
*
ecdh
=
ecdh_check
(
eckey
);
if
(
ecdh
==
NULL
)
...
...
crypto/ecdh/ech_ossl.c
浏览文件 @
965a1cb9
...
...
@@ -79,8 +79,9 @@
#include <openssl/obj_mac.h>
#include <openssl/bn.h>
static
int
ecdh_compute_key
(
void
*
out
,
size_t
len
,
const
EC_POINT
*
pub_key
,
EC_KEY
*
ecdh
,
void
*
(
*
KDF
)(
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
outlen
));
static
int
ecdh_compute_key
(
void
*
out
,
size_t
len
,
const
EC_POINT
*
pub_key
,
EC_KEY
*
ecdh
,
void
*
(
*
KDF
)(
const
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
*
outlen
));
static
ECDH_METHOD
openssl_ecdh_meth
=
{
"OpenSSL ECDH method"
,
...
...
@@ -104,8 +105,9 @@ const ECDH_METHOD *ECDH_OpenSSL(void)
* - ECSVDP-DH
* Finally an optional KDF is applied.
*/
static
int
ecdh_compute_key
(
void
*
out
,
size_t
outlen
,
const
EC_POINT
*
pub_key
,
EC_KEY
*
ecdh
,
void
*
(
*
KDF
)(
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
outlen
))
static
int
ecdh_compute_key
(
void
*
out
,
size_t
outlen
,
const
EC_POINT
*
pub_key
,
EC_KEY
*
ecdh
,
void
*
(
*
KDF
)(
const
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
*
outlen
))
{
BN_CTX
*
ctx
;
EC_POINT
*
tmp
=
NULL
;
...
...
@@ -182,7 +184,7 @@ static int ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, E
if
(
KDF
!=
0
)
{
if
(
KDF
(
buf
,
buflen
,
out
,
outlen
)
==
NULL
)
if
(
KDF
(
buf
,
buflen
,
out
,
&
outlen
)
==
NULL
)
{
ECDHerr
(
ECDH_F_ECDH_COMPUTE_KEY
,
ECDH_R_KDF_FAILED
);
goto
err
;
...
...
ssl/s3_clnt.c
浏览文件 @
965a1cb9
...
...
@@ -1579,11 +1579,13 @@ static int ssl3_get_server_done(SSL *s)
static
const
int
KDF1_SHA1_len
=
20
;
static
void
*
KDF1_SHA1
(
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
outlen
)
static
void
*
KDF1_SHA1
(
const
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
*
outlen
)
{
#ifndef OPENSSL_NO_SHA
if
(
outlen
!=
SHA_DIGEST_LENGTH
)
if
(
*
outlen
<
SHA_DIGEST_LENGTH
)
return
NULL
;
else
*
outlen
=
SHA_DIGEST_LENGTH
;
return
SHA1
(
in
,
inlen
,
out
);
#else
return
NULL
;
...
...
ssl/s3_srvr.c
浏览文件 @
965a1cb9
...
...
@@ -1588,11 +1588,13 @@ err:
static
const
int
KDF1_SHA1_len
=
20
;
static
void
*
KDF1_SHA1
(
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
outlen
)
static
void
*
KDF1_SHA1
(
const
void
*
in
,
size_t
inlen
,
void
*
out
,
size_t
*
outlen
)
{
#ifndef OPENSSL_NO_SHA
if
(
outlen
!=
SHA_DIGEST_LENGTH
)
if
(
*
outlen
<
SHA_DIGEST_LENGTH
)
return
NULL
;
else
*
outlen
=
SHA_DIGEST_LENGTH
;
return
SHA1
(
in
,
inlen
,
out
);
#else
return
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录