Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
af9d07b8
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看板
提交
af9d07b8
编写于
1月 14, 2011
作者:
S
smarks
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7012003: diamond conversion for ssl
Reviewed-by: wetmore
上级
1c541e4b
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
33 addition
and
39 deletion
+33
-39
src/share/classes/sun/security/ssl/CipherSuite.java
src/share/classes/sun/security/ssl/CipherSuite.java
+1
-1
src/share/classes/sun/security/ssl/CipherSuiteList.java
src/share/classes/sun/security/ssl/CipherSuiteList.java
+1
-1
src/share/classes/sun/security/ssl/ClientHandshaker.java
src/share/classes/sun/security/ssl/ClientHandshaker.java
+3
-4
src/share/classes/sun/security/ssl/DefaultSSLContextImpl.java
...share/classes/sun/security/ssl/DefaultSSLContextImpl.java
+1
-1
src/share/classes/sun/security/ssl/HandshakeMessage.java
src/share/classes/sun/security/ssl/HandshakeMessage.java
+4
-4
src/share/classes/sun/security/ssl/Handshaker.java
src/share/classes/sun/security/ssl/Handshaker.java
+2
-3
src/share/classes/sun/security/ssl/HelloExtensions.java
src/share/classes/sun/security/ssl/HelloExtensions.java
+2
-3
src/share/classes/sun/security/ssl/ProtocolList.java
src/share/classes/sun/security/ssl/ProtocolList.java
+1
-1
src/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java
...are/classes/sun/security/ssl/SSLAlgorithmConstraints.java
+5
-5
src/share/classes/sun/security/ssl/SSLSessionImpl.java
src/share/classes/sun/security/ssl/SSLSessionImpl.java
+2
-3
src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java
...e/classes/sun/security/ssl/SignatureAndHashAlgorithm.java
+4
-6
src/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java
...share/classes/sun/security/ssl/SunX509KeyManagerImpl.java
+2
-2
src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java
...are/classes/sun/security/ssl/TrustManagerFactoryImpl.java
+1
-1
src/share/classes/sun/security/ssl/X509KeyManagerImpl.java
src/share/classes/sun/security/ssl/X509KeyManagerImpl.java
+2
-2
test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java
.../protocol/https/HttpsURLConnection/CookieHandlerTest.java
+2
-2
未找到文件。
src/share/classes/sun/security/ssl/CipherSuite.java
浏览文件 @
af9d07b8
...
@@ -393,7 +393,7 @@ final class CipherSuite implements Comparable {
...
@@ -393,7 +393,7 @@ final class CipherSuite implements Comparable {
// Map BulkCipher -> Boolean(available)
// Map BulkCipher -> Boolean(available)
private
final
static
Map
<
BulkCipher
,
Boolean
>
availableCache
=
private
final
static
Map
<
BulkCipher
,
Boolean
>
availableCache
=
new
HashMap
<
BulkCipher
,
Boolean
>(
8
);
new
HashMap
<>(
8
);
// descriptive name including key size, e.g. AES/128
// descriptive name including key size, e.g. AES/128
final
String
description
;
final
String
description
;
...
...
src/share/classes/sun/security/ssl/CipherSuiteList.java
浏览文件 @
af9d07b8
...
@@ -221,7 +221,7 @@ final class CipherSuiteList {
...
@@ -221,7 +221,7 @@ final class CipherSuiteList {
private
static
CipherSuiteList
buildAvailableCache
(
int
minPriority
)
{
private
static
CipherSuiteList
buildAvailableCache
(
int
minPriority
)
{
// SortedSet automatically arranges ciphersuites in default
// SortedSet automatically arranges ciphersuites in default
// preference order
// preference order
Set
<
CipherSuite
>
cipherSuites
=
new
TreeSet
<
CipherSuite
>();
Set
<
CipherSuite
>
cipherSuites
=
new
TreeSet
<>();
Collection
<
CipherSuite
>
allowedCipherSuites
=
Collection
<
CipherSuite
>
allowedCipherSuites
=
CipherSuite
.
allowedCipherSuites
();
CipherSuite
.
allowedCipherSuites
();
for
(
CipherSuite
c
:
allowedCipherSuites
)
{
for
(
CipherSuite
c
:
allowedCipherSuites
)
{
...
...
src/share/classes/sun/security/ssl/ClientHandshaker.java
浏览文件 @
af9d07b8
...
@@ -655,7 +655,7 @@ final class ClientHandshaker extends Handshaker {
...
@@ -655,7 +655,7 @@ final class ClientHandshaker extends Handshaker {
if
(
certRequest
!=
null
)
{
if
(
certRequest
!=
null
)
{
X509ExtendedKeyManager
km
=
sslContext
.
getX509KeyManager
();
X509ExtendedKeyManager
km
=
sslContext
.
getX509KeyManager
();
ArrayList
<
String
>
keytypesTmp
=
new
ArrayList
<
String
>(
4
);
ArrayList
<
String
>
keytypesTmp
=
new
ArrayList
<>(
4
);
for
(
int
i
=
0
;
i
<
certRequest
.
types
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
certRequest
.
types
.
length
;
i
++)
{
String
typeName
;
String
typeName
;
...
@@ -1174,8 +1174,7 @@ final class ClientHandshaker extends Handshaker {
...
@@ -1174,8 +1174,7 @@ final class ClientHandshaker extends Handshaker {
"Can't reuse existing SSL client session"
);
"Can't reuse existing SSL client session"
);
}
}
Collection
<
CipherSuite
>
cipherList
=
Collection
<
CipherSuite
>
cipherList
=
new
ArrayList
<>(
2
);
new
ArrayList
<
CipherSuite
>(
2
);
cipherList
.
add
(
sessionSuite
);
cipherList
.
add
(
sessionSuite
);
if
(!
secureRenegotiation
&&
if
(!
secureRenegotiation
&&
cipherSuites
.
contains
(
CipherSuite
.
C_SCSV
))
{
cipherSuites
.
contains
(
CipherSuite
.
C_SCSV
))
{
...
@@ -1193,7 +1192,7 @@ final class ClientHandshaker extends Handshaker {
...
@@ -1193,7 +1192,7 @@ final class ClientHandshaker extends Handshaker {
// exclude SCSV for secure renegotiation
// exclude SCSV for secure renegotiation
if
(
secureRenegotiation
&&
cipherSuites
.
contains
(
CipherSuite
.
C_SCSV
))
{
if
(
secureRenegotiation
&&
cipherSuites
.
contains
(
CipherSuite
.
C_SCSV
))
{
Collection
<
CipherSuite
>
cipherList
=
Collection
<
CipherSuite
>
cipherList
=
new
ArrayList
<
CipherSuite
>(
cipherSuites
.
size
()
-
1
);
new
ArrayList
<>(
cipherSuites
.
size
()
-
1
);
for
(
CipherSuite
suite
:
cipherSuites
.
collection
())
{
for
(
CipherSuite
suite
:
cipherSuites
.
collection
())
{
if
(
suite
!=
CipherSuite
.
C_SCSV
)
{
if
(
suite
!=
CipherSuite
.
C_SCSV
)
{
cipherList
.
add
(
suite
);
cipherList
.
add
(
suite
);
...
...
src/share/classes/sun/security/ssl/DefaultSSLContextImpl.java
浏览文件 @
af9d07b8
...
@@ -98,7 +98,7 @@ public final class DefaultSSLContextImpl extends SSLContextImpl {
...
@@ -98,7 +98,7 @@ public final class DefaultSSLContextImpl extends SSLContextImpl {
return
defaultKeyManagers
;
return
defaultKeyManagers
;
}
}
final
Map
<
String
,
String
>
props
=
new
HashMap
<
String
,
String
>();
final
Map
<
String
,
String
>
props
=
new
HashMap
<>();
AccessController
.
doPrivileged
(
AccessController
.
doPrivileged
(
new
PrivilegedExceptionAction
<
Object
>()
{
new
PrivilegedExceptionAction
<
Object
>()
{
public
Object
run
()
throws
Exception
{
public
Object
run
()
throws
Exception
{
...
...
src/share/classes/sun/security/ssl/HandshakeMessage.java
浏览文件 @
af9d07b8
...
@@ -258,7 +258,7 @@ static final class ClientHello extends HandshakeMessage {
...
@@ -258,7 +258,7 @@ static final class ClientHello extends HandshakeMessage {
// add server_name extension
// add server_name extension
void
addServerNameIndicationExtension
(
String
hostname
)
{
void
addServerNameIndicationExtension
(
String
hostname
)
{
// We would have checked that the hostname ia a FQDN.
// We would have checked that the hostname ia a FQDN.
ArrayList
<
String
>
hostnames
=
new
ArrayList
<
String
>(
1
);
ArrayList
<
String
>
hostnames
=
new
ArrayList
<>(
1
);
hostnames
.
add
(
hostname
);
hostnames
.
add
(
hostname
);
try
{
try
{
...
@@ -434,7 +434,7 @@ class CertificateMsg extends HandshakeMessage
...
@@ -434,7 +434,7 @@ class CertificateMsg extends HandshakeMessage
CertificateMsg
(
HandshakeInStream
input
)
throws
IOException
{
CertificateMsg
(
HandshakeInStream
input
)
throws
IOException
{
int
chainLen
=
input
.
getInt24
();
int
chainLen
=
input
.
getInt24
();
List
<
Certificate
>
v
=
new
ArrayList
<
Certificate
>(
4
);
List
<
Certificate
>
v
=
new
ArrayList
<>(
4
);
CertificateFactory
cf
=
null
;
CertificateFactory
cf
=
null
;
while
(
chainLen
>
0
)
{
while
(
chainLen
>
0
)
{
...
@@ -1328,7 +1328,7 @@ class CertificateRequest extends HandshakeMessage
...
@@ -1328,7 +1328,7 @@ class CertificateRequest extends HandshakeMessage
// read the certificate_authorities
// read the certificate_authorities
int
len
=
input
.
getInt16
();
int
len
=
input
.
getInt16
();
ArrayList
<
DistinguishedName
>
v
=
new
ArrayList
<
DistinguishedName
>();
ArrayList
<
DistinguishedName
>
v
=
new
ArrayList
<>();
while
(
len
>=
3
)
{
while
(
len
>=
3
)
{
DistinguishedName
dn
=
new
DistinguishedName
(
input
);
DistinguishedName
dn
=
new
DistinguishedName
(
input
);
v
.
add
(
dn
);
v
.
add
(
dn
);
...
@@ -1719,7 +1719,7 @@ static final class CertificateVerify extends HandshakeMessage {
...
@@ -1719,7 +1719,7 @@ static final class CertificateVerify extends HandshakeMessage {
// Note that this will prevent the Spi classes from being GC'd. We assume
// Note that this will prevent the Spi classes from being GC'd. We assume
// that is not a problem.
// that is not a problem.
private
final
static
Map
<
Class
,
Object
>
methodCache
=
private
final
static
Map
<
Class
,
Object
>
methodCache
=
new
ConcurrentHashMap
<
Class
,
Object
>();
new
ConcurrentHashMap
<>();
private
static
void
digestKey
(
MessageDigest
md
,
SecretKey
key
)
{
private
static
void
digestKey
(
MessageDigest
md
,
SecretKey
key
)
{
try
{
try
{
...
...
src/share/classes/sun/security/ssl/Handshaker.java
浏览文件 @
af9d07b8
...
@@ -569,7 +569,7 @@ abstract class Handshaker {
...
@@ -569,7 +569,7 @@ abstract class Handshaker {
activeProtocols
=
getActiveProtocols
();
activeProtocols
=
getActiveProtocols
();
}
}
ArrayList
<
CipherSuite
>
suites
=
new
ArrayList
<
CipherSuite
>();
ArrayList
<
CipherSuite
>
suites
=
new
ArrayList
<>();
if
(!(
activeProtocols
.
collection
().
isEmpty
())
&&
if
(!(
activeProtocols
.
collection
().
isEmpty
())
&&
activeProtocols
.
min
.
v
!=
ProtocolVersion
.
NONE
.
v
)
{
activeProtocols
.
min
.
v
!=
ProtocolVersion
.
NONE
.
v
)
{
for
(
CipherSuite
suite
:
enabledCipherSuites
.
collection
())
{
for
(
CipherSuite
suite
:
enabledCipherSuites
.
collection
())
{
...
@@ -614,8 +614,7 @@ abstract class Handshaker {
...
@@ -614,8 +614,7 @@ abstract class Handshaker {
*/
*/
ProtocolList
getActiveProtocols
()
{
ProtocolList
getActiveProtocols
()
{
if
(
activeProtocols
==
null
)
{
if
(
activeProtocols
==
null
)
{
ArrayList
<
ProtocolVersion
>
protocols
=
ArrayList
<
ProtocolVersion
>
protocols
=
new
ArrayList
<>(
4
);
new
ArrayList
<
ProtocolVersion
>(
4
);
for
(
ProtocolVersion
protocol
:
enabledProtocols
.
collection
())
{
for
(
ProtocolVersion
protocol
:
enabledProtocols
.
collection
())
{
boolean
found
=
false
;
boolean
found
=
false
;
for
(
CipherSuite
suite
:
enabledCipherSuites
.
collection
())
{
for
(
CipherSuite
suite
:
enabledCipherSuites
.
collection
())
{
...
...
src/share/classes/sun/security/ssl/HelloExtensions.java
浏览文件 @
af9d07b8
...
@@ -169,8 +169,7 @@ final class ExtensionType {
...
@@ -169,8 +169,7 @@ final class ExtensionType {
return
name
;
return
name
;
}
}
static
List
<
ExtensionType
>
knownExtensions
=
static
List
<
ExtensionType
>
knownExtensions
=
new
ArrayList
<>(
9
);
new
ArrayList
<
ExtensionType
>(
9
);
static
ExtensionType
get
(
int
id
)
{
static
ExtensionType
get
(
int
id
)
{
for
(
ExtensionType
ext
:
knownExtensions
)
{
for
(
ExtensionType
ext
:
knownExtensions
)
{
...
@@ -674,7 +673,7 @@ final class SupportedEllipticPointFormatsExtension extends HelloExtension {
...
@@ -674,7 +673,7 @@ final class SupportedEllipticPointFormatsExtension extends HelloExtension {
}
}
public
String
toString
()
{
public
String
toString
()
{
List
<
String
>
list
=
new
ArrayList
<
String
>();
List
<
String
>
list
=
new
ArrayList
<>();
for
(
byte
format
:
formats
)
{
for
(
byte
format
:
formats
)
{
list
.
add
(
toString
(
format
));
list
.
add
(
toString
(
format
));
}
}
...
...
src/share/classes/sun/security/ssl/ProtocolList.java
浏览文件 @
af9d07b8
...
@@ -83,7 +83,7 @@ final class ProtocolList {
...
@@ -83,7 +83,7 @@ final class ProtocolList {
throw
new
IllegalArgumentException
(
"Protocols may not be null"
);
throw
new
IllegalArgumentException
(
"Protocols may not be null"
);
}
}
ArrayList
<
ProtocolVersion
>
versions
=
new
ArrayList
<
ProtocolVersion
>(
3
);
ArrayList
<
ProtocolVersion
>
versions
=
new
ArrayList
<>(
3
);
for
(
int
i
=
0
;
i
<
names
.
length
;
i
++
)
{
for
(
int
i
=
0
;
i
<
names
.
length
;
i
++
)
{
ProtocolVersion
version
=
ProtocolVersion
.
valueOf
(
names
[
i
]);
ProtocolVersion
version
=
ProtocolVersion
.
valueOf
(
names
[
i
]);
if
(
versions
.
contains
(
version
)
==
false
)
{
if
(
versions
.
contains
(
version
)
==
false
)
{
...
...
src/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java
浏览文件 @
af9d07b8
...
@@ -261,7 +261,7 @@ final class SSLAlgorithmConstraints implements AlgorithmConstraints {
...
@@ -261,7 +261,7 @@ final class SSLAlgorithmConstraints implements AlgorithmConstraints {
protected
Set
<
String
>
decomposes
(
KeyExchange
keyExchange
,
protected
Set
<
String
>
decomposes
(
KeyExchange
keyExchange
,
boolean
forCertPathOnly
)
{
boolean
forCertPathOnly
)
{
Set
<
String
>
components
=
new
HashSet
<
String
>();
Set
<
String
>
components
=
new
HashSet
<>();
switch
(
keyExchange
)
{
switch
(
keyExchange
)
{
case
K_NULL:
case
K_NULL:
if
(!
forCertPathOnly
)
{
if
(!
forCertPathOnly
)
{
...
@@ -356,7 +356,7 @@ final class SSLAlgorithmConstraints implements AlgorithmConstraints {
...
@@ -356,7 +356,7 @@ final class SSLAlgorithmConstraints implements AlgorithmConstraints {
}
}
protected
Set
<
String
>
decomposes
(
BulkCipher
bulkCipher
)
{
protected
Set
<
String
>
decomposes
(
BulkCipher
bulkCipher
)
{
Set
<
String
>
components
=
new
HashSet
<
String
>();
Set
<
String
>
components
=
new
HashSet
<>();
if
(
bulkCipher
.
transformation
!=
null
)
{
if
(
bulkCipher
.
transformation
!=
null
)
{
components
.
addAll
(
super
.
decomposes
(
bulkCipher
.
transformation
));
components
.
addAll
(
super
.
decomposes
(
bulkCipher
.
transformation
));
...
@@ -366,7 +366,7 @@ final class SSLAlgorithmConstraints implements AlgorithmConstraints {
...
@@ -366,7 +366,7 @@ final class SSLAlgorithmConstraints implements AlgorithmConstraints {
}
}
protected
Set
<
String
>
decomposes
(
MacAlg
macAlg
)
{
protected
Set
<
String
>
decomposes
(
MacAlg
macAlg
)
{
Set
<
String
>
components
=
new
HashSet
<
String
>();
Set
<
String
>
components
=
new
HashSet
<>();
if
(
macAlg
==
CipherSuite
.
M_MD5
)
{
if
(
macAlg
==
CipherSuite
.
M_MD5
)
{
components
.
add
(
"MD5"
);
components
.
add
(
"MD5"
);
...
@@ -407,7 +407,7 @@ final class SSLAlgorithmConstraints implements AlgorithmConstraints {
...
@@ -407,7 +407,7 @@ final class SSLAlgorithmConstraints implements AlgorithmConstraints {
}
}
if
(
cipherSuite
!=
null
)
{
if
(
cipherSuite
!=
null
)
{
Set
<
String
>
components
=
new
HashSet
<
String
>();
Set
<
String
>
components
=
new
HashSet
<>();
if
(
cipherSuite
.
keyExchange
!=
null
)
{
if
(
cipherSuite
.
keyExchange
!=
null
)
{
components
.
addAll
(
components
.
addAll
(
...
@@ -448,7 +448,7 @@ final class SSLAlgorithmConstraints implements AlgorithmConstraints {
...
@@ -448,7 +448,7 @@ final class SSLAlgorithmConstraints implements AlgorithmConstraints {
}
}
if
(
cipherSuite
!=
null
)
{
if
(
cipherSuite
!=
null
)
{
Set
<
String
>
components
=
new
HashSet
<
String
>();
Set
<
String
>
components
=
new
HashSet
<>();
if
(
cipherSuite
.
keyExchange
!=
null
)
{
if
(
cipherSuite
.
keyExchange
!=
null
)
{
components
.
addAll
(
components
.
addAll
(
...
...
src/share/classes/sun/security/ssl/SSLSessionImpl.java
浏览文件 @
af9d07b8
...
@@ -618,8 +618,7 @@ final class SSLSessionImpl extends ExtendedSSLSession {
...
@@ -618,8 +618,7 @@ final class SSLSessionImpl extends ExtendedSSLSession {
* key and the calling security context. This is important since
* key and the calling security context. This is important since
* sessions can be shared across different protection domains.
* sessions can be shared across different protection domains.
*/
*/
private
Hashtable
<
SecureKey
,
Object
>
table
=
private
Hashtable
<
SecureKey
,
Object
>
table
=
new
Hashtable
<>();
new
Hashtable
<
SecureKey
,
Object
>();
/**
/**
* Assigns a session value. Session change events are given if
* Assigns a session value. Session change events are given if
...
@@ -687,7 +686,7 @@ final class SSLSessionImpl extends ExtendedSSLSession {
...
@@ -687,7 +686,7 @@ final class SSLSessionImpl extends ExtendedSSLSession {
*/
*/
public
String
[]
getValueNames
()
{
public
String
[]
getValueNames
()
{
Enumeration
<
SecureKey
>
e
;
Enumeration
<
SecureKey
>
e
;
Vector
<
Object
>
v
=
new
Vector
<
Object
>();
Vector
<
Object
>
v
=
new
Vector
<>();
SecureKey
key
;
SecureKey
key
;
Object
securityCtx
=
SecureKey
.
getCurrentSecurityContext
();
Object
securityCtx
=
SecureKey
.
getCurrentSecurityContext
();
...
...
src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java
浏览文件 @
af9d07b8
...
@@ -153,8 +153,7 @@ final class SignatureAndHashAlgorithm {
...
@@ -153,8 +153,7 @@ final class SignatureAndHashAlgorithm {
static
Collection
<
SignatureAndHashAlgorithm
>
static
Collection
<
SignatureAndHashAlgorithm
>
getSupportedAlgorithms
(
AlgorithmConstraints
constraints
)
{
getSupportedAlgorithms
(
AlgorithmConstraints
constraints
)
{
Collection
<
SignatureAndHashAlgorithm
>
supported
=
Collection
<
SignatureAndHashAlgorithm
>
supported
=
new
ArrayList
<>();
new
ArrayList
<
SignatureAndHashAlgorithm
>();
synchronized
(
priorityMap
)
{
synchronized
(
priorityMap
)
{
for
(
SignatureAndHashAlgorithm
sigAlg
:
priorityMap
.
values
())
{
for
(
SignatureAndHashAlgorithm
sigAlg
:
priorityMap
.
values
())
{
if
(
sigAlg
.
priority
<=
SUPPORTED_ALG_PRIORITY_MAX_NUM
&&
if
(
sigAlg
.
priority
<=
SUPPORTED_ALG_PRIORITY_MAX_NUM
&&
...
@@ -171,8 +170,7 @@ final class SignatureAndHashAlgorithm {
...
@@ -171,8 +170,7 @@ final class SignatureAndHashAlgorithm {
// Get supported algorithm collection from an untrusted collection
// Get supported algorithm collection from an untrusted collection
static
Collection
<
SignatureAndHashAlgorithm
>
getSupportedAlgorithms
(
static
Collection
<
SignatureAndHashAlgorithm
>
getSupportedAlgorithms
(
Collection
<
SignatureAndHashAlgorithm
>
algorithms
)
{
Collection
<
SignatureAndHashAlgorithm
>
algorithms
)
{
Collection
<
SignatureAndHashAlgorithm
>
supported
=
Collection
<
SignatureAndHashAlgorithm
>
supported
=
new
ArrayList
<>();
new
ArrayList
<
SignatureAndHashAlgorithm
>();
for
(
SignatureAndHashAlgorithm
sigAlg
:
algorithms
)
{
for
(
SignatureAndHashAlgorithm
sigAlg
:
algorithms
)
{
if
(
sigAlg
.
priority
<=
SUPPORTED_ALG_PRIORITY_MAX_NUM
)
{
if
(
sigAlg
.
priority
<=
SUPPORTED_ALG_PRIORITY_MAX_NUM
)
{
supported
.
add
(
sigAlg
);
supported
.
add
(
sigAlg
);
...
@@ -184,7 +182,7 @@ final class SignatureAndHashAlgorithm {
...
@@ -184,7 +182,7 @@ final class SignatureAndHashAlgorithm {
static
String
[]
getAlgorithmNames
(
static
String
[]
getAlgorithmNames
(
Collection
<
SignatureAndHashAlgorithm
>
algorithms
)
{
Collection
<
SignatureAndHashAlgorithm
>
algorithms
)
{
ArrayList
<
String
>
algorithmNames
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
algorithmNames
=
new
ArrayList
<>();
if
(
algorithms
!=
null
)
{
if
(
algorithms
!=
null
)
{
for
(
SignatureAndHashAlgorithm
sigAlg
:
algorithms
)
{
for
(
SignatureAndHashAlgorithm
sigAlg
:
algorithms
)
{
algorithmNames
.
add
(
sigAlg
.
algorithm
);
algorithmNames
.
add
(
sigAlg
.
algorithm
);
...
@@ -197,7 +195,7 @@ final class SignatureAndHashAlgorithm {
...
@@ -197,7 +195,7 @@ final class SignatureAndHashAlgorithm {
static
Set
<
String
>
getHashAlgorithmNames
(
static
Set
<
String
>
getHashAlgorithmNames
(
Collection
<
SignatureAndHashAlgorithm
>
algorithms
)
{
Collection
<
SignatureAndHashAlgorithm
>
algorithms
)
{
Set
<
String
>
algorithmNames
=
new
HashSet
<
String
>();
Set
<
String
>
algorithmNames
=
new
HashSet
<>();
if
(
algorithms
!=
null
)
{
if
(
algorithms
!=
null
)
{
for
(
SignatureAndHashAlgorithm
sigAlg
:
algorithms
)
{
for
(
SignatureAndHashAlgorithm
sigAlg
:
algorithms
)
{
if
(
sigAlg
.
hash
.
value
>
0
)
{
if
(
sigAlg
.
hash
.
value
>
0
)
{
...
...
src/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java
浏览文件 @
af9d07b8
...
@@ -337,7 +337,7 @@ final class SunX509KeyManagerImpl extends X509ExtendedKeyManager {
...
@@ -337,7 +337,7 @@ final class SunX509KeyManagerImpl extends X509ExtendedKeyManager {
X500Principal
[]
x500Issuers
=
(
X500Principal
[])
issuers
;
X500Principal
[]
x500Issuers
=
(
X500Principal
[])
issuers
;
// the algorithm below does not produce duplicates, so avoid Set
// the algorithm below does not produce duplicates, so avoid Set
List
<
String
>
aliases
=
new
ArrayList
<
String
>();
List
<
String
>
aliases
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
X509Credentials
>
entry
:
for
(
Map
.
Entry
<
String
,
X509Credentials
>
entry
:
credentialsMap
.
entrySet
())
{
credentialsMap
.
entrySet
())
{
...
@@ -397,7 +397,7 @@ final class SunX509KeyManagerImpl extends X509ExtendedKeyManager {
...
@@ -397,7 +397,7 @@ final class SunX509KeyManagerImpl extends X509ExtendedKeyManager {
* possible. Principals that cannot be converted are ignored.
* possible. Principals that cannot be converted are ignored.
*/
*/
private
static
X500Principal
[]
convertPrincipals
(
Principal
[]
principals
)
{
private
static
X500Principal
[]
convertPrincipals
(
Principal
[]
principals
)
{
List
<
X500Principal
>
list
=
new
ArrayList
<
X500Principal
>(
principals
.
length
);
List
<
X500Principal
>
list
=
new
ArrayList
<>(
principals
.
length
);
for
(
int
i
=
0
;
i
<
principals
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
principals
.
length
;
i
++)
{
Principal
p
=
principals
[
i
];
Principal
p
=
principals
[
i
];
if
(
p
instanceof
X500Principal
)
{
if
(
p
instanceof
X500Principal
)
{
...
...
src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java
浏览文件 @
af9d07b8
...
@@ -134,7 +134,7 @@ abstract class TrustManagerFactoryImpl extends TrustManagerFactorySpi {
...
@@ -134,7 +134,7 @@ abstract class TrustManagerFactoryImpl extends TrustManagerFactorySpi {
FileInputStream
fis
=
null
;
FileInputStream
fis
=
null
;
String
defaultTrustStoreType
;
String
defaultTrustStoreType
;
String
defaultTrustStoreProvider
;
String
defaultTrustStoreProvider
;
final
HashMap
<
String
,
String
>
props
=
new
HashMap
<
String
,
String
>();
final
HashMap
<
String
,
String
>
props
=
new
HashMap
<>();
final
String
sep
=
File
.
separator
;
final
String
sep
=
File
.
separator
;
KeyStore
ks
=
null
;
KeyStore
ks
=
null
;
...
...
src/share/classes/sun/security/ssl/X509KeyManagerImpl.java
浏览文件 @
af9d07b8
...
@@ -307,7 +307,7 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager
...
@@ -307,7 +307,7 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager
(
keyTypes
.
length
==
0
)
||
(
keyTypes
[
0
]
==
null
))
{
(
keyTypes
.
length
==
0
)
||
(
keyTypes
[
0
]
==
null
))
{
return
null
;
return
null
;
}
}
List
<
KeyType
>
list
=
new
ArrayList
<
KeyType
>(
keyTypes
.
length
);
List
<
KeyType
>
list
=
new
ArrayList
<>(
keyTypes
.
length
);
for
(
String
keyType
:
keyTypes
)
{
for
(
String
keyType
:
keyTypes
)
{
list
.
add
(
new
KeyType
(
keyType
));
list
.
add
(
new
KeyType
(
keyType
));
}
}
...
@@ -429,7 +429,7 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager
...
@@ -429,7 +429,7 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager
// make a Set out of the array
// make a Set out of the array
private
Set
<
Principal
>
getIssuerSet
(
Principal
[]
issuers
)
{
private
Set
<
Principal
>
getIssuerSet
(
Principal
[]
issuers
)
{
if
((
issuers
!=
null
)
&&
(
issuers
.
length
!=
0
))
{
if
((
issuers
!=
null
)
&&
(
issuers
.
length
!=
0
))
{
return
new
HashSet
<
Principal
>(
Arrays
.
asList
(
issuers
));
return
new
HashSet
<>(
Arrays
.
asList
(
issuers
));
}
else
{
}
else
{
return
null
;
return
null
;
}
}
...
...
test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java
浏览文件 @
af9d07b8
...
@@ -300,8 +300,8 @@ public class CookieHandlerTest {
...
@@ -300,8 +300,8 @@ public class CookieHandlerTest {
getCalled
=
true
;
getCalled
=
true
;
// returns cookies[0]
// returns cookies[0]
// they will be include in request
// they will be include in request
Map
<
String
,
List
<
String
>>
map
=
new
HashMap
<
String
,
List
<
String
>
>();
Map
<
String
,
List
<
String
>>
map
=
new
HashMap
<>();
List
<
String
>
l
=
new
ArrayList
<
String
>();
List
<
String
>
l
=
new
ArrayList
<>();
l
.
add
(
cookies
.
get
(
"Cookie"
));
l
.
add
(
cookies
.
get
(
"Cookie"
));
map
.
put
(
"Cookie"
,
l
);
map
.
put
(
"Cookie"
,
l
);
return
Collections
.
unmodifiableMap
(
map
);
return
Collections
.
unmodifiableMap
(
map
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录