Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
26f0cf69
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
26f0cf69
编写于
9月 18, 2007
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Constify obj_dat.[ch], as well as minimize linker relocations.
上级
61836c1b
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
2508 addition
and
2504 deletion
+2508
-2504
crypto/objects/obj_dat.c
crypto/objects/obj_dat.c
+27
-23
crypto/objects/obj_dat.h
crypto/objects/obj_dat.h
+2473
-2473
crypto/objects/obj_dat.pl
crypto/objects/obj_dat.pl
+8
-8
未找到文件。
crypto/objects/obj_dat.c
浏览文件 @
26f0cf69
...
@@ -73,11 +73,11 @@
...
@@ -73,11 +73,11 @@
#define NUM_SN 0
#define NUM_SN 0
#define NUM_LN 0
#define NUM_LN 0
#define NUM_OBJ 0
#define NUM_OBJ 0
static
unsigned
char
lvalues
[
1
];
static
const
unsigned
char
lvalues
[
1
];
static
ASN1_OBJECT
nid_objs
[
1
];
static
const
ASN1_OBJECT
nid_objs
[
1
];
static
ASN1_OBJECT
*
sn_objs
[
1
];
static
const
unsigned
int
sn_objs
[
1
];
static
ASN1_OBJECT
*
ln_objs
[
1
];
static
const
unsigned
int
ln_objs
[
1
];
static
ASN1_OBJECT
*
obj_objs
[
1
];
static
const
unsigned
int
obj_objs
[
1
];
#endif
#endif
static
int
sn_cmp
(
const
void
*
a
,
const
void
*
b
);
static
int
sn_cmp
(
const
void
*
a
,
const
void
*
b
);
...
@@ -99,14 +99,16 @@ static LHASH *added=NULL;
...
@@ -99,14 +99,16 @@ static LHASH *added=NULL;
static
int
sn_cmp
(
const
void
*
a
,
const
void
*
b
)
static
int
sn_cmp
(
const
void
*
a
,
const
void
*
b
)
{
{
const
ASN1_OBJECT
*
const
*
ap
=
a
,
*
const
*
bp
=
b
;
const
ASN1_OBJECT
*
const
*
ap
=
a
;
return
(
strcmp
((
*
ap
)
->
sn
,(
*
bp
)
->
sn
));
const
unsigned
int
*
bp
=
b
;
return
(
strcmp
((
*
ap
)
->
sn
,
nid_objs
[
*
bp
].
sn
));
}
}
static
int
ln_cmp
(
const
void
*
a
,
const
void
*
b
)
static
int
ln_cmp
(
const
void
*
a
,
const
void
*
b
)
{
{
const
ASN1_OBJECT
*
const
*
ap
=
a
,
*
const
*
bp
=
b
;
const
ASN1_OBJECT
*
const
*
ap
=
a
;
return
(
strcmp
((
*
ap
)
->
ln
,(
*
bp
)
->
ln
));
const
unsigned
int
*
bp
=
b
;
return
(
strcmp
((
*
ap
)
->
ln
,
nid_objs
[
*
bp
].
ln
));
}
}
/* static unsigned long add_hash(ADDED_OBJ *ca) */
/* static unsigned long add_hash(ADDED_OBJ *ca) */
...
@@ -386,7 +388,7 @@ const char *OBJ_nid2ln(int n)
...
@@ -386,7 +388,7 @@ const char *OBJ_nid2ln(int n)
int
OBJ_obj2nid
(
const
ASN1_OBJECT
*
a
)
int
OBJ_obj2nid
(
const
ASN1_OBJECT
*
a
)
{
{
ASN1_OBJECT
*
*
op
;
const
unsigned
int
*
op
;
ADDED_OBJ
ad
,
*
adp
;
ADDED_OBJ
ad
,
*
adp
;
if
(
a
==
NULL
)
if
(
a
==
NULL
)
...
@@ -401,11 +403,11 @@ int OBJ_obj2nid(const ASN1_OBJECT *a)
...
@@ -401,11 +403,11 @@ int OBJ_obj2nid(const ASN1_OBJECT *a)
adp
=
(
ADDED_OBJ
*
)
lh_retrieve
(
added
,
&
ad
);
adp
=
(
ADDED_OBJ
*
)
lh_retrieve
(
added
,
&
ad
);
if
(
adp
!=
NULL
)
return
(
adp
->
obj
->
nid
);
if
(
adp
!=
NULL
)
return
(
adp
->
obj
->
nid
);
}
}
op
=
(
ASN1_OBJECT
*
*
)
OBJ_bsearch
((
const
char
*
)
&
a
,(
const
char
*
)
obj_objs
,
op
=
(
const
unsigned
int
*
)
OBJ_bsearch
((
const
char
*
)
&
a
,(
const
char
*
)
obj_objs
,
NUM_OBJ
,
sizeof
(
ASN1_OBJECT
*
),
obj_cmp
);
NUM_OBJ
,
sizeof
(
obj_objs
[
0
]
),
obj_cmp
);
if
(
op
==
NULL
)
if
(
op
==
NULL
)
return
(
NID_undef
);
return
(
NID_undef
);
return
(
(
*
op
)
->
nid
);
return
(
nid_objs
[
*
op
].
nid
);
}
}
/* Convert an object name into an ASN1_OBJECT
/* Convert an object name into an ASN1_OBJECT
...
@@ -458,7 +460,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
...
@@ -458,7 +460,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
int
i
,
n
=
0
,
len
,
nid
,
first
,
use_bn
;
int
i
,
n
=
0
,
len
,
nid
,
first
,
use_bn
;
BIGNUM
*
bl
;
BIGNUM
*
bl
;
unsigned
long
l
;
unsigned
long
l
;
unsigned
char
*
p
;
const
unsigned
char
*
p
;
char
tbuf
[
DECIMAL_SIZE
(
i
)
+
DECIMAL_SIZE
(
l
)
+
2
];
char
tbuf
[
DECIMAL_SIZE
(
i
)
+
DECIMAL_SIZE
(
l
)
+
2
];
if
((
a
==
NULL
)
||
(
a
->
data
==
NULL
))
{
if
((
a
==
NULL
)
||
(
a
->
data
==
NULL
))
{
...
@@ -624,8 +626,9 @@ int OBJ_txt2nid(const char *s)
...
@@ -624,8 +626,9 @@ int OBJ_txt2nid(const char *s)
int
OBJ_ln2nid
(
const
char
*
s
)
int
OBJ_ln2nid
(
const
char
*
s
)
{
{
ASN1_OBJECT
o
,
*
oo
=
&
o
,
**
op
;
ASN1_OBJECT
o
,
*
oo
=
&
o
;
ADDED_OBJ
ad
,
*
adp
;
ADDED_OBJ
ad
,
*
adp
;
const
unsigned
int
*
op
;
o
.
ln
=
s
;
o
.
ln
=
s
;
if
(
added
!=
NULL
)
if
(
added
!=
NULL
)
...
@@ -635,16 +638,17 @@ int OBJ_ln2nid(const char *s)
...
@@ -635,16 +638,17 @@ int OBJ_ln2nid(const char *s)
adp
=
(
ADDED_OBJ
*
)
lh_retrieve
(
added
,
&
ad
);
adp
=
(
ADDED_OBJ
*
)
lh_retrieve
(
added
,
&
ad
);
if
(
adp
!=
NULL
)
return
(
adp
->
obj
->
nid
);
if
(
adp
!=
NULL
)
return
(
adp
->
obj
->
nid
);
}
}
op
=
(
ASN1_OBJECT
*
*
)
OBJ_bsearch
((
char
*
)
&
oo
,(
char
*
)
ln_objs
,
NUM_LN
,
op
=
(
const
unsigned
int
*
)
OBJ_bsearch
((
char
*
)
&
oo
,(
char
*
)
ln_objs
,
NUM_LN
,
sizeof
(
ASN1_OBJECT
*
),
ln_cmp
);
sizeof
(
ln_objs
[
0
]
),
ln_cmp
);
if
(
op
==
NULL
)
return
(
NID_undef
);
if
(
op
==
NULL
)
return
(
NID_undef
);
return
(
(
*
op
)
->
nid
);
return
(
nid_objs
[
*
op
].
nid
);
}
}
int
OBJ_sn2nid
(
const
char
*
s
)
int
OBJ_sn2nid
(
const
char
*
s
)
{
{
ASN1_OBJECT
o
,
*
oo
=
&
o
,
**
op
;
ASN1_OBJECT
o
,
*
oo
=
&
o
;
ADDED_OBJ
ad
,
*
adp
;
ADDED_OBJ
ad
,
*
adp
;
const
unsigned
int
*
op
;
o
.
sn
=
s
;
o
.
sn
=
s
;
if
(
added
!=
NULL
)
if
(
added
!=
NULL
)
...
@@ -654,17 +658,17 @@ int OBJ_sn2nid(const char *s)
...
@@ -654,17 +658,17 @@ int OBJ_sn2nid(const char *s)
adp
=
(
ADDED_OBJ
*
)
lh_retrieve
(
added
,
&
ad
);
adp
=
(
ADDED_OBJ
*
)
lh_retrieve
(
added
,
&
ad
);
if
(
adp
!=
NULL
)
return
(
adp
->
obj
->
nid
);
if
(
adp
!=
NULL
)
return
(
adp
->
obj
->
nid
);
}
}
op
=
(
ASN1_OBJECT
*
*
)
OBJ_bsearch
((
char
*
)
&
oo
,(
char
*
)
sn_objs
,
NUM_SN
,
op
=
(
const
unsigned
int
*
)
OBJ_bsearch
((
char
*
)
&
oo
,(
char
*
)
sn_objs
,
NUM_SN
,
sizeof
(
ASN1_OBJECT
*
),
sn_cmp
);
sizeof
(
sn_objs
[
0
]
),
sn_cmp
);
if
(
op
==
NULL
)
return
(
NID_undef
);
if
(
op
==
NULL
)
return
(
NID_undef
);
return
(
(
*
op
)
->
nid
);
return
(
nid_objs
[
*
op
].
nid
);
}
}
static
int
obj_cmp
(
const
void
*
ap
,
const
void
*
bp
)
static
int
obj_cmp
(
const
void
*
ap
,
const
void
*
bp
)
{
{
int
j
;
int
j
;
const
ASN1_OBJECT
*
a
=
*
(
ASN1_OBJECT
*
const
*
)
ap
;
const
ASN1_OBJECT
*
a
=
*
(
ASN1_OBJECT
*
const
*
)
ap
;
const
ASN1_OBJECT
*
b
=
*
(
ASN1_OBJECT
*
const
*
)
bp
;
const
ASN1_OBJECT
*
b
=
&
nid_objs
[
*
((
const
unsigned
int
*
)
bp
)]
;
j
=
(
a
->
length
-
b
->
length
);
j
=
(
a
->
length
-
b
->
length
);
if
(
j
)
return
(
j
);
if
(
j
)
return
(
j
);
...
...
crypto/objects/obj_dat.h
浏览文件 @
26f0cf69
此差异已折叠。
点击以展开。
crypto/objects/obj_dat.pl
浏览文件 @
26f0cf69
...
@@ -148,13 +148,13 @@ for ($i=0; $i<$n; $i++)
...
@@ -148,13 +148,13 @@ for ($i=0; $i<$n; $i++)
@a
=
grep
(
defined
(
$sn
{
$nid
{
$_
}}),
0
..
$n
);
@a
=
grep
(
defined
(
$sn
{
$nid
{
$_
}}),
0
..
$n
);
foreach
(
sort
{
$sn
{
$nid
{
$a
}}
cmp
$sn
{
$nid
{
$b
}}
}
@a
)
foreach
(
sort
{
$sn
{
$nid
{
$a
}}
cmp
$sn
{
$nid
{
$b
}}
}
@a
)
{
{
push
(
@sn
,
sprintf
("
&(nid_objs[%2d]),
/*
\"
$sn
{
$nid
{
$_
}}
\"
*/
\n
",
$_
));
push
(
@sn
,
sprintf
("
%2d,
\t
/*
\"
$sn
{
$nid
{
$_
}}
\"
*/
\n
",
$_
));
}
}
@a
=
grep
(
defined
(
$ln
{
$nid
{
$_
}}),
0
..
$n
);
@a
=
grep
(
defined
(
$ln
{
$nid
{
$_
}}),
0
..
$n
);
foreach
(
sort
{
$ln
{
$nid
{
$a
}}
cmp
$ln
{
$nid
{
$b
}}
}
@a
)
foreach
(
sort
{
$ln
{
$nid
{
$a
}}
cmp
$ln
{
$nid
{
$b
}}
}
@a
)
{
{
push
(
@ln
,
sprintf
("
&(nid_objs[%2d]),
/*
\"
$ln
{
$nid
{
$_
}}
\"
*/
\n
",
$_
));
push
(
@ln
,
sprintf
("
%2d,
\t
/*
\"
$ln
{
$nid
{
$_
}}
\"
*/
\n
",
$_
));
}
}
@a
=
grep
(
defined
(
$obj
{
$nid
{
$_
}}),
0
..
$n
);
@a
=
grep
(
defined
(
$obj
{
$nid
{
$_
}}),
0
..
$n
);
...
@@ -164,7 +164,7 @@ foreach (sort obj_cmp @a)
...
@@ -164,7 +164,7 @@ foreach (sort obj_cmp @a)
$v
=
$objd
{
$m
};
$v
=
$objd
{
$m
};
$v
=~
s/L//g
;
$v
=~
s/L//g
;
$v
=~
s/,/ /g
;
$v
=~
s/,/ /g
;
push
(
@ob
,
sprintf
("
&(nid_objs[%2d]),
/* %-32s %s */
\n
",
$_
,
$m
,
$v
));
push
(
@ob
,
sprintf
("
%2d,
\t
/* %-32s %s */
\n
",
$_
,
$m
,
$v
));
}
}
print
OUT
<<'EOF';
print
OUT
<<'EOF';
...
@@ -239,11 +239,11 @@ printf OUT "#define NUM_SN %d\n",$#sn+1;
...
@@ -239,11 +239,11 @@ printf OUT "#define NUM_SN %d\n",$#sn+1;
printf
OUT
"
#define NUM_LN %d
\n
",
$#ln
+
1
;
printf
OUT
"
#define NUM_LN %d
\n
",
$#ln
+
1
;
printf
OUT
"
#define NUM_OBJ %d
\n\n
",
$#ob
+
1
;
printf
OUT
"
#define NUM_OBJ %d
\n\n
",
$#ob
+
1
;
printf
OUT
"
static unsigned char lvalues[%d]={
\n
",
$lvalues
+
1
;
printf
OUT
"
static
const
unsigned char lvalues[%d]={
\n
",
$lvalues
+
1
;
print
OUT
@lvalues
;
print
OUT
@lvalues
;
print
OUT
"
};
\n\n
";
print
OUT
"
};
\n\n
";
printf
OUT
"
static ASN1_OBJECT nid_objs[NUM_NID]={
\n
";
printf
OUT
"
static
const
ASN1_OBJECT nid_objs[NUM_NID]={
\n
";
foreach
(
@out
)
foreach
(
@out
)
{
{
if
(
length
(
$_
)
>
75
)
if
(
length
(
$_
)
>
75
)
...
@@ -267,15 +267,15 @@ foreach (@out)
...
@@ -267,15 +267,15 @@ foreach (@out)
}
}
print
OUT
"
};
\n\n
";
print
OUT
"
};
\n\n
";
printf
OUT
"
static
ASN1_OBJECT *
sn_objs[NUM_SN]={
\n
";
printf
OUT
"
static
const unsigned int
sn_objs[NUM_SN]={
\n
";
print
OUT
@sn
;
print
OUT
@sn
;
print
OUT
"
};
\n\n
";
print
OUT
"
};
\n\n
";
printf
OUT
"
static
ASN1_OBJECT *
ln_objs[NUM_LN]={
\n
";
printf
OUT
"
static
const unsigned int
ln_objs[NUM_LN]={
\n
";
print
OUT
@ln
;
print
OUT
@ln
;
print
OUT
"
};
\n\n
";
print
OUT
"
};
\n\n
";
printf
OUT
"
static
ASN1_OBJECT *
obj_objs[NUM_OBJ]={
\n
";
printf
OUT
"
static
const unsigned int
obj_objs[NUM_OBJ]={
\n
";
print
OUT
@ob
;
print
OUT
@ob
;
print
OUT
"
};
\n\n
";
print
OUT
"
};
\n\n
";
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录