Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
512d359e
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
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看板
提交
512d359e
编写于
7月 27, 2009
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update from 1.0.0-stable.
上级
c869da88
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
54 addition
and
52 deletion
+54
-52
crypto/asn1/a_set.c
crypto/asn1/a_set.c
+19
-18
crypto/asn1/asn1.h
crypto/asn1/asn1.h
+7
-6
crypto/asn1/asn_pack.c
crypto/asn1/asn_pack.c
+4
-4
crypto/stack/safestack.h
crypto/stack/safestack.h
+24
-24
未找到文件。
crypto/asn1/a_set.c
浏览文件 @
512d359e
...
...
@@ -85,7 +85,7 @@ static int SetBlobCmp(const void *elem1, const void *elem2 )
}
/* int is_set: if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */
int
i2d_ASN1_SET
(
STACK_OF
(
BLOCK
)
*
a
,
unsigned
char
**
pp
,
int
i2d_ASN1_SET
(
STACK_OF
(
OPENSSL_
BLOCK
)
*
a
,
unsigned
char
**
pp
,
i2d_of_void
*
i2d
,
int
ex_tag
,
int
ex_class
,
int
is_set
)
{
...
...
@@ -97,8 +97,8 @@ int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
int
totSize
;
if
(
a
==
NULL
)
return
(
0
);
for
(
i
=
sk_BLOCK_num
(
a
)
-
1
;
i
>=
0
;
i
--
)
ret
+=
i2d
(
sk_BLOCK_value
(
a
,
i
),
NULL
);
for
(
i
=
sk_
OPENSSL_
BLOCK_num
(
a
)
-
1
;
i
>=
0
;
i
--
)
ret
+=
i2d
(
sk_
OPENSSL_
BLOCK_value
(
a
,
i
),
NULL
);
r
=
ASN1_object_size
(
1
,
ret
,
ex_tag
);
if
(
pp
==
NULL
)
return
(
r
);
...
...
@@ -109,10 +109,10 @@ int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
/* And then again by Ben */
/* And again by Steve */
if
(
!
is_set
||
(
sk_BLOCK_num
(
a
)
<
2
))
if
(
!
is_set
||
(
sk_
OPENSSL_
BLOCK_num
(
a
)
<
2
))
{
for
(
i
=
0
;
i
<
sk_BLOCK_num
(
a
);
i
++
)
i2d
(
sk_BLOCK_value
(
a
,
i
),
&
p
);
for
(
i
=
0
;
i
<
sk_
OPENSSL_
BLOCK_num
(
a
);
i
++
)
i2d
(
sk_
OPENSSL_
BLOCK_value
(
a
,
i
),
&
p
);
*
pp
=
p
;
return
(
r
);
...
...
@@ -120,17 +120,17 @@ int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
pStart
=
p
;
/* Catch the beg of Setblobs*/
/* In this array we will store the SET blobs */
rgSetBlob
=
OPENSSL_malloc
(
sk_BLOCK_num
(
a
)
*
sizeof
(
MYBLOB
));
rgSetBlob
=
OPENSSL_malloc
(
sk_
OPENSSL_
BLOCK_num
(
a
)
*
sizeof
(
MYBLOB
));
if
(
rgSetBlob
==
NULL
)
{
ASN1err
(
ASN1_F_I2D_ASN1_SET
,
ERR_R_MALLOC_FAILURE
);
return
(
0
);
}
for
(
i
=
0
;
i
<
sk_BLOCK_num
(
a
);
i
++
)
for
(
i
=
0
;
i
<
sk_
OPENSSL_
BLOCK_num
(
a
);
i
++
)
{
rgSetBlob
[
i
].
pbData
=
p
;
/* catch each set encode blob */
i2d
(
sk_BLOCK_value
(
a
,
i
),
&
p
);
i2d
(
sk_
OPENSSL_
BLOCK_value
(
a
,
i
),
&
p
);
rgSetBlob
[
i
].
cbData
=
p
-
rgSetBlob
[
i
].
pbData
;
/* Length of this
SetBlob
*/
...
...
@@ -140,7 +140,7 @@ SetBlob
/* Now we have to sort the blobs. I am using a simple algo.
*Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/
qsort
(
rgSetBlob
,
sk_BLOCK_num
(
a
),
sizeof
(
MYBLOB
),
SetBlobCmp
);
qsort
(
rgSetBlob
,
sk_
OPENSSL_
BLOCK_num
(
a
),
sizeof
(
MYBLOB
),
SetBlobCmp
);
if
(
!
(
pTempMem
=
OPENSSL_malloc
(
totSize
)))
{
ASN1err
(
ASN1_F_I2D_ASN1_SET
,
ERR_R_MALLOC_FAILURE
);
...
...
@@ -149,7 +149,7 @@ SetBlob
/* Copy to temp mem */
p
=
pTempMem
;
for
(
i
=
0
;
i
<
sk_BLOCK_num
(
a
);
++
i
)
for
(
i
=
0
;
i
<
sk_
OPENSSL_
BLOCK_num
(
a
);
++
i
)
{
memcpy
(
p
,
rgSetBlob
[
i
].
pbData
,
rgSetBlob
[
i
].
cbData
);
p
+=
rgSetBlob
[
i
].
cbData
;
...
...
@@ -163,17 +163,18 @@ SetBlob
return
(
r
);
}
STACK_OF
(
BLOCK
)
*
d2i_ASN1_SET
(
STACK_OF
(
BLOCK
)
**
a
,
const
unsigned
char
**
pp
,
STACK_OF
(
OPENSSL_BLOCK
)
*
d2i_ASN1_SET
(
STACK_OF
(
OPENSSL_BLOCK
)
**
a
,
const
unsigned
char
**
pp
,
long
length
,
d2i_of_void
*
d2i
,
void
(
*
free_func
)(
BLOCK
),
int
ex_tag
,
void
(
*
free_func
)(
OPENSSL_
BLOCK
),
int
ex_tag
,
int
ex_class
)
{
ASN1_const_CTX
c
;
STACK_OF
(
BLOCK
)
*
ret
=
NULL
;
STACK_OF
(
OPENSSL_
BLOCK
)
*
ret
=
NULL
;
if
((
a
==
NULL
)
||
((
*
a
)
==
NULL
))
{
if
((
ret
=
sk_BLOCK_new_null
())
==
NULL
)
if
((
ret
=
sk_
OPENSSL_
BLOCK_new_null
())
==
NULL
)
{
ASN1err
(
ASN1_F_D2I_ASN1_SET
,
ERR_R_MALLOC_FAILURE
);
goto
err
;
...
...
@@ -221,7 +222,7 @@ STACK_OF(BLOCK) *d2i_ASN1_SET(STACK_OF(BLOCK) **a, const unsigned char **pp,
asn1_add_error
(
*
pp
,(
int
)(
c
.
p
-
*
pp
));
goto
err
;
}
if
(
!
sk_BLOCK_push
(
ret
,
s
))
goto
err
;
if
(
!
sk_
OPENSSL_
BLOCK_push
(
ret
,
s
))
goto
err
;
}
if
(
a
!=
NULL
)
(
*
a
)
=
ret
;
*
pp
=
c
.
p
;
...
...
@@ -230,9 +231,9 @@ err:
if
((
ret
!=
NULL
)
&&
((
a
==
NULL
)
||
(
*
a
!=
ret
)))
{
if
(
free_func
!=
NULL
)
sk_BLOCK_pop_free
(
ret
,
free_func
);
sk_
OPENSSL_
BLOCK_pop_free
(
ret
,
free_func
);
else
sk_BLOCK_free
(
ret
);
sk_
OPENSSL_
BLOCK_free
(
ret
);
}
return
(
NULL
);
}
...
...
crypto/asn1/asn1.h
浏览文件 @
512d359e
...
...
@@ -887,12 +887,13 @@ int ASN1_TIME_check(ASN1_TIME *t);
ASN1_GENERALIZEDTIME
*
ASN1_TIME_to_generalizedtime
(
ASN1_TIME
*
t
,
ASN1_GENERALIZEDTIME
**
out
);
int
ASN1_TIME_set_string
(
ASN1_TIME
*
s
,
const
char
*
str
);
int
i2d_ASN1_SET
(
STACK_OF
(
BLOCK
)
*
a
,
unsigned
char
**
pp
,
int
i2d_ASN1_SET
(
STACK_OF
(
OPENSSL_
BLOCK
)
*
a
,
unsigned
char
**
pp
,
i2d_of_void
*
i2d
,
int
ex_tag
,
int
ex_class
,
int
is_set
);
STACK_OF
(
BLOCK
)
*
d2i_ASN1_SET
(
STACK_OF
(
BLOCK
)
**
a
,
const
unsigned
char
**
pp
,
STACK_OF
(
OPENSSL_BLOCK
)
*
d2i_ASN1_SET
(
STACK_OF
(
OPENSSL_BLOCK
)
**
a
,
const
unsigned
char
**
pp
,
long
length
,
d2i_of_void
*
d2i
,
void
(
*
free_func
)(
BLOCK
),
int
ex_tag
,
void
(
*
free_func
)(
OPENSSL_
BLOCK
),
int
ex_tag
,
int
ex_class
);
#ifndef OPENSSL_NO_BIO
...
...
@@ -1045,9 +1046,9 @@ int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num,
int
ASN1_TYPE_get_int_octetstring
(
ASN1_TYPE
*
a
,
long
*
num
,
unsigned
char
*
data
,
int
max_len
);
STACK_OF
(
BLOCK
)
*
ASN1_seq_unpack
(
const
unsigned
char
*
buf
,
int
len
,
d2i_of_void
*
d2i
,
void
(
*
free_func
)(
BLOCK
));
unsigned
char
*
ASN1_seq_pack
(
STACK_OF
(
BLOCK
)
*
safes
,
i2d_of_void
*
i2d
,
STACK_OF
(
OPENSSL_
BLOCK
)
*
ASN1_seq_unpack
(
const
unsigned
char
*
buf
,
int
len
,
d2i_of_void
*
d2i
,
void
(
*
free_func
)(
OPENSSL_
BLOCK
));
unsigned
char
*
ASN1_seq_pack
(
STACK_OF
(
OPENSSL_
BLOCK
)
*
safes
,
i2d_of_void
*
i2d
,
unsigned
char
**
buf
,
int
*
len
);
void
*
ASN1_unpack_string
(
ASN1_STRING
*
oct
,
d2i_of_void
*
d2i
);
void
*
ASN1_item_unpack
(
ASN1_STRING
*
oct
,
const
ASN1_ITEM
*
it
);
...
...
crypto/asn1/asn_pack.c
浏览文件 @
512d359e
...
...
@@ -66,10 +66,10 @@
/* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */
STACK_OF
(
BLOCK
)
*
ASN1_seq_unpack
(
const
unsigned
char
*
buf
,
int
len
,
d2i_of_void
*
d2i
,
void
(
*
free_func
)(
BLOCK
))
STACK_OF
(
OPENSSL_
BLOCK
)
*
ASN1_seq_unpack
(
const
unsigned
char
*
buf
,
int
len
,
d2i_of_void
*
d2i
,
void
(
*
free_func
)(
OPENSSL_
BLOCK
))
{
STACK_OF
(
BLOCK
)
*
sk
;
STACK_OF
(
OPENSSL_
BLOCK
)
*
sk
;
const
unsigned
char
*
pbuf
;
pbuf
=
buf
;
if
(
!
(
sk
=
d2i_ASN1_SET
(
NULL
,
&
pbuf
,
len
,
d2i
,
free_func
,
...
...
@@ -82,7 +82,7 @@ STACK_OF(BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len,
* OPENSSL_malloc'ed buffer
*/
unsigned
char
*
ASN1_seq_pack
(
STACK_OF
(
BLOCK
)
*
safes
,
i2d_of_void
*
i2d
,
unsigned
char
*
ASN1_seq_pack
(
STACK_OF
(
OPENSSL_
BLOCK
)
*
safes
,
i2d_of_void
*
i2d
,
unsigned
char
**
buf
,
int
*
len
)
{
int
safelen
;
...
...
crypto/stack/safestack.h
浏览文件 @
512d359e
...
...
@@ -128,8 +128,8 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
* nul-terminated. These should also be distinguished from "normal"
* stacks. */
typedef
void
*
BLOCK
;
DECLARE_SPECIAL_STACK_OF
(
BLOCK
,
void
)
typedef
void
*
OPENSSL_
BLOCK
;
DECLARE_SPECIAL_STACK_OF
(
OPENSSL_
BLOCK
,
void
)
/* SKM_sk_... stack macros are internal to safestack.h:
* never use them directly, use sk_<type>_... instead */
...
...
@@ -2055,29 +2055,29 @@ DECLARE_SPECIAL_STACK_OF(BLOCK, void)
#define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st))
#define sk_
BLOCK_new(cmp) ((STACK_OF(
BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp)))
#define sk_
BLOCK_new_null() ((STACK_OF(
BLOCK) *)sk_new_null())
#define sk_
BLOCK_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(
BLOCK), st), CHECKED_PTR_OF(void, val))
#define sk_
BLOCK_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(
BLOCK), st), CHECKED_PTR_OF(void, val))
#define sk_
BLOCK_value(st, i) ((BLOCK)sk_value(CHECKED_PTR_OF(STACK_OF(
BLOCK), st), i))
#define sk_
BLOCK_num(st) SKM_sk_num(
BLOCK, st)
#define sk_
BLOCK_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(BLOCK), st), CHECKED_SK_FREE_FUNC2(
BLOCK, free_func))
#define sk_
BLOCK_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(
BLOCK), st), CHECKED_PTR_OF(void, val), i)
#define sk_
BLOCK_free(st) SKM_sk_free(
BLOCK, st)
#define sk_
BLOCK_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(
BLOCK), st), i, CHECKED_PTR_OF(void, val))
#define sk_
BLOCK_zero(st) SKM_sk_zero(
BLOCK, (st))
#define sk_
BLOCK_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(
BLOCK), st), CHECKED_PTR_OF(void, val))
#define sk_
BLOCK_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(
BLOCK), st), CHECKED_CONST_PTR_OF(void, val))
#define sk_
BLOCK_delete(st, i) SKM_sk_delete(
BLOCK, (st), (i))
#define sk_
BLOCK_delete_ptr(st, ptr) (BLOCK *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(
BLOCK), st), CHECKED_PTR_OF(void, ptr))
#define sk_BLOCK_set_cmp_func(st, cmp) \
#define sk_
OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_
BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp)))
#define sk_
OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_
BLOCK) *)sk_new_null())
#define sk_
OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(OPENSSL_
BLOCK), st), CHECKED_PTR_OF(void, val))
#define sk_
OPENSSL_BLOCK_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(OPENSSL_
BLOCK), st), CHECKED_PTR_OF(void, val))
#define sk_
OPENSSL_BLOCK_value(st, i) ((OPENSSL_BLOCK)sk_value(CHECKED_PTR_OF(STACK_OF(OPENSSL_
BLOCK), st), i))
#define sk_
OPENSSL_BLOCK_num(st) SKM_sk_num(OPENSSL_
BLOCK, st)
#define sk_
OPENSSL_BLOCK_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_SK_FREE_FUNC2(OPENSSL_
BLOCK, free_func))
#define sk_
OPENSSL_BLOCK_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(OPENSSL_
BLOCK), st), CHECKED_PTR_OF(void, val), i)
#define sk_
OPENSSL_BLOCK_free(st) SKM_sk_free(OPENSSL_
BLOCK, st)
#define sk_
OPENSSL_BLOCK_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_
BLOCK), st), i, CHECKED_PTR_OF(void, val))
#define sk_
OPENSSL_BLOCK_zero(st) SKM_sk_zero(OPENSSL_
BLOCK, (st))
#define sk_
OPENSSL_BLOCK_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_
BLOCK), st), CHECKED_PTR_OF(void, val))
#define sk_
OPENSSL_BLOCK_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_
BLOCK), st), CHECKED_CONST_PTR_OF(void, val))
#define sk_
OPENSSL_BLOCK_delete(st, i) SKM_sk_delete(OPENSSL_
BLOCK, (st), (i))
#define sk_
OPENSSL_BLOCK_delete_ptr(st, ptr) (OPENSSL_BLOCK *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_
BLOCK), st), CHECKED_PTR_OF(void, ptr))
#define sk_
OPENSSL_
BLOCK_set_cmp_func(st, cmp) \
((int (*)(const void * const *,const void * const *)) \
sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(BLOCK), st), CHECKED_SK_CMP_FUNC(void, cmp)))
#define sk_
BLOCK_dup(st) SKM_sk_dup(
BLOCK, st)
#define sk_
BLOCK_shift(st) SKM_sk_shift(
BLOCK, (st))
#define sk_
BLOCK_pop(st) (void *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(
BLOCK), st))
#define sk_
BLOCK_sort(st) SKM_sk_sort(
BLOCK, (st))
#define sk_
BLOCK_is_sorted(st) SKM_sk_is_sorted(
BLOCK, (st))
sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(
OPENSSL_
BLOCK), st), CHECKED_SK_CMP_FUNC(void, cmp)))
#define sk_
OPENSSL_BLOCK_dup(st) SKM_sk_dup(OPENSSL_
BLOCK, st)
#define sk_
OPENSSL_BLOCK_shift(st) SKM_sk_shift(OPENSSL_
BLOCK, (st))
#define sk_
OPENSSL_BLOCK_pop(st) (void *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_
BLOCK), st))
#define sk_
OPENSSL_BLOCK_sort(st) SKM_sk_sort(OPENSSL_
BLOCK, (st))
#define sk_
OPENSSL_BLOCK_is_sorted(st) SKM_sk_is_sorted(OPENSSL_
BLOCK, (st))
#define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp)))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录