Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
1ad90a91
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,发现更多精彩内容 >>
提交
1ad90a91
编写于
2月 11, 2008
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Extend attribute setting routines to support non-string types.
上级
8ab9025e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
3 deletion
+37
-3
crypto/asn1/a_type.c
crypto/asn1/a_type.c
+28
-1
crypto/asn1/asn1.h
crypto/asn1/asn1.h
+1
-0
crypto/x509/x509_att.c
crypto/x509/x509_att.c
+8
-2
未找到文件。
crypto/asn1/a_type.c
浏览文件 @
1ad90a91
...
...
@@ -77,9 +77,36 @@ void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value)
ASN1_primitive_free
((
ASN1_VALUE
**
)
tmp_a
,
NULL
);
}
a
->
type
=
type
;
a
->
value
.
ptr
=
value
;
if
(
type
==
V_ASN1_BOOLEAN
)
a
->
value
.
boolean
=
value
?
0xff
:
0
;
else
a
->
value
.
ptr
=
value
;
}
int
ASN1_TYPE_set1
(
ASN1_TYPE
*
a
,
int
type
,
const
void
*
value
)
{
if
(
!
value
||
(
type
==
V_ASN1_BOOLEAN
))
{
ASN1_TYPE_set
(
a
,
type
,
(
void
*
)
value
);
}
else
if
(
type
==
V_ASN1_OBJECT
)
{
ASN1_OBJECT
*
odup
;
odup
=
OBJ_dup
(
value
);
if
(
!
odup
)
return
0
;
ASN1_TYPE_set
(
a
,
type
,
odup
);
}
else
{
ASN1_STRING
*
sdup
;
sdup
=
ASN1_STRING_dup
(
sdup
);
if
(
!
sdup
)
return
0
;
ASN1_TYPE_set
(
a
,
type
,
sdup
);
}
return
1
;
}
IMPLEMENT_STACK_OF
(
ASN1_TYPE
)
IMPLEMENT_ASN1_SET_OF
(
ASN1_TYPE
)
...
...
crypto/asn1/asn1.h
浏览文件 @
1ad90a91
...
...
@@ -759,6 +759,7 @@ DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
int
ASN1_TYPE_get
(
ASN1_TYPE
*
a
);
void
ASN1_TYPE_set
(
ASN1_TYPE
*
a
,
int
type
,
void
*
value
);
int
ASN1_TYPE_set1
(
ASN1_TYPE
*
a
,
int
type
,
const
void
*
value
);
int
ASN1_TYPE_cmp
(
ASN1_TYPE
*
a
,
ASN1_TYPE
*
b
);
ASN1_OBJECT
*
ASN1_OBJECT_new
(
void
);
...
...
crypto/x509/x509_att.c
浏览文件 @
1ad90a91
...
...
@@ -281,16 +281,22 @@ int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *dat
return
0
;
}
atype
=
stmp
->
type
;
}
else
{
}
else
if
(
len
!=
-
1
)
{
if
(
!
(
stmp
=
ASN1_STRING_type_new
(
attrtype
)))
goto
err
;
if
(
!
ASN1_STRING_set
(
stmp
,
data
,
len
))
goto
err
;
atype
=
attrtype
;
}
if
(
!
(
attr
->
value
.
set
=
sk_ASN1_TYPE_new_null
()))
goto
err
;
if
(
!
(
ttmp
=
ASN1_TYPE_new
()))
goto
err
;
if
(
len
==
-
1
)
{
if
(
!
ASN1_TYPE_set1
(
ttmp
,
attrtype
,
data
))
goto
err
;
}
else
ASN1_TYPE_set
(
ttmp
,
atype
,
stmp
);
if
(
!
sk_ASN1_TYPE_push
(
attr
->
value
.
set
,
ttmp
))
goto
err
;
attr
->
single
=
0
;
ASN1_TYPE_set
(
ttmp
,
atype
,
stmp
);
return
1
;
err:
X509err
(
X509_F_X509_ATTRIBUTE_SET1_DATA
,
ERR_R_MALLOC_FAILURE
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录