Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
5e8e7751
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看板
提交
5e8e7751
编写于
9月 05, 2009
作者:
A
asaha
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
535de969
d2e58640
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
170 addition
and
57 deletion
+170
-57
src/share/classes/java/lang/Character.java
src/share/classes/java/lang/Character.java
+3
-3
src/share/classes/sun/security/tools/JarSigner.java
src/share/classes/sun/security/tools/JarSigner.java
+24
-9
src/share/classes/sun/security/x509/AlgorithmId.java
src/share/classes/sun/security/x509/AlgorithmId.java
+13
-1
test/java/lang/reflect/Generics/Probe.java
test/java/lang/reflect/Generics/Probe.java
+25
-44
test/sun/security/tools/jarsigner/nameclash.sh
test/sun/security/tools/jarsigner/nameclash.sh
+66
-0
test/sun/security/x509/AlgorithmId/SHA256withECDSA.java
test/sun/security/x509/AlgorithmId/SHA256withECDSA.java
+39
-0
未找到文件。
src/share/classes/java/lang/Character.java
浏览文件 @
5e8e7751
...
...
@@ -2587,9 +2587,9 @@ class Character extends Object implements java.io.Serializable, Comparable<Chara
* significantly better space and time performance by caching
* frequently requested values.
*
* This method will always cache values in the range
'\u0000'
*
to '\u007f'", inclusive, and may cache other values outside
* of this range.
* This method will always cache values in the range
{@code
*
'\u005Cu0000'} to {@code '\u005Cu007f'}, inclusive, and may
*
cache other values outside
of this range.
*
* @param c a char value.
* @return a <tt>Character</tt> instance representing <tt>c</tt>.
...
...
src/share/classes/sun/security/tools/JarSigner.java
浏览文件 @
5e8e7751
...
...
@@ -1978,20 +1978,35 @@ public class JarSigner {
String
[]
base64Digests
=
getDigests
(
ze
,
zf
,
digests
,
encoder
);
for
(
int
i
=
0
;
i
<
digests
.
length
;
i
++)
{
String
name
=
digests
[
i
].
getAlgorithm
()+
"-Digest"
;
String
mfDigest
=
attrs
.
getValue
(
name
);
if
(
mfDigest
==
null
&&
digests
[
i
].
getAlgorithm
().
equalsIgnoreCase
(
"SHA"
))
{
// treat "SHA" and "SHA1" the same
mfDigest
=
attrs
.
getValue
(
"SHA-Digest"
);
}
if
(
mfDigest
==
null
)
{
// compute digest and add it to list of attributes
// The entry name to be written into attrs
String
name
=
null
;
try
{
// Find if the digest already exists
AlgorithmId
aid
=
AlgorithmId
.
get
(
digests
[
i
].
getAlgorithm
());
for
(
Object
key:
attrs
.
keySet
())
{
if
(
key
instanceof
Attributes
.
Name
)
{
String
n
=
((
Attributes
.
Name
)
key
).
toString
();
if
(
n
.
toUpperCase
(
Locale
.
ENGLISH
).
endsWith
(
"-DIGEST"
))
{
String
tmp
=
n
.
substring
(
0
,
n
.
length
()
-
7
);
if
(
AlgorithmId
.
get
(
tmp
).
equals
(
aid
))
{
name
=
n
;
break
;
}
}
}
}
}
catch
(
NoSuchAlgorithmException
nsae
)
{
// Ignored. Writing new digest entry.
}
if
(
name
==
null
)
{
name
=
digests
[
i
].
getAlgorithm
()+
"-Digest"
;
attrs
.
putValue
(
name
,
base64Digests
[
i
]);
update
=
true
;
}
else
{
// compare digests, and replace the one in the manifest
// if they are different
String
mfDigest
=
attrs
.
getValue
(
name
);
if
(!
mfDigest
.
equalsIgnoreCase
(
base64Digests
[
i
]))
{
attrs
.
putValue
(
name
,
base64Digests
[
i
]);
update
=
true
;
...
...
src/share/classes/sun/security/x509/AlgorithmId.java
浏览文件 @
5e8e7751
/*
* Copyright 1996-200
6
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1996-200
9
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
...
...
@@ -531,6 +531,18 @@ public class AlgorithmId implements Serializable, DerEncoder {
||
name
.
equalsIgnoreCase
(
"ECDSA"
))
{
return
AlgorithmId
.
sha1WithECDSA_oid
;
}
if
(
name
.
equalsIgnoreCase
(
"SHA224withECDSA"
))
{
return
AlgorithmId
.
sha224WithECDSA_oid
;
}
if
(
name
.
equalsIgnoreCase
(
"SHA256withECDSA"
))
{
return
AlgorithmId
.
sha256WithECDSA_oid
;
}
if
(
name
.
equalsIgnoreCase
(
"SHA384withECDSA"
))
{
return
AlgorithmId
.
sha384WithECDSA_oid
;
}
if
(
name
.
equalsIgnoreCase
(
"SHA512withECDSA"
))
{
return
AlgorithmId
.
sha512WithECDSA_oid
;
}
// See if any of the installed providers supply a mapping from
// the given algorithm name to an OID string
...
...
test/java/lang/reflect/Generics/Probe.java
浏览文件 @
5e8e7751
...
...
@@ -23,11 +23,9 @@
/*
* @test
* @bug 5003916 6704655
* @bug 5003916 6704655
6873951
* @summary Testing parsing of signatures attributes of nested classes
* @author Joseph D. Darcy
* @compile -source 1.5 Probe.java
* @run main Probe
*/
import
java.lang.reflect.*
;
...
...
@@ -35,51 +33,35 @@ import java.lang.annotation.*;
import
java.util.*
;
import
static
java
.
util
.
Arrays
.*;
@Classes
(
value
={
"java.util.concurrent.FutureTask"
,
"java.util.concurrent.ConcurrentHashMap$EntryIterator"
,
"java.util.concurrent.ConcurrentHashMap$KeyIterator"
,
"java.util.concurrent.ConcurrentHashMap$ValueIterator"
,
"java.util.AbstractList$ListItr"
,
"java.util.EnumMap$EntryIterator"
,
"java.util.EnumMap$KeyIterator"
,
"java.util.EnumMap$ValueIterator"
,
"java.util.IdentityHashMap$EntryIterator"
,
"java.util.IdentityHashMap$KeyIterator"
,
"java.util.IdentityHashMap$ValueIterator"
,
"java.util.WeakHashMap$EntryIterator"
,
"java.util.WeakHashMap$KeyIterator"
,
"java.util.WeakHashMap$ValueIterator"
,
"java.util.TreeMap$EntryIterator"
,
"java.util.TreeMap$KeyIterator"
,
"java.util.TreeMap$ValueIterator"
,
"java.util.HashMap$EntryIterator"
,
"java.util.HashMap$KeyIterator"
,
"java.util.HashMap$ValueIterator"
,
"java.util.LinkedHashMap$EntryIterator"
,
"java.util.LinkedHashMap$KeyIterator"
,
"java.util.LinkedHashMap$ValueIterator"
},
sunClasses
={
"javax.crypto.SunJCE_c"
,
"javax.crypto.SunJCE_e"
,
"javax.crypto.SunJCE_f"
,
"javax.crypto.SunJCE_j"
,
"javax.crypto.SunJCE_k"
,
"javax.crypto.SunJCE_l"
})
@Classes
({
"java.util.concurrent.FutureTask"
,
"java.util.concurrent.ConcurrentHashMap$EntryIterator"
,
"java.util.concurrent.ConcurrentHashMap$KeyIterator"
,
"java.util.concurrent.ConcurrentHashMap$ValueIterator"
,
"java.util.AbstractList$ListItr"
,
"java.util.EnumMap$EntryIterator"
,
"java.util.EnumMap$KeyIterator"
,
"java.util.EnumMap$ValueIterator"
,
"java.util.IdentityHashMap$EntryIterator"
,
"java.util.IdentityHashMap$KeyIterator"
,
"java.util.IdentityHashMap$ValueIterator"
,
"java.util.WeakHashMap$EntryIterator"
,
"java.util.WeakHashMap$KeyIterator"
,
"java.util.WeakHashMap$ValueIterator"
,
"java.util.TreeMap$EntryIterator"
,
"java.util.TreeMap$KeyIterator"
,
"java.util.TreeMap$ValueIterator"
,
"java.util.HashMap$EntryIterator"
,
"java.util.HashMap$KeyIterator"
,
"java.util.HashMap$ValueIterator"
,
"java.util.LinkedHashMap$EntryIterator"
,
"java.util.LinkedHashMap$KeyIterator"
,
"java.util.LinkedHashMap$ValueIterator"
})
public
class
Probe
{
public
static
void
main
(
String
[]
args
)
throws
Throwable
{
public
static
void
main
(
String
...
args
)
throws
Throwable
{
Classes
classesAnnotation
=
(
Probe
.
class
).
getAnnotation
(
Classes
.
class
);
List
<
String
>
names
=
new
ArrayList
<
String
>(
asList
(
classesAnnotation
.
value
()));
if
(
System
.
getProperty
(
"java.runtime.name"
).
startsWith
(
"Java(TM)"
))
{
// Sun production JDK; test crypto classes too
for
(
String
name:
classesAnnotation
.
sunClasses
())
names
.
add
(
name
);
}
int
errs
=
0
;
for
(
String
name:
names
)
{
System
.
out
.
println
(
"\nCLASS "
+
name
);
...
...
@@ -152,5 +134,4 @@ public class Probe {
@Retention
(
RetentionPolicy
.
RUNTIME
)
@interface
Classes
{
String
[]
value
();
// list of classes to probe
String
[]
sunClasses
();
// list of Sun-production JDK specific classes to probe
}
test/sun/security/tools/jarsigner/nameclash.sh
0 → 100644
浏览文件 @
5e8e7751
#
# Copyright 2009 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 6876328
# @summary different names for the same digest algorithms breaks jarsigner
#
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
JAVAC_CMD
=
`
which javac
`
TESTJAVA
=
`
dirname
$JAVAC_CMD
`
/..
fi
# set platform-dependent variables
OS
=
`
uname
-s
`
case
"
$OS
"
in
Windows_
*
)
FS
=
"
\\
"
;;
*
)
FS
=
"/"
;;
esac
KS
=
nc.jks
JFILE
=
nc.jar
KT
=
"
$TESTJAVA
${
FS
}
bin
${
FS
}
keytool -storepass changeit -keypass changeit -keystore
$KS
"
JAR
=
$TESTJAVA
${
FS
}
bin
${
FS
}
jar
JARSIGNER
=
$TESTJAVA
${
FS
}
bin
${
FS
}
jarsigner
rm
$KS
$JFILE
$KT
-alias
a
-dname
CN
=
a
-keyalg
rsa
-genkey
-validity
300
$KT
-alias
b
-dname
CN
=
b
-keyalg
rsa
-genkey
-validity
300
echo
A
>
A
$JAR
cvf
$JFILE
A
$JARSIGNER
-keystore
$KS
-storepass
changeit
$JFILE
a
-digestalg
SHA1
||
exit
1
$JARSIGNER
-keystore
$KS
-storepass
changeit
$JFILE
b
-digestalg
SHA-1
||
exit
2
$JARSIGNER
-keystore
$KS
-verify
-debug
-strict
$JFILE
||
exit
3
exit
0
test/sun/security/x509/AlgorithmId/SHA256withECDSA.java
0 → 100644
浏览文件 @
5e8e7751
/*
* Copyright 2009 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 6871847
* @summary AlgorithmId.get("SHA256withECDSA") not available
*/
import
sun.security.x509.*
;
public
class
SHA256withECDSA
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
AlgorithmId
.
get
(
"SHA224withECDSA"
);
AlgorithmId
.
get
(
"SHA256withECDSA"
);
AlgorithmId
.
get
(
"SHA384withECDSA"
);
AlgorithmId
.
get
(
"SHA512withECDSA"
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录