Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
9405fde6
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看板
提交
9405fde6
编写于
2月 05, 2015
作者:
X
xuelei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8067694: Improved certification checking
Reviewed-by: mullan, jnimeh, coffeys, robm, asmotrak, ahgross
上级
51179888
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
79 addition
and
5 deletion
+79
-5
src/share/classes/java/net/InetAddress.java
src/share/classes/java/net/InetAddress.java
+22
-1
src/share/classes/java/net/URLClassLoader.java
src/share/classes/java/net/URLClassLoader.java
+5
-1
src/share/classes/sun/misc/JavaNetAccess.java
src/share/classes/sun/misc/JavaNetAccess.java
+8
-1
src/share/classes/sun/security/ssl/SSLSocketImpl.java
src/share/classes/sun/security/ssl/SSLSocketImpl.java
+44
-2
未找到文件。
src/share/classes/java/net/InetAddress.java
浏览文件 @
9405fde6
/*
/*
* Copyright (c) 1995, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 201
5
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -203,16 +203,33 @@ class InetAddress implements java.io.Serializable {
...
@@ -203,16 +203,33 @@ class InetAddress implements java.io.Serializable {
static
transient
boolean
preferIPv6Address
=
false
;
static
transient
boolean
preferIPv6Address
=
false
;
static
class
InetAddressHolder
{
static
class
InetAddressHolder
{
/**
* Reserve the original application specified hostname.
*
* The original hostname is useful for domain-based endpoint
* identification (see RFC 2818 and RFC 6125). If an address
* was created with a raw IP address, a reverse name lookup
* may introduce endpoint identification security issue via
* DNS forging.
*
* Oracle JSSE provider is using this original hostname, via
* sun.misc.JavaNetAccess, for SSL/TLS endpoint identification.
*
* Note: May define a new public method in the future if necessary.
*/
private
String
originalHostName
;
InetAddressHolder
()
{}
InetAddressHolder
()
{}
InetAddressHolder
(
String
hostName
,
int
address
,
int
family
)
{
InetAddressHolder
(
String
hostName
,
int
address
,
int
family
)
{
this
.
originalHostName
=
hostName
;
this
.
hostName
=
hostName
;
this
.
hostName
=
hostName
;
this
.
address
=
address
;
this
.
address
=
address
;
this
.
family
=
family
;
this
.
family
=
family
;
}
}
void
init
(
String
hostName
,
int
family
)
{
void
init
(
String
hostName
,
int
family
)
{
this
.
originalHostName
=
hostName
;
this
.
hostName
=
hostName
;
this
.
hostName
=
hostName
;
if
(
family
!=
-
1
)
{
if
(
family
!=
-
1
)
{
this
.
family
=
family
;
this
.
family
=
family
;
...
@@ -225,6 +242,10 @@ class InetAddress implements java.io.Serializable {
...
@@ -225,6 +242,10 @@ class InetAddress implements java.io.Serializable {
return
hostName
;
return
hostName
;
}
}
String
getOriginalHostName
()
{
return
originalHostName
;
}
/**
/**
* Holds a 32-bit IPv4 address.
* Holds a 32-bit IPv4 address.
*/
*/
...
...
src/share/classes/java/net/URLClassLoader.java
浏览文件 @
9405fde6
/*
/*
* Copyright (c) 1997, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
5
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -774,6 +774,10 @@ public class URLClassLoader extends SecureClassLoader implements Closeable {
...
@@ -774,6 +774,10 @@ public class URLClassLoader extends SecureClassLoader implements Closeable {
public
URLClassPath
getURLClassPath
(
URLClassLoader
u
)
{
public
URLClassPath
getURLClassPath
(
URLClassLoader
u
)
{
return
u
.
ucp
;
return
u
.
ucp
;
}
}
public
String
getOriginalHostName
(
InetAddress
ia
)
{
return
ia
.
holder
.
getOriginalHostName
();
}
}
}
);
);
ClassLoader
.
registerAsParallelCapable
();
ClassLoader
.
registerAsParallelCapable
();
...
...
src/share/classes/sun/misc/JavaNetAccess.java
浏览文件 @
9405fde6
/*
/*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006,
2015,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -26,10 +26,17 @@
...
@@ -26,10 +26,17 @@
package
sun.misc
;
package
sun.misc
;
import
java.net.URLClassLoader
;
import
java.net.URLClassLoader
;
import
java.net.InetAddress
;
public
interface
JavaNetAccess
{
public
interface
JavaNetAccess
{
/**
/**
* return the URLClassPath belonging to the given loader
* return the URLClassPath belonging to the given loader
*/
*/
URLClassPath
getURLClassPath
(
URLClassLoader
u
);
URLClassPath
getURLClassPath
(
URLClassLoader
u
);
/**
* Return the original application specified hostname of
* the given InetAddress object.
*/
String
getOriginalHostName
(
InetAddress
ia
);
}
}
src/share/classes/sun/security/ssl/SSLSocketImpl.java
浏览文件 @
9405fde6
/*
/*
* Copyright (c) 1996, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
5
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -40,6 +40,9 @@ import java.util.concurrent.locks.ReentrantLock;
...
@@ -40,6 +40,9 @@ import java.util.concurrent.locks.ReentrantLock;
import
javax.crypto.BadPaddingException
;
import
javax.crypto.BadPaddingException
;
import
javax.net.ssl.*
;
import
javax.net.ssl.*
;
import
sun.misc.JavaNetAccess
;
import
sun.misc.SharedSecrets
;
/**
/**
* Implementation of an SSL socket. This is a normal connection type
* Implementation of an SSL socket. This is a normal connection type
* socket, implementing SSL over some lower level socket, such as TCP.
* socket, implementing SSL over some lower level socket, such as TCP.
...
@@ -389,6 +392,15 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl {
...
@@ -389,6 +392,15 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl {
*/
*/
private
boolean
preferLocalCipherSuites
=
false
;
private
boolean
preferLocalCipherSuites
=
false
;
/*
* Is the local name service trustworthy?
*
* If the local name service is not trustworthy, reverse host name
* resolution should not be performed for endpoint identification.
*/
static
final
boolean
trustNameService
=
Debug
.
getBooleanProperty
(
"jdk.tls.trustNameService"
,
false
);
//
//
// CONSTRUCTORS AND INITIALIZATION CODE
// CONSTRUCTORS AND INITIALIZATION CODE
//
//
...
@@ -2149,11 +2161,41 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl {
...
@@ -2149,11 +2161,41 @@ final public class SSLSocketImpl extends BaseSSLSocketImpl {
synchronized
String
getHost
()
{
synchronized
String
getHost
()
{
// Note that the host may be null or empty for localhost.
// Note that the host may be null or empty for localhost.
if
(
host
==
null
||
host
.
length
()
==
0
)
{
if
(
host
==
null
||
host
.
length
()
==
0
)
{
host
=
getInetAddress
().
getHostName
();
if
(!
trustNameService
)
{
// If the local name service is not trustworthy, reverse host
// name resolution should not be performed for endpoint
// identification. Use the application original specified
// hostname or IP address instead.
host
=
getOriginalHostname
(
getInetAddress
());
}
else
{
host
=
getInetAddress
().
getHostName
();
}
}
}
return
host
;
return
host
;
}
}
/*
* Get the original application specified hostname.
*/
private
static
String
getOriginalHostname
(
InetAddress
inetAddress
)
{
/*
* Get the original hostname via sun.misc.SharedSecrets.
*/
JavaNetAccess
jna
=
SharedSecrets
.
getJavaNetAccess
();
String
originalHostname
=
jna
.
getOriginalHostName
(
inetAddress
);
/*
* If no application specified hostname, use the IP address.
*/
if
(
originalHostname
==
null
||
originalHostname
.
length
()
==
0
)
{
originalHostname
=
inetAddress
.
getHostAddress
();
}
return
originalHostname
;
}
// ONLY used by HttpsClient to setup the URI specified hostname
// ONLY used by HttpsClient to setup the URI specified hostname
//
//
// Please NOTE that this method MUST be called before calling to
// Please NOTE that this method MUST be called before calling to
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录