Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
0a8d223a
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看板
提交
0a8d223a
编写于
6月 14, 2018
作者:
I
igerasim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8202613: Improve TLS connections stability
Reviewed-by: xuelei, wetmore
上级
cd794d1a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
58 addition
and
9 deletion
+58
-9
src/share/classes/sun/security/ssl/ClientHandshaker.java
src/share/classes/sun/security/ssl/ClientHandshaker.java
+21
-2
src/share/classes/sun/security/ssl/SSLSessionImpl.java
src/share/classes/sun/security/ssl/SSLSessionImpl.java
+15
-5
src/share/classes/sun/security/ssl/ServerHandshaker.java
src/share/classes/sun/security/ssl/ServerHandshaker.java
+22
-2
未找到文件。
src/share/classes/sun/security/ssl/ClientHandshaker.java
浏览文件 @
0a8d223a
/*
* Copyright (c) 1996, 201
5
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
8
, 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
...
...
@@ -711,7 +711,8 @@ final class ClientHandshaker extends Handshaker {
session
=
new
SSLSessionImpl
(
protocolVersion
,
cipherSuite
,
getLocalSupportedSignAlgs
(),
mesg
.
sessionId
,
getHostSE
(),
getPortSE
(),
(
extendedMasterSecretExt
!=
null
));
(
extendedMasterSecretExt
!=
null
),
getEndpointIdentificationAlgorithmSE
());
session
.
setRequestedServerNames
(
requestedServerNames
);
setHandshakeSessionSE
(
session
);
if
(
debug
!=
null
&&
Debug
.
isOn
(
"handshake"
))
{
...
...
@@ -1385,6 +1386,24 @@ final class ClientHandshaker extends Handshaker {
}
}
// ensure that the endpoint identification algorithm matches the
// one in the session
String
identityAlg
=
getEndpointIdentificationAlgorithmSE
();
if
(
session
!=
null
&&
identityAlg
!=
null
)
{
String
sessionIdentityAlg
=
session
.
getEndpointIdentificationAlgorithm
();
if
(!
Objects
.
equals
(
identityAlg
,
sessionIdentityAlg
))
{
if
(
debug
!=
null
&&
Debug
.
isOn
(
"session"
))
{
System
.
out
.
println
(
"%% can't resume, endpoint id"
+
" algorithm does not match, requested: "
+
identityAlg
+
", cached: "
+
sessionIdentityAlg
);
}
session
=
null
;
}
}
if
(
session
!=
null
)
{
if
(
debug
!=
null
)
{
if
(
Debug
.
isOn
(
"handshake"
)
||
Debug
.
isOn
(
"session"
))
{
...
...
src/share/classes/sun/security/ssl/SSLSessionImpl.java
浏览文件 @
0a8d223a
/*
* Copyright (c) 1996, 201
7
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
8
, 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
...
...
@@ -115,6 +115,10 @@ final class SSLSessionImpl extends ExtendedSSLSession {
private
Principal
peerPrincipal
;
private
Principal
localPrincipal
;
// The endpoint identification algorithm used to check certificates
// in this session.
private
final
String
endpointIdentificationAlgorithm
;
/*
* Is the session currently re-established with a session-resumption
* abbreviated initial handshake?
...
...
@@ -146,7 +150,7 @@ final class SSLSessionImpl extends ExtendedSSLSession {
*/
private
SSLSessionImpl
()
{
this
(
ProtocolVersion
.
NONE
,
CipherSuite
.
C_NULL
,
null
,
new
SessionId
(
false
,
null
),
null
,
-
1
,
false
);
new
SessionId
(
false
,
null
),
null
,
-
1
,
false
,
null
);
}
/*
...
...
@@ -157,10 +161,10 @@ final class SSLSessionImpl extends ExtendedSSLSession {
SSLSessionImpl
(
ProtocolVersion
protocolVersion
,
CipherSuite
cipherSuite
,
Collection
<
SignatureAndHashAlgorithm
>
algorithms
,
SecureRandom
generator
,
String
host
,
int
port
,
boolean
useExtendedMasterSecret
)
{
boolean
useExtendedMasterSecret
,
String
endpointIdAlgorithm
)
{
this
(
protocolVersion
,
cipherSuite
,
algorithms
,
new
SessionId
(
defaultRejoinable
,
generator
),
host
,
port
,
useExtendedMasterSecret
);
useExtendedMasterSecret
,
endpointIdAlgorithm
);
}
/*
...
...
@@ -169,7 +173,8 @@ final class SSLSessionImpl extends ExtendedSSLSession {
SSLSessionImpl
(
ProtocolVersion
protocolVersion
,
CipherSuite
cipherSuite
,
Collection
<
SignatureAndHashAlgorithm
>
algorithms
,
SessionId
id
,
String
host
,
int
port
,
boolean
useExtendedMasterSecret
)
{
boolean
useExtendedMasterSecret
,
String
endpointIdAlgorithm
){
this
.
protocolVersion
=
protocolVersion
;
sessionId
=
id
;
peerCerts
=
null
;
...
...
@@ -182,6 +187,7 @@ final class SSLSessionImpl extends ExtendedSSLSession {
localSupportedSignAlgs
=
SignatureAndHashAlgorithm
.
getAlgorithmNames
(
algorithms
);
this
.
useExtendedMasterSecret
=
useExtendedMasterSecret
;
this
.
endpointIdentificationAlgorithm
=
endpointIdAlgorithm
;
if
(
debug
!=
null
&&
Debug
.
isOn
(
"session"
))
{
System
.
out
.
println
(
"%% Initialized: "
+
this
);
...
...
@@ -247,6 +253,10 @@ final class SSLSessionImpl extends ExtendedSSLSession {
localPrincipal
=
principal
;
}
String
getEndpointIdentificationAlgorithm
()
{
return
this
.
endpointIdentificationAlgorithm
;
}
/**
* Returns true iff this session may be resumed ... sessions are
* usually resumable. Security policies may suggest otherwise,
...
...
src/share/classes/sun/security/ssl/ServerHandshaker.java
浏览文件 @
0a8d223a
/*
* Copyright (c) 1996, 201
7
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
8
, 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
...
...
@@ -711,6 +711,25 @@ final class ServerHandshaker extends Handshaker {
}
}
// ensure that the endpoint identification algorithm matches the
// one in the session
String
identityAlg
=
getEndpointIdentificationAlgorithmSE
();
if
(
resumingSession
&&
identityAlg
!=
null
)
{
String
sessionIdentityAlg
=
previous
.
getEndpointIdentificationAlgorithm
();
if
(!
Objects
.
equals
(
identityAlg
,
sessionIdentityAlg
))
{
if
(
debug
!=
null
&&
Debug
.
isOn
(
"session"
))
{
System
.
out
.
println
(
"%% can't resume, endpoint id"
+
" algorithm does not match, requested: "
+
identityAlg
+
", cached: "
+
sessionIdentityAlg
);
}
resumingSession
=
false
;
}
}
if
(
resumingSession
)
{
CipherSuite
suite
=
previous
.
getSuite
();
// verify that the ciphersuite from the cached session
...
...
@@ -782,7 +801,8 @@ final class ServerHandshaker extends Handshaker {
sslContext
.
getSecureRandom
(),
getHostAddressSE
(),
getPortSE
(),
(
requestedToUseEMS
&&
(
protocolVersion
.
v
>=
ProtocolVersion
.
TLS10
.
v
)));
(
protocolVersion
.
v
>=
ProtocolVersion
.
TLS10
.
v
)),
getEndpointIdentificationAlgorithmSE
());
if
(
protocolVersion
.
v
>=
ProtocolVersion
.
TLS12
.
v
)
{
if
(
peerSupportedSignAlgs
!=
null
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录