Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
c73ffeb6
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看板
提交
c73ffeb6
编写于
10月 05, 2009
作者:
V
vinnie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6885204: JSSE should not require Kerberos to be present
Reviewed-by: wetmore, alanb
上级
c8465694
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
51 addition
and
10 deletion
+51
-10
src/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java
...ternal/www/protocol/https/DelegateHttpsURLConnection.java
+5
-2
src/share/classes/sun/net/www/protocol/https/HttpsClient.java
...share/classes/sun/net/www/protocol/https/HttpsClient.java
+6
-3
src/share/classes/sun/security/ssl/CipherSuite.java
src/share/classes/sun/security/ssl/CipherSuite.java
+12
-4
src/share/classes/sun/security/ssl/JsseJce.java
src/share/classes/sun/security/ssl/JsseJce.java
+28
-1
未找到文件。
src/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java
浏览文件 @
c73ffeb6
/*
* Copyright 2001-200
5
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2001-200
9
Sun Microsystems, Inc. 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
...
...
@@ -116,7 +116,10 @@ class VerifierWrapper implements javax.net.ssl.HostnameVerifier {
try
{
String
serverName
;
Principal
principal
=
getPeerPrincipal
(
session
);
if
(
principal
instanceof
KerberosPrincipal
)
{
// X.500 principal or Kerberos principal.
// (Use ciphersuite check to determine whether Kerberos is present.)
if
(
session
.
getCipherSuite
().
startsWith
(
"TLS_KRB5"
)
&&
principal
instanceof
KerberosPrincipal
)
{
serverName
=
HostnameChecker
.
getServerName
((
KerberosPrincipal
)
principal
);
}
else
{
...
...
src/share/classes/sun/net/www/protocol/https/HttpsClient.java
浏览文件 @
c73ffeb6
/*
* Copyright 2001-200
8
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2001-200
9
Sun Microsystems, Inc. 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
...
...
@@ -461,12 +461,16 @@ final class HttpsClient extends HttpClient
}
Certificate
[]
peerCerts
=
null
;
String
cipher
=
session
.
getCipherSuite
();
try
{
HostnameChecker
checker
=
HostnameChecker
.
getInstance
(
HostnameChecker
.
TYPE_TLS
);
Principal
principal
=
getPeerPrincipal
();
if
(
principal
instanceof
KerberosPrincipal
)
{
// X.500 principal or Kerberos principal.
// (Use ciphersuite check to determine whether Kerberos is present.)
if
(
cipher
.
startsWith
(
"TLS_KRB5"
)
&&
principal
instanceof
KerberosPrincipal
)
{
if
(!
checker
.
match
(
host
,
(
KerberosPrincipal
)
principal
))
{
throw
new
SSLPeerUnverifiedException
(
"Hostname checker"
+
" failed for Kerberos"
);
...
...
@@ -499,7 +503,6 @@ final class HttpsClient extends HttpClient
// ignore
}
String
cipher
=
session
.
getCipherSuite
();
if
((
cipher
!=
null
)
&&
(
cipher
.
indexOf
(
"_anon_"
)
!=
-
1
))
{
return
;
}
else
if
((
hostnameVerifier
!=
null
)
&&
...
...
src/share/classes/sun/security/ssl/CipherSuite.java
浏览文件 @
c73ffeb6
/*
* Copyright 2002-200
8
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2002-200
9
Sun Microsystems, Inc. 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
...
...
@@ -74,7 +74,7 @@ final class CipherSuite implements Comparable {
// Flag indicating if CipherSuite availability can change dynamically.
// This is the case when we rely on a JCE cipher implementation that
// may not be available in the installed JCE providers.
// It is true because we
do not have a Java ECC
implementation.
// It is true because we
might not have an ECC or Kerberos
implementation.
final
static
boolean
DYNAMIC_AVAILABILITY
=
true
;
private
final
static
boolean
ALLOW_ECC
=
Debug
.
getBooleanProperty
...
...
@@ -278,14 +278,22 @@ final class CipherSuite implements Comparable {
KeyExchange
(
String
name
,
boolean
allowed
)
{
this
.
name
=
name
;
this
.
allowed
=
allowed
;
this
.
alwaysAvailable
=
allowed
&&
(
name
.
startsWith
(
"EC"
)
==
false
);
this
.
alwaysAvailable
=
allowed
&&
(!
name
.
startsWith
(
"EC"
))
&&
(!
name
.
startsWith
(
"KRB"
));
}
boolean
isAvailable
()
{
if
(
alwaysAvailable
)
{
return
true
;
}
return
allowed
&&
JsseJce
.
isEcAvailable
();
if
(
name
.
startsWith
(
"EC"
))
{
return
(
allowed
&&
JsseJce
.
isEcAvailable
());
}
else
if
(
name
.
startsWith
(
"KRB"
))
{
return
(
allowed
&&
JsseJce
.
isKerberosAvailable
());
}
else
{
return
allowed
;
}
}
public
String
toString
()
{
...
...
src/share/classes/sun/security/ssl/JsseJce.java
浏览文件 @
c73ffeb6
/*
* Copyright 2001-200
8
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2001-200
9
Sun Microsystems, Inc. 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
...
...
@@ -64,6 +64,29 @@ final class JsseJce {
// If yes, then all the EC based crypto we need is available.
private
static
volatile
Boolean
ecAvailable
;
// Flag indicating whether Kerberos crypto is available.
// If true, then all the Kerberos-based crypto we need is available.
private
final
static
boolean
kerberosAvailable
;
static
{
boolean
temp
;
try
{
AccessController
.
doPrivileged
(
new
PrivilegedExceptionAction
<
Void
>()
{
public
Void
run
()
throws
Exception
{
// Test for Kerberos using the bootstrap class loader
Class
.
forName
(
"sun.security.krb5.PrincipalName"
,
true
,
null
);
return
null
;
}
});
temp
=
true
;
}
catch
(
Exception
e
)
{
temp
=
false
;
}
kerberosAvailable
=
temp
;
}
static
{
// force FIPS flag initialization
// Because isFIPS() is synchronized and cryptoProvider is not modified
...
...
@@ -187,6 +210,10 @@ final class JsseJce {
ecAvailable
=
null
;
}
static
boolean
isKerberosAvailable
()
{
return
kerberosAvailable
;
}
/**
* Return an JCE cipher implementation for the specified algorithm.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录