Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
179dde1b
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看板
提交
179dde1b
编写于
1月 10, 2011
作者:
S
smarks
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7005608: diamond conversion of JCA and crypto providers
Reviewed-by: wetmore
上级
064f64a0
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
24 addition
and
27 deletion
+24
-27
src/share/classes/java/security/Security.java
src/share/classes/java/security/Security.java
+1
-1
src/share/classes/sun/security/jca/ProviderList.java
src/share/classes/sun/security/jca/ProviderList.java
+4
-4
src/share/classes/sun/security/jca/Providers.java
src/share/classes/sun/security/jca/Providers.java
+1
-1
src/share/classes/sun/security/provider/PolicyFile.java
src/share/classes/sun/security/provider/PolicyFile.java
+6
-9
src/share/classes/sun/security/provider/Sun.java
src/share/classes/sun/security/provider/Sun.java
+1
-1
src/share/classes/sun/security/provider/VerificationProvider.java
...e/classes/sun/security/provider/VerificationProvider.java
+1
-1
src/share/classes/sun/security/provider/X509Factory.java
src/share/classes/sun/security/provider/X509Factory.java
+6
-6
src/share/classes/sun/security/rsa/RSACore.java
src/share/classes/sun/security/rsa/RSACore.java
+3
-3
src/share/classes/sun/security/rsa/SunRsaSign.java
src/share/classes/sun/security/rsa/SunRsaSign.java
+1
-1
未找到文件。
src/share/classes/java/security/Security.java
浏览文件 @
179dde1b
...
@@ -659,7 +659,7 @@ public final class Security {
...
@@ -659,7 +659,7 @@ public final class Security {
}
}
// Map containing cached Spi Class objects of the specified type
// Map containing cached Spi Class objects of the specified type
private
static
final
Map
<
String
,
Class
>
spiMap
=
new
ConcurrentHashMap
<>();
private
static
final
Map
<
String
,
Class
>
spiMap
=
new
ConcurrentHashMap
<>();
/**
/**
* Return the Class object for the given engine type
* Return the Class object for the given engine type
...
...
src/share/classes/sun/security/jca/ProviderList.java
浏览文件 @
179dde1b
...
@@ -96,7 +96,7 @@ public final class ProviderList {
...
@@ -96,7 +96,7 @@ public final class ProviderList {
if
(
providerList
.
getProvider
(
p
.
getName
())
!=
null
)
{
if
(
providerList
.
getProvider
(
p
.
getName
())
!=
null
)
{
return
providerList
;
return
providerList
;
}
}
List
<
ProviderConfig
>
list
=
new
ArrayList
<
ProviderConfig
>
List
<
ProviderConfig
>
list
=
new
ArrayList
<>
(
Arrays
.
asList
(
providerList
.
configs
));
(
Arrays
.
asList
(
providerList
.
configs
));
int
n
=
list
.
size
();
int
n
=
list
.
size
();
if
((
position
<
0
)
||
(
position
>
n
))
{
if
((
position
<
0
)
||
(
position
>
n
))
{
...
@@ -160,7 +160,7 @@ public final class ProviderList {
...
@@ -160,7 +160,7 @@ public final class ProviderList {
* Return a new ProviderList parsed from the java.security Properties.
* Return a new ProviderList parsed from the java.security Properties.
*/
*/
private
ProviderList
()
{
private
ProviderList
()
{
List
<
ProviderConfig
>
configList
=
new
ArrayList
<
ProviderConfig
>();
List
<
ProviderConfig
>
configList
=
new
ArrayList
<>();
for
(
int
i
=
1
;
true
;
i
++)
{
for
(
int
i
=
1
;
true
;
i
++)
{
String
entry
=
Security
.
getProperty
(
"security.provider."
+
i
);
String
entry
=
Security
.
getProperty
(
"security.provider."
+
i
);
if
(
entry
==
null
)
{
if
(
entry
==
null
)
{
...
@@ -200,7 +200,7 @@ public final class ProviderList {
...
@@ -200,7 +200,7 @@ public final class ProviderList {
* possible recursion and deadlock during verification.
* possible recursion and deadlock during verification.
*/
*/
ProviderList
getJarList
(
String
[]
jarClassNames
)
{
ProviderList
getJarList
(
String
[]
jarClassNames
)
{
List
<
ProviderConfig
>
newConfigs
=
new
ArrayList
<
ProviderConfig
>();
List
<
ProviderConfig
>
newConfigs
=
new
ArrayList
<>();
for
(
String
className
:
jarClassNames
)
{
for
(
String
className
:
jarClassNames
)
{
ProviderConfig
newConfig
=
new
ProviderConfig
(
className
);
ProviderConfig
newConfig
=
new
ProviderConfig
(
className
);
for
(
ProviderConfig
config
:
configs
)
{
for
(
ProviderConfig
config
:
configs
)
{
...
@@ -356,7 +356,7 @@ public final class ProviderList {
...
@@ -356,7 +356,7 @@ public final class ProviderList {
*/
*/
@Deprecated
@Deprecated
public
List
<
Service
>
getServices
(
String
type
,
List
<
String
>
algorithms
)
{
public
List
<
Service
>
getServices
(
String
type
,
List
<
String
>
algorithms
)
{
List
<
ServiceId
>
ids
=
new
ArrayList
<
ServiceId
>();
List
<
ServiceId
>
ids
=
new
ArrayList
<>();
for
(
String
alg
:
algorithms
)
{
for
(
String
alg
:
algorithms
)
{
ids
.
add
(
new
ServiceId
(
type
,
alg
));
ids
.
add
(
new
ServiceId
(
type
,
alg
));
}
}
...
...
src/share/classes/sun/security/jca/Providers.java
浏览文件 @
179dde1b
...
@@ -40,7 +40,7 @@ import java.security.Security;
...
@@ -40,7 +40,7 @@ import java.security.Security;
public
class
Providers
{
public
class
Providers
{
private
static
final
ThreadLocal
<
ProviderList
>
threadLists
=
private
static
final
ThreadLocal
<
ProviderList
>
threadLists
=
new
InheritableThreadLocal
<
ProviderList
>();
new
InheritableThreadLocal
<>();
// number of threads currently using thread-local provider lists
// number of threads currently using thread-local provider lists
// tracked to allow an optimization if == 0
// tracked to allow an optimization if == 0
...
...
src/share/classes/sun/security/provider/PolicyFile.java
浏览文件 @
179dde1b
...
@@ -299,8 +299,7 @@ public class PolicyFile extends java.security.Policy {
...
@@ -299,8 +299,7 @@ public class PolicyFile extends java.security.Policy {
private
static
final
int
DEFAULT_CACHE_SIZE
=
1
;
private
static
final
int
DEFAULT_CACHE_SIZE
=
1
;
// contains the policy grant entries, PD cache, and alias mapping
// contains the policy grant entries, PD cache, and alias mapping
private
AtomicReference
<
PolicyInfo
>
policyInfo
=
private
AtomicReference
<
PolicyInfo
>
policyInfo
=
new
AtomicReference
<>();
new
AtomicReference
<
PolicyInfo
>();
private
boolean
constructed
=
false
;
private
boolean
constructed
=
false
;
private
boolean
expandProperties
=
true
;
private
boolean
expandProperties
=
true
;
...
@@ -1334,8 +1333,7 @@ public class PolicyFile extends java.security.Policy {
...
@@ -1334,8 +1333,7 @@ public class PolicyFile extends java.security.Policy {
List
<
PolicyParser
.
PrincipalEntry
>
entryPs
=
entry
.
getPrincipals
();
List
<
PolicyParser
.
PrincipalEntry
>
entryPs
=
entry
.
getPrincipals
();
if
(
debug
!=
null
)
{
if
(
debug
!=
null
)
{
ArrayList
<
PolicyParser
.
PrincipalEntry
>
accPs
=
ArrayList
<
PolicyParser
.
PrincipalEntry
>
accPs
=
new
ArrayList
<>();
new
ArrayList
<
PolicyParser
.
PrincipalEntry
>();
if
(
principals
!=
null
)
{
if
(
principals
!=
null
)
{
for
(
int
i
=
0
;
i
<
principals
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
principals
.
length
;
i
++)
{
accPs
.
add
(
new
PolicyParser
.
PrincipalEntry
accPs
.
add
(
new
PolicyParser
.
PrincipalEntry
...
@@ -1416,8 +1414,7 @@ public class PolicyFile extends java.security.Policy {
...
@@ -1416,8 +1414,7 @@ public class PolicyFile extends java.security.Policy {
// check if the PrincipalComparator
// check if the PrincipalComparator
// implies the current thread's principals
// implies the current thread's principals
Set
<
Principal
>
pSet
=
Set
<
Principal
>
pSet
=
new
HashSet
<>(
principals
.
length
);
new
HashSet
<
Principal
>(
principals
.
length
);
for
(
int
j
=
0
;
j
<
principals
.
length
;
j
++)
{
for
(
int
j
=
0
;
j
<
principals
.
length
;
j
++)
{
pSet
.
add
(
principals
[
j
]);
pSet
.
add
(
principals
[
j
]);
}
}
...
@@ -1700,7 +1697,7 @@ public class PolicyFile extends java.security.Policy {
...
@@ -1700,7 +1697,7 @@ public class PolicyFile extends java.security.Policy {
// build an info array for every principal
// build an info array for every principal
// in the current domain which has a principal class
// in the current domain which has a principal class
// that is equal to policy entry principal class name
// that is equal to policy entry principal class name
List
<
Principal
>
plist
=
new
ArrayList
<
Principal
>();
List
<
Principal
>
plist
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
pdp
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
pdp
.
length
;
i
++)
{
if
(
pe
.
principalClass
.
equals
(
pdp
[
i
].
getClass
().
getName
()))
if
(
pe
.
principalClass
.
equals
(
pdp
[
i
].
getClass
().
getName
()))
plist
.
add
(
pdp
[
i
]);
plist
.
add
(
pdp
[
i
]);
...
@@ -1770,7 +1767,7 @@ public class PolicyFile extends java.security.Policy {
...
@@ -1770,7 +1767,7 @@ public class PolicyFile extends java.security.Policy {
// Done
// Done
return
certs
;
return
certs
;
ArrayList
<
Certificate
>
userCertList
=
new
ArrayList
<
Certificate
>();
ArrayList
<
Certificate
>
userCertList
=
new
ArrayList
<>();
i
=
0
;
i
=
0
;
while
(
i
<
certs
.
length
)
{
while
(
i
<
certs
.
length
)
{
userCertList
.
add
(
certs
[
i
]);
userCertList
.
add
(
certs
[
i
]);
...
@@ -2234,7 +2231,7 @@ public class PolicyFile extends java.security.Policy {
...
@@ -2234,7 +2231,7 @@ public class PolicyFile extends java.security.Policy {
if
(
this
.
certs
==
null
)
{
if
(
this
.
certs
==
null
)
{
// extract the signer certs
// extract the signer certs
ArrayList
<
Certificate
>
signerCerts
=
ArrayList
<
Certificate
>
signerCerts
=
new
ArrayList
<
Certificate
>();
new
ArrayList
<>();
i
=
0
;
i
=
0
;
while
(
i
<
certs
.
length
)
{
while
(
i
<
certs
.
length
)
{
signerCerts
.
add
(
certs
[
i
]);
signerCerts
.
add
(
certs
[
i
]);
...
...
src/share/classes/sun/security/provider/Sun.java
浏览文件 @
179dde1b
...
@@ -55,7 +55,7 @@ public final class Sun extends Provider {
...
@@ -55,7 +55,7 @@ public final class Sun extends Provider {
SunEntries
.
putEntries
(
this
);
SunEntries
.
putEntries
(
this
);
}
else
{
}
else
{
// use LinkedHashMap to preserve the order of the PRNGs
// use LinkedHashMap to preserve the order of the PRNGs
Map
<
Object
,
Object
>
map
=
new
LinkedHashMap
<
Object
,
Object
>();
Map
<
Object
,
Object
>
map
=
new
LinkedHashMap
<>();
SunEntries
.
putEntries
(
map
);
SunEntries
.
putEntries
(
map
);
AccessController
.
doPrivileged
(
new
PutAllAction
(
this
,
map
));
AccessController
.
doPrivileged
(
new
PutAllAction
(
this
,
map
));
}
}
...
...
src/share/classes/sun/security/provider/VerificationProvider.java
浏览文件 @
179dde1b
...
@@ -76,7 +76,7 @@ public final class VerificationProvider extends Provider {
...
@@ -76,7 +76,7 @@ public final class VerificationProvider extends Provider {
SunRsaSignEntries
.
putEntries
(
this
);
SunRsaSignEntries
.
putEntries
(
this
);
}
else
{
}
else
{
// use LinkedHashMap to preserve the order of the PRNGs
// use LinkedHashMap to preserve the order of the PRNGs
Map
<
Object
,
Object
>
map
=
new
LinkedHashMap
<
Object
,
Object
>();
Map
<
Object
,
Object
>
map
=
new
LinkedHashMap
<>();
SunEntries
.
putEntries
(
map
);
SunEntries
.
putEntries
(
map
);
SunRsaSignEntries
.
putEntries
(
map
);
SunRsaSignEntries
.
putEntries
(
map
);
AccessController
.
doPrivileged
(
new
PutAllAction
(
this
,
map
));
AccessController
.
doPrivileged
(
new
PutAllAction
(
this
,
map
));
...
...
src/share/classes/sun/security/provider/X509Factory.java
浏览文件 @
179dde1b
...
@@ -409,10 +409,10 @@ public class X509Factory extends CertificateFactorySpi {
...
@@ -409,10 +409,10 @@ public class X509Factory extends CertificateFactorySpi {
parseX509orPKCS7Cert
(
InputStream
is
)
parseX509orPKCS7Cert
(
InputStream
is
)
throws
CertificateException
,
IOException
throws
CertificateException
,
IOException
{
{
Collection
<
X509CertImpl
>
coll
=
new
ArrayList
<
X509CertImpl
>();
Collection
<
X509CertImpl
>
coll
=
new
ArrayList
<>();
byte
[]
data
=
readOneBlock
(
is
);
byte
[]
data
=
readOneBlock
(
is
);
if
(
data
==
null
)
{
if
(
data
==
null
)
{
return
new
ArrayList
<
X509CertImpl
>(
0
);
return
new
ArrayList
<>(
0
);
}
}
try
{
try
{
PKCS7
pkcs7
=
new
PKCS7
(
data
);
PKCS7
pkcs7
=
new
PKCS7
(
data
);
...
@@ -422,7 +422,7 @@ public class X509Factory extends CertificateFactorySpi {
...
@@ -422,7 +422,7 @@ public class X509Factory extends CertificateFactorySpi {
return
Arrays
.
asList
(
certs
);
return
Arrays
.
asList
(
certs
);
}
else
{
}
else
{
// no crls provided
// no crls provided
return
new
ArrayList
<
X509Certificate
>(
0
);
return
new
ArrayList
<>(
0
);
}
}
}
catch
(
ParsingException
e
)
{
}
catch
(
ParsingException
e
)
{
while
(
data
!=
null
)
{
while
(
data
!=
null
)
{
...
@@ -442,10 +442,10 @@ public class X509Factory extends CertificateFactorySpi {
...
@@ -442,10 +442,10 @@ public class X509Factory extends CertificateFactorySpi {
parseX509orPKCS7CRL
(
InputStream
is
)
parseX509orPKCS7CRL
(
InputStream
is
)
throws
CRLException
,
IOException
throws
CRLException
,
IOException
{
{
Collection
<
X509CRLImpl
>
coll
=
new
ArrayList
<
X509CRLImpl
>();
Collection
<
X509CRLImpl
>
coll
=
new
ArrayList
<>();
byte
[]
data
=
readOneBlock
(
is
);
byte
[]
data
=
readOneBlock
(
is
);
if
(
data
==
null
)
{
if
(
data
==
null
)
{
return
new
ArrayList
<
X509CRL
>(
0
);
return
new
ArrayList
<>(
0
);
}
}
try
{
try
{
PKCS7
pkcs7
=
new
PKCS7
(
data
);
PKCS7
pkcs7
=
new
PKCS7
(
data
);
...
@@ -455,7 +455,7 @@ public class X509Factory extends CertificateFactorySpi {
...
@@ -455,7 +455,7 @@ public class X509Factory extends CertificateFactorySpi {
return
Arrays
.
asList
(
crls
);
return
Arrays
.
asList
(
crls
);
}
else
{
}
else
{
// no crls provided
// no crls provided
return
new
ArrayList
<
X509CRL
>(
0
);
return
new
ArrayList
<>(
0
);
}
}
}
catch
(
ParsingException
e
)
{
}
catch
(
ParsingException
e
)
{
while
(
data
!=
null
)
{
while
(
data
!=
null
)
{
...
...
src/share/classes/sun/security/rsa/RSACore.java
浏览文件 @
179dde1b
...
@@ -215,11 +215,11 @@ public final class RSACore {
...
@@ -215,11 +215,11 @@ public final class RSACore {
// value suggested by Paul Kocher (quoted by NSS)
// value suggested by Paul Kocher (quoted by NSS)
private
final
static
int
BLINDING_MAX_REUSE
=
50
;
private
final
static
int
BLINDING_MAX_REUSE
=
50
;
// cache for blinding parameters. Map<BigInteger,BlindingParameters>
// cache for blinding parameters. Map<BigInteger,
BlindingParameters>
// use a weak hashmap so that cached values are automatically cleared
// use a weak hashmap so that cached values are automatically cleared
// when the modulus is GC'ed
// when the modulus is GC'ed
private
final
static
Map
<
BigInteger
,
BlindingParameters
>
blindingCache
=
private
final
static
Map
<
BigInteger
,
BlindingParameters
>
blindingCache
=
new
WeakHashMap
<
BigInteger
,
BlindingParameters
>();
new
WeakHashMap
<>();
/**
/**
* Set of blinding parameters for a given RSA key.
* Set of blinding parameters for a given RSA key.
...
...
src/share/classes/sun/security/rsa/SunRsaSign.java
浏览文件 @
179dde1b
...
@@ -52,7 +52,7 @@ public final class SunRsaSign extends Provider {
...
@@ -52,7 +52,7 @@ public final class SunRsaSign extends Provider {
SunRsaSignEntries
.
putEntries
(
this
);
SunRsaSignEntries
.
putEntries
(
this
);
}
else
{
}
else
{
// use LinkedHashMap to preserve the order of the PRNGs
// use LinkedHashMap to preserve the order of the PRNGs
Map
<
Object
,
Object
>
map
=
new
HashMap
<
Object
,
Object
>();
Map
<
Object
,
Object
>
map
=
new
HashMap
<>();
SunRsaSignEntries
.
putEntries
(
map
);
SunRsaSignEntries
.
putEntries
(
map
);
AccessController
.
doPrivileged
(
new
PutAllAction
(
this
,
map
));
AccessController
.
doPrivileged
(
new
PutAllAction
(
this
,
map
));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录