Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
e9fc2bc5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e9fc2bc5
编写于
6月 20, 2011
作者:
W
weijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7054918: jdk_security1 test target cleanup
Reviewed-by: alanb, smarks, vinnie
上级
4969a1ad
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
276 addition
and
154 deletion
+276
-154
test/ProblemList.txt
test/ProblemList.txt
+0
-25
test/java/security/BasicPermission/PermClass.java
test/java/security/BasicPermission/PermClass.java
+46
-39
test/java/security/BasicPermission/SerialVersion.java
test/java/security/BasicPermission/SerialVersion.java
+26
-22
test/java/security/KeyFactory/Failover.java
test/java/security/KeyFactory/Failover.java
+12
-2
test/java/security/KeyPairGenerator/Failover.java
test/java/security/KeyPairGenerator/Failover.java
+12
-2
test/java/security/Provider/ChangeProviders.java
test/java/security/Provider/ChangeProviders.java
+12
-2
test/java/security/Provider/GetInstance.java
test/java/security/Provider/GetInstance.java
+12
-2
test/java/security/Provider/RemoveProvider.java
test/java/security/Provider/RemoveProvider.java
+12
-2
test/java/security/Provider/Turkish.java
test/java/security/Provider/Turkish.java
+49
-45
test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
+5
-1
test/java/security/Security/NoInstalledProviders.java
test/java/security/Security/NoInstalledProviders.java
+13
-3
test/java/security/Security/SynchronizedAccess.java
test/java/security/Security/SynchronizedAccess.java
+13
-3
test/java/security/Security/removing/RemoveProviders.java
test/java/security/Security/removing/RemoveProviders.java
+12
-2
test/java/security/UnresolvedPermission/Equals.java
test/java/security/UnresolvedPermission/Equals.java
+2
-1
test/java/security/spec/EllipticCurveMatch.java
test/java/security/spec/EllipticCurveMatch.java
+2
-3
test/java/security/testlibrary/ProvidersSnapshot.java
test/java/security/testlibrary/ProvidersSnapshot.java
+48
-0
未找到文件。
test/ProblemList.txt
浏览文件 @
e9fc2bc5
...
...
@@ -502,10 +502,6 @@ sun/security/pkcs11/ec/TestECDSA.java solaris-i586
sun/security/pkcs11/ec/TestECGenSpec.java solaris-i586
sun/security/pkcs11/ec/TestKeyFactory.java solaris-i586
# Unknown problem, could be a jtreg -samevm issue?
# Error while cleaning up threads after test
java/security/Security/SynchronizedAccess.java generic-all
# Failing on Solaris X64 (-d64 -server) with:
# GSSException: Failure unspecified at GSS-API level
# (Mechanism level: Specified version of key is not available (44))
...
...
@@ -600,27 +596,6 @@ sun/security/tools/keytool/emptysubject.sh generic-all
# Timeout on solaris-sparcv9 or exception thrown
com/sun/crypto/provider/Cipher/RSA/TestOAEP_KAT.java solaris-all
# Leaving file open: SerialVersion.current, windows samevm
java/security/BasicPermission/SerialVersion.java generic-all
# Solaris 11 i586, these all fail with samevm, need to be othervm???
java/security/BasicPermission/NullOrEmptyName.java generic-all
# Suspect missing close() on file PermClass.current, windows samevm cascade
java/security/BasicPermission/PermClass.java generic-all
# Solaris 11 i586, these all fail with samevm, need to be othervm???
java/security/KeyPairGenerator/Failover.java generic-all
java/security/Provider/DefaultPKCS11.java generic-all
java/security/SecureRandom/GetAlgorithm.java generic-all
java/security/Security/removing/RemoveProviders.java generic-all
java/security/Signature/ByteBuffers.java generic-all
java/security/Signature/NONEwithRSA.java generic-all
java/security/Signature/SignWithOutputBuffer.java generic-all
java/security/Signature/TestInitSignWithMyOwnRandom.java generic-all
java/security/UnresolvedPermission/AccessorMethods.java generic-all
java/security/UnresolvedPermission/Equals.java generic-all
# Fails on OpenSolaris, missing classes, slow on Solaris sparc
sun/security/ec/TestEC.java generic-all
...
...
test/java/security/BasicPermission/PermClass.java
浏览文件 @
e9fc2bc5
/*
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001,
2011,
Oracle and/or its affiliates. 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
...
...
@@ -23,7 +23,7 @@
/*
* @test
* @bug 4511601
* @bug 4511601
7054918
* @summary BasicPermissionCollection does not set permClass
* during deserialization
*/
...
...
@@ -55,59 +55,66 @@ public class PermClass {
// read in a 1.2.1 BasicPermissionCollection
File
sFile
=
new
File
(
dir
,
"PermClass.1.2.1"
);
ObjectInputStream
ois
=
new
ObjectInputStream
(
new
FileInputStream
(
sFile
));
PermissionCollection
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"1.2.1 collection = "
+
pc
);
if
(
pc
.
implies
(
mp
))
{
System
.
out
.
println
(
"JDK 1.2.1 test passed"
);
}
else
{
throw
new
Exception
(
"JDK 1.2.1 test failed"
);
try
(
FileInputStream
fis
=
new
FileInputStream
(
sFile
);
ObjectInputStream
ois
=
new
ObjectInputStream
(
fis
))
{
PermissionCollection
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"1.2.1 collection = "
+
pc
);
if
(
pc
.
implies
(
mp
))
{
System
.
out
.
println
(
"JDK 1.2.1 test passed"
);
}
else
{
throw
new
Exception
(
"JDK 1.2.1 test failed"
);
}
}
// read in a 1.3.1 BasicPermissionCollection
sFile
=
new
File
(
dir
,
"PermClass.1.3.1"
);
ois
=
new
ObjectInputStream
(
new
FileInputStream
(
sFile
));
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"1.3.1 collection = "
+
pc
);
if
(
pc
.
implies
(
mp
))
{
System
.
out
.
println
(
"JDK 1.3.1 test passed"
);
}
else
{
throw
new
Exception
(
"JDK 1.3.1 test failed"
);
try
(
FileInputStream
fis
=
new
FileInputStream
(
sFile
);
ObjectInputStream
ois
=
new
ObjectInputStream
(
fis
))
{
PermissionCollection
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"1.3.1 collection = "
+
pc
);
if
(
pc
.
implies
(
mp
))
{
System
.
out
.
println
(
"JDK 1.3.1 test passed"
);
}
else
{
throw
new
Exception
(
"JDK 1.3.1 test failed"
);
}
}
// read in a 1.4 BasicPermissionCollection
sFile
=
new
File
(
dir
,
"PermClass.1.4"
);
ois
=
new
ObjectInputStream
(
new
FileInputStream
(
sFile
));
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"1.4 collection = "
+
pc
);
if
(
pc
.
implies
(
mp
))
{
System
.
out
.
println
(
"JDK 1.4 test 1 passed"
);
}
else
{
throw
new
Exception
(
"JDK 1.4 test 1 failed"
);
try
(
FileInputStream
fis
=
new
FileInputStream
(
sFile
);
ObjectInputStream
ois
=
new
ObjectInputStream
(
fis
))
{
PermissionCollection
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"1.4 collection = "
+
pc
);
if
(
pc
.
implies
(
mp
))
{
System
.
out
.
println
(
"JDK 1.4 test 1 passed"
);
}
else
{
throw
new
Exception
(
"JDK 1.4 test 1 failed"
);
}
}
// write out current BasicPermissionCollection
PermissionCollection
bpc
=
mp
.
newPermissionCollection
();
bpc
.
add
(
mp
);
sFile
=
new
File
(
dir
,
"PermClass.current"
);
ObjectOutputStream
oos
=
new
ObjectOutputStream
(
new
FileOutputStream
(
"PermClass.current"
));
oos
.
writeObject
(
bpc
);
oos
.
close
();
try
(
FileOutputStream
fos
=
new
FileOutputStream
(
"PermClass.current"
);
ObjectOutputStream
oos
=
new
ObjectOutputStream
(
fos
))
{
oos
.
writeObject
(
bpc
);
}
// read in current BasicPermissionCollection
ois
=
new
ObjectInputStream
(
new
FileInputStream
(
"PermClass.current"
));
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"current collection = "
+
pc
);
if
(
pc
.
implies
(
mp
))
{
System
.
out
.
println
(
"JDK 1.4 test 2 passed"
);
}
else
{
throw
new
Exception
(
"JDK 1.4 test 2 failed"
);
try
(
FileInputStream
fis
=
new
FileInputStream
(
"PermClass.current"
);
ObjectInputStream
ois
=
new
ObjectInputStream
(
fis
))
{
PermissionCollection
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"current collection = "
+
pc
);
if
(
pc
.
implies
(
mp
))
{
System
.
out
.
println
(
"JDK 1.4 test 2 passed"
);
}
else
{
throw
new
Exception
(
"JDK 1.4 test 2 failed"
);
}
}
}
}
...
...
test/java/security/BasicPermission/SerialVersion.java
浏览文件 @
e9fc2bc5
/*
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001,
2011,
Oracle and/or its affiliates. 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
...
...
@@ -23,7 +23,7 @@
/*
* @test
* @bug 4502729
* @bug 4502729
7054918
* @summary BasicPermissionCollection serial version UID incorrect
*/
...
...
@@ -36,40 +36,44 @@ public class SerialVersion {
String
dir
=
System
.
getProperty
(
"test.src"
);
File
sFile
=
new
File
(
dir
,
"SerialVersion.1.2.1"
);
// read in a 1.2.1 BasicPermissionCollection
ObjectInputStream
ois
=
new
ObjectInputStream
(
new
FileInputStream
(
sFile
));
PermissionCollection
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"1.2.1 collection = "
+
pc
);
try
(
FileInputStream
fis
=
new
FileInputStream
(
sFile
);
ObjectInputStream
ois
=
new
ObjectInputStream
(
fis
))
{
PermissionCollection
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"1.2.1 collection = "
+
pc
);
}
// read in a 1.3.1 BasicPermissionCollection
sFile
=
new
File
(
dir
,
"SerialVersion.1.3.1"
);
ois
=
new
ObjectInputStream
(
new
FileInputStream
(
sFile
));
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"1.3.1 collection = "
+
pc
);
try
(
FileInputStream
fis
=
new
FileInputStream
(
sFile
);
ObjectInputStream
ois
=
new
ObjectInputStream
(
fis
))
{
PermissionCollection
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"1.3.1 collection = "
+
pc
);
}
// read in a 1.4 BasicPermissionCollection
sFile
=
new
File
(
dir
,
"SerialVersion.1.4"
);
ois
=
new
ObjectInputStream
(
new
FileInputStream
(
sFile
));
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"1.4 collection = "
+
pc
);
try
(
FileInputStream
fis
=
new
FileInputStream
(
sFile
);
ObjectInputStream
ois
=
new
ObjectInputStream
(
fis
))
{
PermissionCollection
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"1.4 collection = "
+
pc
);
}
// write out current BasicPermissionCollection
MyPermission
mp
=
new
MyPermission
(
"SerialVersionTest"
);
PermissionCollection
bpc
=
mp
.
newPermissionCollection
();
sFile
=
new
File
(
dir
,
"SerialVersion.current"
);
ObjectOutputStream
oos
=
new
ObjectOutputStream
(
new
FileOutputStream
(
"SerialVersion.current"
));
oos
.
writeObject
(
bpc
);
oos
.
close
();
try
(
FileOutputStream
fos
=
new
FileOutputStream
(
"SerialVersion.current"
);
ObjectOutputStream
oos
=
new
ObjectOutputStream
(
fos
))
{
oos
.
writeObject
(
bpc
);
}
// read in current BasicPermissionCollection
ois
=
new
ObjectInputStream
(
new
FileInputStream
(
"SerialVersion.current"
));
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"current collection = "
+
pc
);
try
(
FileInputStream
fis
=
new
FileInputStream
(
"SerialVersion.current"
);
ObjectInputStream
ois
=
new
ObjectInputStream
(
fis
))
{
PermissionCollection
pc
=
(
PermissionCollection
)
ois
.
readObject
();
System
.
out
.
println
(
"current collection = "
+
pc
);
}
}
}
...
...
test/java/security/KeyFactory/Failover.java
浏览文件 @
e9fc2bc5
/*
* Copyright (c) 2003, 20
04
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, Oracle and/or its affiliates. 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
...
...
@@ -23,7 +23,8 @@
/**
* @test
* @bug 4894125
* @bug 4894125 7054918
* @library ../testlibrary
* @summary test that failover for KeyFactory works
* @author Andreas Sterbenz
*/
...
...
@@ -37,6 +38,15 @@ import java.security.spec.*;
public
class
Failover
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ProvidersSnapshot
snapshot
=
ProvidersSnapshot
.
create
();
try
{
main0
(
args
);
}
finally
{
snapshot
.
restore
();
}
}
public
static
void
main0
(
String
[]
args
)
throws
Exception
{
Security
.
insertProviderAt
(
new
ProviderFail
(),
1
);
Security
.
addProvider
(
new
ProviderPass
());
System
.
out
.
println
(
Arrays
.
asList
(
Security
.
getProviders
()));
...
...
test/java/security/KeyPairGenerator/Failover.java
浏览文件 @
e9fc2bc5
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003,
2011,
Oracle and/or its affiliates. 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
...
...
@@ -23,7 +23,8 @@
/**
* @test
* @bug 4894125
* @bug 4894125 7054918
* @library ../testlibrary
* @summary test that failover for KeyPairGenerator works
* @author Andreas Sterbenz
*/
...
...
@@ -37,6 +38,15 @@ import java.security.spec.*;
public
class
Failover
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ProvidersSnapshot
snapshot
=
ProvidersSnapshot
.
create
();
try
{
main0
(
args
);
}
finally
{
snapshot
.
restore
();
}
}
public
static
void
main0
(
String
[]
args
)
throws
Exception
{
Security
.
insertProviderAt
(
new
ProviderFail
(),
1
);
Security
.
addProvider
(
new
ProviderPass
());
System
.
out
.
println
(
Arrays
.
asList
(
Security
.
getProviders
()));
...
...
test/java/security/Provider/ChangeProviders.java
浏览文件 @
e9fc2bc5
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003,
2011,
Oracle and/or its affiliates. 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
...
...
@@ -23,7 +23,8 @@
/*
* @test
* @bug 4856968
* @bug 4856968 7054918
* @library ../testlibrary
* @summary make sure add/insert/removeProvider() work correctly
* @author Andreas Sterbenz
*/
...
...
@@ -43,6 +44,15 @@ public class ChangeProviders extends Provider {
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ProvidersSnapshot
snapshot
=
ProvidersSnapshot
.
create
();
try
{
main0
(
args
);
}
finally
{
snapshot
.
restore
();
}
}
public
static
void
main0
(
String
[]
args
)
throws
Exception
{
long
start
=
System
.
currentTimeMillis
();
Provider
p
=
new
ChangeProviders
();
...
...
test/java/security/Provider/GetInstance.java
浏览文件 @
e9fc2bc5
/*
* Copyright (c) 2003, 20
05
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, Oracle and/or its affiliates. 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
...
...
@@ -23,7 +23,8 @@
/*
* @test
* @bug 4856968
* @bug 4856968 7054918
* @library ../testlibrary
* @summary make sure getInstance() works correctly, including failover
* and delayed provider selection for Signatures
* @author Andreas Sterbenz
...
...
@@ -43,6 +44,15 @@ public class GetInstance {
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ProvidersSnapshot
snapshot
=
ProvidersSnapshot
.
create
();
try
{
main0
(
args
);
}
finally
{
snapshot
.
restore
();
}
}
public
static
void
main0
(
String
[]
args
)
throws
Exception
{
long
start
=
System
.
currentTimeMillis
();
Provider
foo
=
new
FooProvider
();
...
...
test/java/security/Provider/RemoveProvider.java
浏览文件 @
e9fc2bc5
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998,
2011,
Oracle and/or its affiliates. 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
...
...
@@ -23,7 +23,8 @@
/*
* @test
* @bug 4190873
* @bug 4190873 7054918
* @library ../testlibrary
* @summary Make sure provider instance can be removed from list of registered
* providers, and "entrySet", "keySet", and "values" methods don't loop
* indefinitely.
...
...
@@ -34,6 +35,15 @@ import java.util.*;
public
class
RemoveProvider
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ProvidersSnapshot
snapshot
=
ProvidersSnapshot
.
create
();
try
{
main0
(
args
);
}
finally
{
snapshot
.
restore
();
}
}
public
static
void
main0
(
String
[]
args
)
throws
Exception
{
// Add provider 1
Provider
p1
=
new
MyProvider
(
"name1"
,
1
,
""
);
...
...
test/java/security/Provider/Turkish.java
浏览文件 @
e9fc2bc5
/*
* Copyright (c) 2005, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
1
, Oracle and/or its affiliates. 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
...
...
@@ -23,9 +23,8 @@
/**
* @test
* @bug 6220064
* @bug 6220064
7054918
* @summary make sure everything works ok in the Turkish local (dotted/dotless i problem)
* @run main/othervm Turkish
* @author Andreas Sterbenz
*/
...
...
@@ -41,54 +40,59 @@ public class Turkish {
Provider
p1
=
new
TProvider
(
"T1"
);
System
.
out
.
println
(
p1
.
getServices
());
// trigger service parsing
Locale
.
setDefault
(
new
Locale
(
"tr"
,
"TR"
));
Locale
loc
=
Locale
.
getDefault
();
try
{
Locale
.
setDefault
(
new
Locale
(
"tr"
,
"TR"
));
Provider
p2
=
new
TProvider
(
"T2"
);
System
.
out
.
println
(
p2
.
getServices
());
// trigger service parsing
Provider
p2
=
new
TProvider
(
"T2"
);
System
.
out
.
println
(
p2
.
getServices
());
// trigger service parsing
System
.
out
.
println
(
Signature
.
getInstance
(
"MD5withRSA"
));
System
.
out
.
println
(
Signature
.
getInstance
(
"md5withrsa"
));
System
.
out
.
println
(
Signature
.
getInstance
(
"MD5WITHRSA"
));
Service
s1
,
s2
;
s1
=
p1
.
getService
(
"Signature"
,
"MD5withRSA"
);
check
(
s1
,
null
);
check
(
s1
,
p1
.
getService
(
"Signature"
,
"md5withrsa"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"MD5WITHRSA"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"MD5RSA"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"md5rsa"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"MD5rsa"
));
System
.
out
.
println
(
Signature
.
getInstance
(
"MD5withRSA"
));
System
.
out
.
println
(
Signature
.
getInstance
(
"md5withrsa"
));
System
.
out
.
println
(
Signature
.
getInstance
(
"MD5WITHRSA"
));
Service
s1
,
s2
;
s1
=
p1
.
getService
(
"Signature"
,
"MD5withRSA"
);
check
(
s1
,
null
);
check
(
s1
,
p1
.
getService
(
"Signature"
,
"md5withrsa"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"MD5WITHRSA"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"MD5RSA"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"md5rsa"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"MD5rsa"
));
s1
=
p1
.
getService
(
"Signature"
,
"SHAwithRSA"
);
check
(
s1
,
null
);
check
(
s1
,
p1
.
getService
(
"Signature"
,
"shawithrsa"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"SHAWITHRSA"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"SHARSA"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"sharsa"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"SHArsa"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"SHA1RSA"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"sha1rsa"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"SHA1rsa"
));
s1
=
p1
.
getService
(
"Signature"
,
"SHAwithRSA"
);
check
(
s1
,
null
);
check
(
s1
,
p1
.
getService
(
"Signature"
,
"shawithrsa"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"SHAWITHRSA"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"SHARSA"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"sharsa"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"SHArsa"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"SHA1RSA"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"sha1rsa"
));
check
(
s1
,
p1
.
getService
(
"Signature"
,
"SHA1rsa"
));
s1
=
p2
.
getService
(
"Signature"
,
"MD5withRSA"
);
check
(
s1
,
null
);
check
(
s1
,
p2
.
getService
(
"Signature"
,
"md5withrsa"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"MD5WITHRSA"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"MD5RSA"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"md5rsa"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"MD5rsa"
));
s1
=
p2
.
getService
(
"Signature"
,
"MD5withRSA"
);
check
(
s1
,
null
);
check
(
s1
,
p2
.
getService
(
"Signature"
,
"md5withrsa"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"MD5WITHRSA"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"MD5RSA"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"md5rsa"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"MD5rsa"
));
s1
=
p2
.
getService
(
"Signature"
,
"SHAwithRSA"
);
check
(
s1
,
null
);
check
(
s1
,
p2
.
getService
(
"Signature"
,
"shawithrsa"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"SHAWITHRSA"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"SHARSA"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"sharsa"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"SHArsa"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"SHA1RSA"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"sha1rsa"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"SHA1rsa"
));
s1
=
p2
.
getService
(
"Signature"
,
"SHAwithRSA"
);
check
(
s1
,
null
);
check
(
s1
,
p2
.
getService
(
"Signature"
,
"shawithrsa"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"SHAWITHRSA"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"SHARSA"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"sharsa"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"SHArsa"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"SHA1RSA"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"sha1rsa"
));
check
(
s1
,
p2
.
getService
(
"Signature"
,
"SHA1rsa"
));
System
.
out
.
println
(
"OK"
);
System
.
out
.
println
(
"OK"
);
}
finally
{
Locale
.
setDefault
(
loc
);
}
}
private
static
void
check
(
Service
s1
,
Service
s2
)
throws
Exception
{
...
...
test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
浏览文件 @
e9fc2bc5
#!/bin/sh
#
# Copyright (c) 2009, 201
0
, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 201
1
, Oracle and/or its affiliates. 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
...
...
@@ -58,6 +58,10 @@ case "$OS" in
PATHSEP
=
":"
FILESEP
=
"/"
;;
CYGWIN
*
)
PATHSEP
=
";"
FILESEP
=
"/"
;;
Windows
*
)
PATHSEP
=
";"
FILESEP
=
"
\\
"
...
...
test/java/security/Security/NoInstalledProviders.java
浏览文件 @
e9fc2bc5
/*
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999,
2011,
Oracle and/or its affiliates. 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
...
...
@@ -23,7 +23,8 @@
/*
* @test
* @bug 4273454
* @bug 4273454 7054918
* @library ../testlibrary
* @summary Make sure getProviders(filter) doesn't throw NPE
*/
...
...
@@ -31,7 +32,16 @@ import java.security.*;
public
class
NoInstalledProviders
{
public
static
void
main
(
String
[]
argv
)
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ProvidersSnapshot
snapshot
=
ProvidersSnapshot
.
create
();
try
{
main0
(
args
);
}
finally
{
snapshot
.
restore
();
}
}
public
static
void
main0
(
String
[]
args
)
throws
Exception
{
Provider
[]
provs
=
Security
.
getProviders
();
// make sure there are no providers in the system
...
...
test/java/security/Security/SynchronizedAccess.java
浏览文件 @
e9fc2bc5
/*
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999,
2011,
Oracle and/or its affiliates. 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
...
...
@@ -23,7 +23,8 @@
/*
* @test
* @bug 4162583
* @bug 4162583 7054918
* @library ../testlibrary
* @summary Make sure Provider api implementations are synchronized properly
*/
...
...
@@ -31,7 +32,16 @@ import java.security.*;
public
class
SynchronizedAccess
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ProvidersSnapshot
snapshot
=
ProvidersSnapshot
.
create
();
try
{
main0
(
args
);
}
finally
{
snapshot
.
restore
();
}
}
public
static
void
main0
(
String
[]
args
)
throws
Exception
{
AccessorThread
[]
acc
=
new
AccessorThread
[
200
];
for
(
int
i
=
0
;
i
<
acc
.
length
;
i
++)
acc
[
i
]
=
new
AccessorThread
(
"thread"
+
i
);
...
...
test/java/security/Security/removing/RemoveProviders.java
浏览文件 @
e9fc2bc5
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003,
2011,
Oracle and/or its affiliates. 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
...
...
@@ -23,7 +23,8 @@
/**
* @test
* @bug 4963416
* @bug 4963416 7054918
* @library ../../testlibrary
* @summary make sure removeProvider() always works correctly
* @author Andreas Sterbenz
*/
...
...
@@ -35,6 +36,15 @@ import java.security.*;
public
class
RemoveProviders
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ProvidersSnapshot
snapshot
=
ProvidersSnapshot
.
create
();
try
{
main0
(
args
);
}
finally
{
snapshot
.
restore
();
}
}
public
static
void
main0
(
String
[]
args
)
throws
Exception
{
Provider
[]
providers
=
Security
.
getProviders
();
System
.
out
.
println
(
"Providers: "
+
Arrays
.
asList
(
providers
));
...
...
test/java/security/UnresolvedPermission/Equals.java
浏览文件 @
e9fc2bc5
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002,
2011,
Oracle and/or its affiliates. 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
...
...
@@ -24,6 +24,7 @@
/*
* @test
* @bug 4513737
* @run main/othervm Equals
* @summary UnresolvedPermission.equals() throws NullPointerException
*/
...
...
test/java/security/spec/EllipticCurveMatch.java
浏览文件 @
e9fc2bc5
...
...
@@ -25,13 +25,12 @@
* @test
* @bug 6738532
* @summary Check EllipticCurve.equals() does not compare seed value of curve.
* @run main/othervm EllipticCurveMatch
* @author Mike StJohns
*/
import
java.security.spec.*
;
import
java.math.BigInteger
;
import
java.
security.Secure
Random
;
import
java.
util.
Random
;
public
class
EllipticCurveMatch
{
static
String
primeP256
=
...
...
@@ -45,7 +44,7 @@ public class EllipticCurveMatch {
private
static
EllipticCurve
addSeedToCurve
(
EllipticCurve
curve
)
{
SecureRandom
rand
=
new
Secure
Random
();
Random
rand
=
new
Random
();
byte
[]
seed
=
new
byte
[
12
];
rand
.
nextBytes
(
seed
);
...
...
test/java/security/testlibrary/ProvidersSnapshot.java
0 → 100644
浏览文件 @
e9fc2bc5
/*
* Copyright (c) 2011, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import
java.security.Provider
;
import
java.security.Security
;
public
class
ProvidersSnapshot
{
private
Provider
[]
oldProviders
;
private
ProvidersSnapshot
()
{
oldProviders
=
Security
.
getProviders
();
}
public
static
ProvidersSnapshot
create
()
{
return
new
ProvidersSnapshot
();
}
public
void
restore
()
{
Provider
[]
newProviders
=
Security
.
getProviders
();
for
(
Provider
p:
newProviders
)
{
Security
.
removeProvider
(
p
.
getName
());
}
for
(
Provider
p:
oldProviders
)
{
Security
.
addProvider
(
p
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录