Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
d500de16
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看板
提交
d500de16
编写于
5月 01, 1999
作者:
B
Ben Laurie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Another stack.
上级
b3ca645f
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
64 addition
and
33 deletion
+64
-33
apps/req.c
apps/req.c
+7
-5
crypto/asn1/asn1_mac.h
crypto/asn1/asn1_mac.h
+21
-0
crypto/asn1/t_req.c
crypto/asn1/t_req.c
+4
-4
crypto/asn1/x_req.c
crypto/asn1/x_req.c
+12
-8
crypto/x509/x509.h
crypto/x509/x509.h
+16
-15
crypto/x509/x509_r2x.c
crypto/x509/x509_r2x.c
+1
-1
crypto/x509/x509_vfy.c
crypto/x509/x509_vfy.c
+3
-0
未找到文件。
apps/req.c
浏览文件 @
d500de16
...
@@ -108,8 +108,9 @@
...
@@ -108,8 +108,9 @@
*/
*/
static
int
make_REQ
(
X509_REQ
*
req
,
EVP_PKEY
*
pkey
,
int
attribs
);
static
int
make_REQ
(
X509_REQ
*
req
,
EVP_PKEY
*
pkey
,
int
attribs
);
static
int
add_attribute_object
(
STACK
*
n
,
char
*
text
,
char
*
def
,
static
int
add_attribute_object
(
STACK_OF
(
X509_ATTRIBUTE
)
*
n
,
char
*
text
,
char
*
value
,
int
nid
,
int
min
,
int
max
);
char
*
def
,
char
*
value
,
int
nid
,
int
min
,
int
max
);
static
int
add_DN_object
(
X509_NAME
*
n
,
char
*
text
,
char
*
def
,
char
*
value
,
static
int
add_DN_object
(
X509_NAME
*
n
,
char
*
text
,
char
*
def
,
char
*
value
,
int
nid
,
int
min
,
int
max
);
int
nid
,
int
min
,
int
max
);
static
void
MS_CALLBACK
req_cb
(
int
p
,
int
n
,
char
*
arg
);
static
void
MS_CALLBACK
req_cb
(
int
p
,
int
n
,
char
*
arg
);
...
@@ -1022,8 +1023,9 @@ err:
...
@@ -1022,8 +1023,9 @@ err:
return
(
ret
);
return
(
ret
);
}
}
static
int
add_attribute_object
(
STACK
*
n
,
char
*
text
,
char
*
def
,
char
*
value
,
static
int
add_attribute_object
(
STACK_OF
(
X509_ATTRIBUTE
)
*
n
,
char
*
text
,
int
nid
,
int
min
,
int
max
)
char
*
def
,
char
*
value
,
int
nid
,
int
min
,
int
max
)
{
{
int
i
,
z
;
int
i
,
z
;
X509_ATTRIBUTE
*
xa
=
NULL
;
X509_ATTRIBUTE
*
xa
=
NULL
;
...
@@ -1098,7 +1100,7 @@ start:
...
@@ -1098,7 +1100,7 @@ start:
at
=
NULL
;
at
=
NULL
;
/* only one item per attribute */
/* only one item per attribute */
if
(
!
sk_
push
(
n
,(
char
*
)
xa
))
goto
err
;
if
(
!
sk_
X509_ATTRIBUTE_push
(
n
,
xa
))
goto
err
;
return
(
1
);
return
(
1
);
err:
err:
if
(
xa
!=
NULL
)
X509_ATTRIBUTE_free
(
xa
);
if
(
xa
!=
NULL
)
X509_ATTRIBUTE_free
(
xa
);
...
...
crypto/asn1/asn1_mac.h
浏览文件 @
d500de16
...
@@ -210,6 +210,10 @@ err:\
...
@@ -210,6 +210,10 @@ err:\
M_ASN1_D2I_get_imp_set(r,func,free_func,\
M_ASN1_D2I_get_imp_set(r,func,free_func,\
x,V_ASN1_CONTEXT_SPECIFIC);
x,V_ASN1_CONTEXT_SPECIFIC);
#define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \
M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\
x,V_ASN1_CONTEXT_SPECIFIC);
#define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \
#define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \
c.q=c.p; \
c.q=c.p; \
if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\
if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\
...
@@ -328,11 +332,20 @@ err:\
...
@@ -328,11 +332,20 @@ err:\
#define M_ASN1_I2D_len_IMP_SET(a,f,x) \
#define M_ASN1_I2D_len_IMP_SET(a,f,x) \
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET);
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET);
#define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
V_ASN1_CONTEXT_SPECIFIC,IS_SET);
#define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \
#define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \
if ((a != NULL) && (sk_num(a) != 0)) \
if ((a != NULL) && (sk_num(a) != 0)) \
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
IS_SET);
IS_SET);
#define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
V_ASN1_CONTEXT_SPECIFIC,IS_SET);
#define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \
#define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
IS_SEQUENCE);
IS_SEQUENCE);
...
@@ -385,6 +398,8 @@ err:\
...
@@ -385,6 +398,8 @@ err:\
V_ASN1_UNIVERSAL,IS_SET)
V_ASN1_UNIVERSAL,IS_SET)
#define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
#define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
V_ASN1_CONTEXT_SPECIFIC,IS_SET)
V_ASN1_CONTEXT_SPECIFIC,IS_SET)
#define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \
i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET)
#define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
#define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE)
V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE)
...
@@ -404,6 +419,12 @@ err:\
...
@@ -404,6 +419,12 @@ err:\
{ i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
{ i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
IS_SET); }
IS_SET); }
#define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
{ i2d_ASN1_SET_OF_##type(a,&p,f,x, \
V_ASN1_CONTEXT_SPECIFIC, \
IS_SET); }
#define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \
#define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \
if ((a != NULL) && (sk_num(a) != 0)) \
if ((a != NULL) && (sk_num(a) != 0)) \
{ i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
{ i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
...
...
crypto/asn1/t_req.c
浏览文件 @
d500de16
...
@@ -89,7 +89,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
...
@@ -89,7 +89,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
const
char
*
neg
;
const
char
*
neg
;
X509_REQ_INFO
*
ri
;
X509_REQ_INFO
*
ri
;
EVP_PKEY
*
pkey
;
EVP_PKEY
*
pkey
;
STACK
*
sk
;
STACK
_OF
(
X509_ATTRIBUTE
)
*
sk
;
char
str
[
128
];
char
str
[
128
];
ri
=
x
->
req_info
;
ri
=
x
->
req_info
;
...
@@ -142,7 +142,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
...
@@ -142,7 +142,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
if
(
BIO_puts
(
bp
,
str
)
<=
0
)
goto
err
;
if
(
BIO_puts
(
bp
,
str
)
<=
0
)
goto
err
;
sk
=
x
->
req_info
->
attributes
;
sk
=
x
->
req_info
->
attributes
;
if
((
sk
==
NULL
)
||
(
sk_num
(
sk
)
==
0
))
if
((
sk
==
NULL
)
||
(
sk_
X509_ATTRIBUTE_
num
(
sk
)
==
0
))
{
{
if
(
!
x
->
req_info
->
req_kludge
)
if
(
!
x
->
req_info
->
req_kludge
)
{
{
...
@@ -152,7 +152,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
...
@@ -152,7 +152,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
}
}
else
else
{
{
for
(
i
=
0
;
i
<
sk_num
(
sk
);
i
++
)
for
(
i
=
0
;
i
<
sk_
X509_ATTRIBUTE_
num
(
sk
);
i
++
)
{
{
ASN1_TYPE
*
at
;
ASN1_TYPE
*
at
;
X509_ATTRIBUTE
*
a
;
X509_ATTRIBUTE
*
a
;
...
@@ -160,7 +160,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
...
@@ -160,7 +160,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x)
ASN1_TYPE
*
t
;
ASN1_TYPE
*
t
;
int
j
,
type
=
0
,
count
=
1
,
ii
=
0
;
int
j
,
type
=
0
,
count
=
1
,
ii
=
0
;
a
=
(
X509_ATTRIBUTE
*
)
sk
_value
(
sk
,
i
);
a
=
sk_X509_ATTRIBUTE
_value
(
sk
,
i
);
sprintf
(
str
,
"%12s"
,
""
);
sprintf
(
str
,
"%12s"
,
""
);
if
(
BIO_puts
(
bp
,
str
)
<=
0
)
goto
err
;
if
(
BIO_puts
(
bp
,
str
)
<=
0
)
goto
err
;
if
((
j
=
i2a_ASN1_OBJECT
(
bp
,
a
->
object
))
>
0
)
if
((
j
=
i2a_ASN1_OBJECT
(
bp
,
a
->
object
))
>
0
)
...
...
crypto/asn1/x_req.c
浏览文件 @
d500de16
...
@@ -78,11 +78,12 @@ int i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **pp)
...
@@ -78,11 +78,12 @@ int i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **pp)
*/
*/
if
(
a
->
req_kludge
)
if
(
a
->
req_kludge
)
{
{
M_ASN1_I2D_len_IMP_SET_opt
(
a
->
attributes
,
i2d_X509_ATTRIBUTE
,
0
);
M_ASN1_I2D_len_IMP_SET_opt
_type
(
X509_ATTRIBUTE
,
a
->
attributes
,
i2d_X509_ATTRIBUTE
,
0
);
}
}
else
else
{
{
M_ASN1_I2D_len_IMP_SET
(
a
->
attributes
,
i2d_X509_ATTRIBUTE
,
0
);
M_ASN1_I2D_len_IMP_SET_type
(
X509_ATTRIBUTE
,
a
->
attributes
,
i2d_X509_ATTRIBUTE
,
0
);
}
}
M_ASN1_I2D_seq_total
();
M_ASN1_I2D_seq_total
();
...
@@ -98,11 +99,13 @@ int i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **pp)
...
@@ -98,11 +99,13 @@ int i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **pp)
*/
*/
if
(
a
->
req_kludge
)
if
(
a
->
req_kludge
)
{
{
M_ASN1_I2D_put_IMP_SET_opt
(
a
->
attributes
,
i2d_X509_ATTRIBUTE
,
0
);
M_ASN1_I2D_put_IMP_SET_opt_type
(
X509_ATTRIBUTE
,
a
->
attributes
,
i2d_X509_ATTRIBUTE
,
0
);
}
}
else
else
{
{
M_ASN1_I2D_put_IMP_SET
(
a
->
attributes
,
i2d_X509_ATTRIBUTE
,
0
);
M_ASN1_I2D_put_IMP_SET_type
(
X509_ATTRIBUTE
,
a
->
attributes
,
i2d_X509_ATTRIBUTE
,
0
);
}
}
M_ASN1_I2D_finish
();
M_ASN1_I2D_finish
();
...
@@ -130,8 +133,9 @@ X509_REQ_INFO *d2i_X509_REQ_INFO(X509_REQ_INFO **a, unsigned char **pp,
...
@@ -130,8 +133,9 @@ X509_REQ_INFO *d2i_X509_REQ_INFO(X509_REQ_INFO **a, unsigned char **pp,
ret
->
req_kludge
=
1
;
ret
->
req_kludge
=
1
;
else
else
{
{
M_ASN1_D2I_get_IMP_set
(
ret
->
attributes
,
d2i_X509_ATTRIBUTE
,
M_ASN1_D2I_get_IMP_set_type
(
X509_ATTRIBUTE
,
ret
->
attributes
,
X509_ATTRIBUTE_free
,
0
);
d2i_X509_ATTRIBUTE
,
X509_ATTRIBUTE_free
,
0
);
}
}
M_ASN1_D2I_Finish
(
a
,
X509_REQ_INFO_free
,
ASN1_F_D2I_X509_REQ_INFO
);
M_ASN1_D2I_Finish
(
a
,
X509_REQ_INFO_free
,
ASN1_F_D2I_X509_REQ_INFO
);
...
@@ -146,7 +150,7 @@ X509_REQ_INFO *X509_REQ_INFO_new(void)
...
@@ -146,7 +150,7 @@ X509_REQ_INFO *X509_REQ_INFO_new(void)
M_ASN1_New
(
ret
->
version
,
ASN1_INTEGER_new
);
M_ASN1_New
(
ret
->
version
,
ASN1_INTEGER_new
);
M_ASN1_New
(
ret
->
subject
,
X509_NAME_new
);
M_ASN1_New
(
ret
->
subject
,
X509_NAME_new
);
M_ASN1_New
(
ret
->
pubkey
,
X509_PUBKEY_new
);
M_ASN1_New
(
ret
->
pubkey
,
X509_PUBKEY_new
);
M_ASN1_New
(
ret
->
attributes
,
sk_new_null
);
M_ASN1_New
(
ret
->
attributes
,
sk_
X509_ATTRIBUTE_
new_null
);
ret
->
req_kludge
=
0
;
ret
->
req_kludge
=
0
;
return
(
ret
);
return
(
ret
);
M_ASN1_New_Error
(
ASN1_F_X509_REQ_INFO_NEW
);
M_ASN1_New_Error
(
ASN1_F_X509_REQ_INFO_NEW
);
...
@@ -158,7 +162,7 @@ void X509_REQ_INFO_free(X509_REQ_INFO *a)
...
@@ -158,7 +162,7 @@ void X509_REQ_INFO_free(X509_REQ_INFO *a)
ASN1_INTEGER_free
(
a
->
version
);
ASN1_INTEGER_free
(
a
->
version
);
X509_NAME_free
(
a
->
subject
);
X509_NAME_free
(
a
->
subject
);
X509_PUBKEY_free
(
a
->
pubkey
);
X509_PUBKEY_free
(
a
->
pubkey
);
sk_pop_free
(
a
->
attributes
,
X509_ATTRIBUTE_free
);
sk_
X509_ATTRIBUTE_
pop_free
(
a
->
attributes
,
X509_ATTRIBUTE_free
);
Free
((
char
*
)
a
);
Free
((
char
*
)
a
);
}
}
...
...
crypto/x509/x509.h
浏览文件 @
d500de16
...
@@ -167,13 +167,28 @@ typedef struct X509_extension_st
...
@@ -167,13 +167,28 @@ typedef struct X509_extension_st
void
(
*
ex_free
)();
/* clear argp stuff */
void
(
*
ex_free
)();
/* clear argp stuff */
}
X509_EXTENSION
;
}
X509_EXTENSION
;
/* a sequence of these are used */
typedef
struct
x509_attributes_st
{
ASN1_OBJECT
*
object
;
int
set
;
/* 1 for a set, 0 for a single item (which is wrong) */
union
{
char
*
ptr
;
/* 1 */
STACK
/* ASN1_TYPE */
*
set
;
/* 0 */
ASN1_TYPE
*
single
;
}
value
;
}
X509_ATTRIBUTE
;
DECLARE_STACK_OF
(
X509_ATTRIBUTE
)
DECLARE_ASN1_SET_OF
(
X509_ATTRIBUTE
)
typedef
struct
X509_req_info_st
typedef
struct
X509_req_info_st
{
{
ASN1_INTEGER
*
version
;
ASN1_INTEGER
*
version
;
X509_NAME
*
subject
;
X509_NAME
*
subject
;
X509_PUBKEY
*
pubkey
;
X509_PUBKEY
*
pubkey
;
/* d=2 hl=2 l= 0 cons: cont: 00 */
/* d=2 hl=2 l= 0 cons: cont: 00 */
STACK
/* X509_ATTRIBUTE */
*
attributes
;
/* [ 0 ] */
STACK
_OF
(
X509_ATTRIBUTE
)
*
attributes
;
/* [ 0 ] */
int
req_kludge
;
int
req_kludge
;
}
X509_REQ_INFO
;
}
X509_REQ_INFO
;
...
@@ -240,20 +255,6 @@ typedef struct X509_crl_st
...
@@ -240,20 +255,6 @@ typedef struct X509_crl_st
int
references
;
int
references
;
}
X509_CRL
;
}
X509_CRL
;
/* a sequence of these are used */
typedef
struct
x509_attributes_st
{
ASN1_OBJECT
*
object
;
int
set
;
/* 1 for a set, 0 for a single item (which is wrong) */
union
{
char
*
ptr
;
/* 1 */
STACK
/* ASN1_TYPE */
*
set
;
/* 0 */
ASN1_TYPE
*
single
;
}
value
;
}
X509_ATTRIBUTE
;
DECLARE_STACK_OF
(
X509_ATTRIBUTE
)
typedef
struct
private_key_st
typedef
struct
private_key_st
{
{
int
version
;
int
version
;
...
...
crypto/x509/x509_r2x.c
浏览文件 @
d500de16
...
@@ -80,7 +80,7 @@ X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
...
@@ -80,7 +80,7 @@ X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
/* duplicate the request */
/* duplicate the request */
xi
=
ret
->
cert_info
;
xi
=
ret
->
cert_info
;
if
(
sk_num
(
r
->
req_info
->
attributes
)
!=
0
)
if
(
sk_
X509_ATTRIBUTE_
num
(
r
->
req_info
->
attributes
)
!=
0
)
{
{
if
((
xi
->
version
=
ASN1_INTEGER_new
())
==
NULL
)
goto
err
;
if
((
xi
->
version
=
ASN1_INTEGER_new
())
==
NULL
)
goto
err
;
if
(
!
ASN1_INTEGER_set
(
xi
->
version
,
2
))
goto
err
;
if
(
!
ASN1_INTEGER_set
(
xi
->
version
,
2
))
goto
err
;
...
...
crypto/x509/x509_vfy.c
浏览文件 @
d500de16
...
@@ -628,5 +628,8 @@ void X509_STORE_CTX_set_chain(X509_STORE_CTX *ctx, STACK_OF(X509) *sk)
...
@@ -628,5 +628,8 @@ void X509_STORE_CTX_set_chain(X509_STORE_CTX *ctx, STACK_OF(X509) *sk)
IMPLEMENT_STACK_OF
(
X509
)
IMPLEMENT_STACK_OF
(
X509
)
IMPLEMENT_ASN1_SET_OF
(
X509
)
IMPLEMENT_ASN1_SET_OF
(
X509
)
IMPLEMENT_STACK_OF
(
X509_NAME
)
IMPLEMENT_STACK_OF
(
X509_NAME
)
IMPLEMENT_STACK_OF
(
X509_ATTRIBUTE
)
IMPLEMENT_STACK_OF
(
X509_ATTRIBUTE
)
IMPLEMENT_ASN1_SET_OF
(
X509_ATTRIBUTE
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录