Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
a785abc3
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
9
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看板
提交
a785abc3
编写于
9月 07, 1999
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
New function to convert ASN1 tag values to strings. Also fix typo in asn1.h
上级
092ec334
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
49 deletion
+28
-49
CHANGES
CHANGES
+4
-0
crypto/asn1/asn1.h
crypto/asn1/asn1.h
+2
-1
crypto/asn1/asn1_par.c
crypto/asn1/asn1_par.c
+22
-48
未找到文件。
CHANGES
浏览文件 @
a785abc3
...
...
@@ -4,6 +4,10 @@
Changes between 0.9.4 and 0.9.5 [xx XXX 1999]
*) New function ANS1_tag2str() to convert an ASN1 tag to a descriptive
ASCII string. This was handled independently in various places before.
[Steve Henson]
*) New functions UTF8_getc() and UTF8_putc() that parse and generate
UTF8 strings a character at a time.
[Steve Henson]
...
...
crypto/asn1/asn1.h
浏览文件 @
a785abc3
...
...
@@ -379,7 +379,7 @@ typedef struct asn1_header_st
(ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\
((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING)
#define ASN1_T61STRING_new() (ASN1_T61STRING
_STRING
*)\
#define ASN1_T61STRING_new() (ASN1_T61STRING *)\
ASN1_STRING_type_new(V_ASN1_T61STRING)
#define ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
#define M_i2d_ASN1_T61STRING(a,pp) \
...
...
@@ -658,6 +658,7 @@ int ASN1_TIME_print(BIO *fp,ASN1_TIME *a);
int
ASN1_STRING_print
(
BIO
*
bp
,
ASN1_STRING
*
v
);
int
ASN1_parse
(
BIO
*
bp
,
unsigned
char
*
pp
,
long
len
,
int
indent
);
#endif
const
char
*
ASN1_tag2str
(
int
tag
);
/* Used to load and write netscape format cert/key */
int
i2d_ASN1_HEADER
(
ASN1_HEADER
*
a
,
unsigned
char
**
pp
);
...
...
crypto/asn1/asn1_par.c
浏览文件 @
a785abc3
...
...
@@ -93,55 +93,8 @@ static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
sprintf
(
str
,
"cont [ %d ]"
,
tag
);
else
if
((
xclass
&
V_ASN1_APPLICATION
)
==
V_ASN1_APPLICATION
)
sprintf
(
str
,
"appl [ %d ]"
,
tag
);
else
if
((
tag
==
V_ASN1_EOC
)
/* && (xclass == V_ASN1_UNIVERSAL) */
)
p
=
"EOC"
;
else
if
(
tag
==
V_ASN1_BOOLEAN
)
p
=
"BOOLEAN"
;
else
if
(
tag
==
V_ASN1_INTEGER
)
p
=
"INTEGER"
;
else
if
(
tag
==
V_ASN1_ENUMERATED
)
p
=
"ENUMERATED"
;
else
if
(
tag
==
V_ASN1_BIT_STRING
)
p
=
"BIT STRING"
;
else
if
(
tag
==
V_ASN1_OCTET_STRING
)
p
=
"OCTET STRING"
;
else
if
(
tag
==
V_ASN1_NULL
)
p
=
"NULL"
;
else
if
(
tag
==
V_ASN1_OBJECT
)
p
=
"OBJECT"
;
else
if
(
tag
==
V_ASN1_SEQUENCE
)
p
=
"SEQUENCE"
;
else
if
(
tag
==
V_ASN1_SET
)
p
=
"SET"
;
else
if
(
tag
==
V_ASN1_PRINTABLESTRING
)
p
=
"PRINTABLESTRING"
;
else
if
(
tag
==
V_ASN1_T61STRING
)
p
=
"T61STRING"
;
else
if
(
tag
==
V_ASN1_IA5STRING
)
p
=
"IA5STRING"
;
else
if
(
tag
==
V_ASN1_UTCTIME
)
p
=
"UTCTIME"
;
else
p
=
ASN1_tag2str
(
tag
);
/* extras */
else
if
(
tag
==
V_ASN1_NUMERICSTRING
)
p
=
"NUMERICSTRING"
;
else
if
(
tag
==
V_ASN1_VIDEOTEXSTRING
)
p
=
"VIDEOTEXSTRING"
;
else
if
(
tag
==
V_ASN1_GENERALIZEDTIME
)
p
=
"GENERALIZEDTIME"
;
else
if
(
tag
==
V_ASN1_GRAPHICSTRING
)
p
=
"GRAPHICSTRING"
;
else
if
(
tag
==
V_ASN1_VISIBLESTRING
)
p
=
"VISIBLESTRING"
;
else
if
(
tag
==
V_ASN1_GENERALSTRING
)
p
=
"GENERALSTRING"
;
else
if
(
tag
==
V_ASN1_UNIVERSALSTRING
)
p
=
"UNIVERSALSTRING"
;
else
if
(
tag
==
V_ASN1_BMPSTRING
)
p
=
"BMPSTRING"
;
else
p2
=
"(unknown)"
;
if
(
p2
!=
NULL
)
{
if
(
BIO_printf
(
bp
,
fmt2
,
tag
,
p2
)
<=
0
)
goto
err
;
...
...
@@ -409,3 +362,24 @@ end:
*
pp
=
p
;
return
(
ret
);
}
const
char
*
ASN1_tag2str
(
int
tag
)
{
const
static
char
*
tag2str
[]
=
{
"EOC"
,
"BOOLEAN"
,
"INTEGER"
,
"BIT STRING"
,
"OCTET STRING"
,
/* 0-4 */
"NULL"
,
"OBJECT"
,
"OBJECT DESCRIPTOR"
,
"EXTERNAL"
,
"REAL"
,
/* 5-9 */
"ENUMERATED"
,
"<ASN1 11>"
,
"UTF8STRING"
,
"<ASN1 13>"
,
/* 10-13 */
"<ASN1 14>"
,
"<ASN1 15>"
,
"SEQUENCE"
,
"SET"
,
/* 15-17 */
"NUMERICSTRING"
,
"PRINTABLESTRING"
,
"T61STRING"
,
/* 18-20 */
"VIDEOTEXSTRING"
,
"IA5STRING"
,
"UTCTIME"
"GENERALIZEDTIME"
,
/* 21-24 */
"GRAPHICSTRING"
,
"VISIBLESTRING"
,
"GENERALSTRING"
,
/* 25-27 */
"UNIVERSALSTRING"
,
"<ASN1 29>"
,
"BMPSTRING"
/* 28-30 */
};
if
((
tag
==
V_ASN1_NEG_INTEGER
)
||
(
tag
==
V_ASN1_NEG_ENUMERATED
))
tag
&=
~
0x100
;
if
(
tag
<
0
||
tag
>
30
)
return
"(unknown)"
;
return
tag2str
[
tag
];
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录