Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
23d60d16
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
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,发现更多精彩内容 >>
提交
23d60d16
编写于
11月 13, 2013
作者:
X
xuelei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8023147: Test DisabledShortRSAKeys.java intermittent failed
Reviewed-by: mullan
上级
a143d744
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
38 addition
and
30 deletion
+38
-30
test/sun/security/ssl/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java
...curity/ssl/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java
+38
-30
未找到文件。
test/sun/security/ssl/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java
浏览文件 @
23d60d16
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012,
2013,
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
...
...
@@ -152,12 +152,9 @@ public class DisabledShortRSAKeys {
serverReady
=
true
;
try
(
SSLSocket
sslSocket
=
(
SSLSocket
)
sslServerSocket
.
accept
())
{
InputStream
sslIS
=
sslSocket
.
getInputStream
();
OutputStream
sslOS
=
sslSocket
.
getOutputStream
();
sslIS
.
read
();
sslOS
.
write
(
'A'
);
sslOS
.
flush
();
try
(
InputStream
sslIS
=
sslSocket
.
getInputStream
())
{
sslIS
.
read
();
}
throw
new
Exception
(
"RSA keys shorter than 1024 bits should be disabled"
);
...
...
@@ -194,12 +191,10 @@ public class DisabledShortRSAKeys {
sslSocket
.
setEnabledCipherSuites
(
new
String
[]
{
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA"
});
InputStream
sslIS
=
sslSocket
.
getInputStream
();
OutputStream
sslOS
=
sslSocket
.
getOutputStream
();
sslOS
.
write
(
'B'
);
sslOS
.
flush
();
sslIS
.
read
();
try
(
OutputStream
sslOS
=
sslSocket
.
getOutputStream
())
{
sslOS
.
write
(
'B'
);
sslOS
.
flush
();
}
throw
new
Exception
(
"RSA keys shorter than 1024 bits should be disabled"
);
...
...
@@ -317,6 +312,7 @@ public class DisabledShortRSAKeys {
* Fork off the other side, then do your work.
*/
DisabledShortRSAKeys
()
throws
Exception
{
Exception
startException
=
null
;
try
{
if
(
separateServerThread
)
{
startServer
(
true
);
...
...
@@ -326,16 +322,20 @@ public class DisabledShortRSAKeys {
startServer
(
false
);
}
}
catch
(
Exception
e
)
{
// swallow for now. Show later
startException
=
e
;
}
/*
* Wait for other side to close down.
*/
if
(
separateServerThread
)
{
serverThread
.
join
();
if
(
serverThread
!=
null
)
{
serverThread
.
join
();
}
}
else
{
clientThread
.
join
();
if
(
clientThread
!=
null
)
{
clientThread
.
join
();
}
}
/*
...
...
@@ -344,36 +344,44 @@ public class DisabledShortRSAKeys {
*/
Exception
local
;
Exception
remote
;
String
whichRemote
;
if
(
separateServerThread
)
{
remote
=
serverException
;
local
=
clientException
;
whichRemote
=
"server"
;
}
else
{
remote
=
clientException
;
local
=
serverException
;
whichRemote
=
"client"
;
}
Exception
exception
=
null
;
/*
* If both failed, return the curthread's exception, but also
* print the remote side Exception
* Check various exception conditions.
*/
if
((
local
!=
null
)
&&
(
remote
!=
null
))
{
System
.
out
.
println
(
whichRemote
+
" also threw:"
);
remote
.
printStackTrace
();
System
.
out
.
println
();
throw
local
;
// If both failed, return the curthread's exception.
local
.
initCause
(
remote
);
exception
=
local
;
}
else
if
(
local
!=
null
)
{
exception
=
local
;
}
else
if
(
remote
!=
null
)
{
exception
=
remote
;
}
else
if
(
startException
!=
null
)
{
exception
=
startException
;
}
if
(
remote
!=
null
)
{
throw
remote
;
/*
* If there was an exception *AND* a startException,
* output it.
*/
if
(
exception
!=
null
)
{
if
(
exception
!=
startException
&&
startException
!=
null
)
{
exception
.
addSuppressed
(
startException
);
}
throw
exception
;
}
if
(
local
!=
null
)
{
throw
local
;
}
// Fall-through: no exception to throw!
}
void
startServer
(
boolean
newThread
)
throws
Exception
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录