Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
d4ac959d
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d4ac959d
编写于
4月 08, 2009
作者:
W
weijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
4811968: ASN.1 (X509Certificate) implementations don't handle large OID components
Reviewed-by: xuelei
上级
dcf31cd6
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
730 addition
and
286 deletion
+730
-286
src/share/classes/sun/security/util/ObjectIdentifier.java
src/share/classes/sun/security/util/ObjectIdentifier.java
+484
-283
test/sun/security/util/Oid/OidFormat.java
test/sun/security/util/Oid/OidFormat.java
+16
-3
test/sun/security/util/Oid/S11N.sh
test/sun/security/util/Oid/S11N.sh
+164
-0
test/sun/security/util/Oid/SerialTest.java
test/sun/security/util/Oid/SerialTest.java
+66
-0
未找到文件。
src/share/classes/sun/security/util/ObjectIdentifier.java
浏览文件 @
d4ac959d
此差异已折叠。
点击以展开。
test/sun/security/util/Oid/OidFormat.java
浏览文件 @
d4ac959d
...
...
@@ -63,9 +63,22 @@ public class OidFormat {
"1.2.3"
,
"1.2.3445"
,
"1.3.6.1.4.1.42.2.17"
,
// 4811968: ASN.1 cannot handle huge OID components
//"2.16.764.1.3101555394.1.0.100.2.1",
//"1.2.2147483647.4",
//"1.2.268435456.4",
"2.16.764.1.3101555394.1.0.100.2.1"
,
"2.2726957624935694386592435"
,
// as huge as possible
"1.2.777777777777777777"
,
"1.2.888888888888888888.111111111111111.2222222222222.33333333333333333.44444444444444"
,
"1.2."
+
"1111111111111111111111111111111111111111111111111111111111111."
+
"2222222222222222222222222222222222222222222222222222222222222222."
+
"333333333333333333333333333333333333333333333333333333333333333."
+
"4444444444444444444444444444444444444444444444444444444."
+
"55555555555555555555555555555555555555555555555555555555555555555555555."
+
"666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666."
+
"77777777777777777777777777777777777777777777777777777777777777777777777777."
+
"8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888."
+
"9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999"
,
"1.2.2147483647.4"
,
"1.2.268435456.4"
,
};
for
(
String
s:
goodOids
)
{
...
...
test/sun/security/util/Oid/S11N.sh
0 → 100644
浏览文件 @
d4ac959d
#
# Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
# @test
# @bug 4811968
# @summary Serialization compatibility with old versions
# @author Weijun Wang
#
# set a few environment variables so that the shell-script can run stand-alone
# in the source directory
if
[
"
${
TESTSRC
}
"
=
""
]
;
then
TESTSRC
=
"."
fi
if
[
"
${
TESTCLASSES
}
"
=
""
]
;
then
TESTCLASSES
=
"."
fi
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
echo
"TESTJAVA not set. Test cannot execute."
echo
"FAILED!!!"
exit
1
fi
# set platform-dependent variables
PF
=
""
OS
=
`
uname
-s
`
case
"
$OS
"
in
SunOS
)
FS
=
"/"
ARCH
=
`
isainfo
`
case
"
$ARCH
"
in
sparc
*
)
PF
=
"solaris-sparc"
;;
i[3-6]86
)
PF
=
"solaris-i586"
;;
amd64
*
)
PF
=
"solaris-amd64"
;;
*
)
echo
"Unsupported System: Solaris
${
ARCH
}
"
exit
0
;
;;
esac
;;
Linux
)
ARCH
=
`
uname
-m
`
FS
=
"/"
case
"
$ARCH
"
in
i[3-6]86
)
PF
=
"linux-i586"
;;
amd64
*
)
PF
=
"linux-amd64"
;;
*
)
echo
"Unsupported System: Linux
${
ARCH
}
"
exit
0
;
;;
esac
;;
Windows
*
)
FS
=
"
\\
"
PF
=
"windows-i586"
# 'uname -m' does not give us enough information -
# should rely on $PROCESSOR_IDENTIFIER (as is done in Defs-windows.gmk),
# but JTREG does not pass this env variable when executing a shell script.
#
# execute test program - rely on it to exit if platform unsupported
;;
*
)
echo
"Unsupported System:
${
OS
}
"
exit
0
;
;;
esac
# the test code
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
-source
1.3
-target
1.3
-d
.
${
TESTSRC
}${
FS
}
SerialTest.java
||
exit
10
OLDJAVA
=
"
/java/re/j2se/1.6.0/latest/binaries/
${
PF
}
/java/re/j2se/1.5.0/latest/binaries/
${
PF
}
/java/re/j2se/1.4.2/latest/binaries/
${
PF
}
"
SMALL
=
"
0.0
1.1
2.2
1.2.3456
1.2.2147483647.4
1.2.268435456.4
"
HUGE
=
"
2.16.764.1.3101555394.1.0.100.2.1
1.2.2147483648.4
2.3.4444444444444444444444
1.2.888888888888888888.111111111111111.2222222222222.33333333333333333.44444444444444
"
for
oid
in
${
SMALL
}
;
do
echo
${
oid
}
# new ->
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java SerialTest out
${
oid
}
>
tmp.oid.serial
||
exit
1
# -> new
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java SerialTest
in
${
oid
}
< tmp.oid.serial
||
exit
2
for
oldj
in
${
OLDJAVA
}
;
do
if
[
-d
${
oldj
}
]
;
then
echo
${
oldj
}
# -> old
${
oldj
}${
FS
}
bin
${
FS
}
java SerialTest
in
${
oid
}
< tmp.oid.serial
||
exit
3
# old ->
${
oldj
}${
FS
}
bin
${
FS
}
java SerialTest out
${
oid
}
>
tmp.oid.serial.old
||
exit
4
# -> new
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java SerialTest
in
${
oid
}
< tmp.oid.serial.old
||
exit
5
fi
done
done
for
oid
in
${
HUGE
}
;
do
echo
${
oid
}
# new ->
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java SerialTest out
${
oid
}
>
tmp.oid.serial
||
exit
1
# -> new
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java SerialTest
in
${
oid
}
< tmp.oid.serial
||
exit
2
for
oldj
in
${
OLDJAVA
}
;
do
if
[
-d
${
oldj
}
]
;
then
echo
${
oldj
}
# -> old
${
oldj
}${
FS
}
bin
${
FS
}
java SerialTest badin < tmp.oid.serial
||
exit
3
fi
done
done
rm
-f
tmp.oid.serial
rm
-f
tmp.oid.serial.old
rm
-f
SerialTest.class
exit
0
test/sun/security/util/Oid/SerialTest.java
0 → 100644
浏览文件 @
d4ac959d
/*
* Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* read S11.sh
*/
import
java.io.*
;
import
sun.security.util.*
;
/**
* Test OID serialization between versions
*
* java SerialTest out oid // write a OID into System.out
* java SerialTest in oid // read from System.in and compare it with oid
* java SerialTest badin // make sure *cannot* read from System.in
*/
class
SerialTest
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
if
(
args
[
0
].
equals
(
"out"
))
out
(
args
[
1
]);
else
if
(
args
[
0
].
equals
(
"in"
))
in
(
args
[
1
]);
else
badin
();
}
static
void
in
(
String
oid
)
throws
Exception
{
ObjectIdentifier
o
=
(
ObjectIdentifier
)
(
new
ObjectInputStream
(
System
.
in
).
readObject
());
if
(!
o
.
toString
().
equals
(
oid
))
throw
new
Exception
(
"Read Fail "
+
o
+
", not "
+
oid
);
}
static
void
badin
()
throws
Exception
{
boolean
pass
=
true
;
try
{
new
ObjectInputStream
(
System
.
in
).
readObject
();
}
catch
(
Exception
e
)
{
pass
=
false
;
}
if
(
pass
)
throw
new
Exception
(
"Should fail but not"
);
}
static
void
out
(
String
oid
)
throws
Exception
{
new
ObjectOutputStream
(
System
.
out
).
writeObject
(
new
ObjectIdentifier
(
oid
));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录