Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
3da0ca79
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
9 个月 前同步成功
通知
8
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,体验更适合开发者的 AI 搜索 >>
提交
3da0ca79
编写于
2月 07, 2011
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
New flags EVP_CIPH_FLAG_CUSTOM_CIPHER in cipher structures if an underlying
cipher handles all cipher symantics itself.
上级
f9678b8b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
58 addition
and
1 deletion
+58
-1
CHANGES
CHANGES
+10
-0
crypto/evp/evp.h
crypto/evp/evp.h
+4
-0
crypto/evp/evp_enc.c
crypto/evp/evp_enc.c
+44
-1
未找到文件。
CHANGES
浏览文件 @
3da0ca79
...
@@ -4,6 +4,16 @@
...
@@ -4,6 +4,16 @@
Changes between 1.0.1 and 1.1.0 [xx XXX xxxx]
Changes between 1.0.1 and 1.1.0 [xx XXX xxxx]
*) New flag in ciphers: EVP_CIPH_FLAG_CUSTOM_CIPHER. This means the
underlying do_cipher function handles all cipher semantics itself
including padding and finalisation. This is useful if (for example)
an ENGINE cipher handles block padding itself. The behaviour of
do_cipher is subtly changed if this flag is set: the return value
is the number of characters written to the output buffer (zero is
no longer an error code) or a negative error code. Also if the
input buffer is NULL and length -1 finalisation should be performed.
[Steve Henson]
*) If a candidate issuer certificate is already part of the constructed
*) If a candidate issuer certificate is already part of the constructed
path ignore it: new debug notification X509_V_ERR_PATH_LOOP for this case.
path ignore it: new debug notification X509_V_ERR_PATH_LOOP for this case.
[Steve Henson]
[Steve Henson]
...
...
crypto/evp/evp.h
浏览文件 @
3da0ca79
...
@@ -354,6 +354,10 @@ struct evp_cipher_st
...
@@ -354,6 +354,10 @@ struct evp_cipher_st
#define EVP_CIPH_FLAG_FIPS 0x4000
#define EVP_CIPH_FLAG_FIPS 0x4000
/* Allow non FIPS cipher in FIPS mode */
/* Allow non FIPS cipher in FIPS mode */
#define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x8000
#define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x8000
/* Cipher handles any and all padding logic as well
* as finalisation.
*/
#define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x10000
/* ctrl() values */
/* ctrl() values */
...
...
crypto/evp/evp_enc.c
浏览文件 @
3da0ca79
...
@@ -286,6 +286,16 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
...
@@ -286,6 +286,16 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
{
{
int
i
,
j
,
bl
;
int
i
,
j
,
bl
;
if
(
ctx
->
cipher
->
flags
&
EVP_CIPH_FLAG_CUSTOM_CIPHER
)
{
i
=
ctx
->
cipher
->
do_cipher
(
ctx
,
out
,
in
,
inl
);
if
(
i
<
0
)
return
0
;
else
*
outl
=
i
;
return
1
;
}
if
(
inl
<=
0
)
if
(
inl
<=
0
)
{
{
*
outl
=
0
;
*
outl
=
0
;
...
@@ -356,6 +366,16 @@ int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
...
@@ -356,6 +366,16 @@ int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
int
n
,
ret
;
int
n
,
ret
;
unsigned
int
i
,
b
,
bl
;
unsigned
int
i
,
b
,
bl
;
if
(
ctx
->
cipher
->
flags
&
EVP_CIPH_FLAG_CUSTOM_CIPHER
)
{
i
=
ctx
->
cipher
->
do_cipher
(
ctx
,
out
,
NULL
,
-
1
);
if
(
i
<
0
)
return
0
;
else
*
outl
=
i
;
return
1
;
}
b
=
ctx
->
cipher
->
block_size
;
b
=
ctx
->
cipher
->
block_size
;
OPENSSL_assert
(
b
<=
sizeof
ctx
->
buf
);
OPENSSL_assert
(
b
<=
sizeof
ctx
->
buf
);
if
(
b
==
1
)
if
(
b
==
1
)
...
@@ -393,6 +413,19 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
...
@@ -393,6 +413,19 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
int
fix_len
;
int
fix_len
;
unsigned
int
b
;
unsigned
int
b
;
if
(
ctx
->
cipher
->
flags
&
EVP_CIPH_FLAG_CUSTOM_CIPHER
)
{
fix_len
=
ctx
->
cipher
->
do_cipher
(
ctx
,
out
,
in
,
inl
);
if
(
fix_len
<
0
)
{
*
outl
=
0
;
return
0
;
}
else
*
outl
=
fix_len
;
return
1
;
}
if
(
inl
<=
0
)
if
(
inl
<=
0
)
{
{
*
outl
=
0
;
*
outl
=
0
;
...
@@ -446,8 +479,18 @@ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
...
@@ -446,8 +479,18 @@ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
{
{
int
i
,
n
;
int
i
,
n
;
unsigned
int
b
;
unsigned
int
b
;
*
outl
=
0
;
*
outl
=
0
;
if
(
ctx
->
cipher
->
flags
&
EVP_CIPH_FLAG_CUSTOM_CIPHER
)
{
i
=
ctx
->
cipher
->
do_cipher
(
ctx
,
out
,
NULL
,
-
1
);
if
(
i
<
0
)
return
0
;
else
*
outl
=
i
;
return
1
;
}
b
=
ctx
->
cipher
->
block_size
;
b
=
ctx
->
cipher
->
block_size
;
if
(
ctx
->
flags
&
EVP_CIPH_NO_PADDING
)
if
(
ctx
->
flags
&
EVP_CIPH_NO_PADDING
)
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录