Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
a7fc6b8f
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看板
提交
a7fc6b8f
编写于
1月 15, 2020
作者:
A
andrew
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8132111: Do not request for addresses for forwarded TGT
Reviewed-by: mbalao, shade
上级
a60ab219
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
16 addition
and
26 deletion
+16
-26
src/share/classes/sun/security/krb5/KrbCred.java
src/share/classes/sun/security/krb5/KrbCred.java
+1
-25
src/share/classes/sun/security/krb5/internal/HostAddress.java
...share/classes/sun/security/krb5/internal/HostAddress.java
+8
-0
src/share/classes/sun/security/krb5/internal/HostAddresses.java
...are/classes/sun/security/krb5/internal/HostAddresses.java
+5
-0
test/sun/security/krb5/auto/KDC.java
test/sun/security/krb5/auto/KDC.java
+2
-1
未找到文件。
src/share/classes/sun/security/krb5/KrbCred.java
浏览文件 @
a7fc6b8f
...
@@ -34,8 +34,6 @@ package sun.security.krb5;
...
@@ -34,8 +34,6 @@ package sun.security.krb5;
import
sun.security.krb5.internal.*
;
import
sun.security.krb5.internal.*
;
import
sun.security.krb5.internal.crypto.KeyUsage
;
import
sun.security.krb5.internal.crypto.KeyUsage
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.net.InetAddress
;
import
java.net.UnknownHostException
;
import
sun.security.util.DerValue
;
import
sun.security.util.DerValue
;
...
@@ -65,7 +63,6 @@ public class KrbCred {
...
@@ -65,7 +63,6 @@ public class KrbCred {
PrincipalName
client
=
tgt
.
getClient
();
PrincipalName
client
=
tgt
.
getClient
();
PrincipalName
tgService
=
tgt
.
getServer
();
PrincipalName
tgService
=
tgt
.
getServer
();
PrincipalName
server
=
serviceTicket
.
getServer
();
if
(!
serviceTicket
.
getClient
().
equals
(
client
))
if
(!
serviceTicket
.
getClient
().
equals
(
client
))
throw
new
KrbException
(
Krb5
.
KRB_ERR_GENERIC
,
throw
new
KrbException
(
Krb5
.
KRB_ERR_GENERIC
,
"Client principal does not match"
);
"Client principal does not match"
);
...
@@ -78,29 +75,9 @@ public class KrbCred {
...
@@ -78,29 +75,9 @@ public class KrbCred {
options
.
set
(
KDCOptions
.
FORWARDED
,
true
);
options
.
set
(
KDCOptions
.
FORWARDED
,
true
);
options
.
set
(
KDCOptions
.
FORWARDABLE
,
true
);
options
.
set
(
KDCOptions
.
FORWARDABLE
,
true
);
HostAddresses
sAddrs
=
null
;
// GSSName.NT_HOSTBASED_SERVICE should display with KRB_NT_SRV_HST
if
(
server
.
getNameType
()
==
PrincipalName
.
KRB_NT_SRV_HST
)
{
sAddrs
=
new
HostAddresses
(
server
);
}
else
if
(
server
.
getNameType
()
==
PrincipalName
.
KRB_NT_UNKNOWN
)
{
// Sometimes this is also a server
if
(
server
.
getNameStrings
().
length
>=
2
)
{
String
host
=
server
.
getNameStrings
()[
1
];
try
{
InetAddress
[]
addr
=
InetAddress
.
getAllByName
(
host
);
if
(
addr
!=
null
&&
addr
.
length
>
0
)
{
sAddrs
=
new
HostAddresses
(
addr
);
}
}
catch
(
UnknownHostException
ioe
)
{
// maybe we guessed wrong, let sAddrs be null
}
}
}
KrbTgsReq
tgsReq
=
new
KrbTgsReq
(
options
,
tgt
,
tgService
,
KrbTgsReq
tgsReq
=
new
KrbTgsReq
(
options
,
tgt
,
tgService
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
sAddrs
,
// Only non-null for KRB_NT_SRV_HST, see JDK-8132111
null
,
// No easy way to get addresses right
null
,
null
,
null
);
null
,
null
,
null
);
credMessg
=
createMessage
(
tgsReq
.
sendAndGetCreds
(),
key
);
credMessg
=
createMessage
(
tgsReq
.
sendAndGetCreds
(),
key
);
...
@@ -113,7 +90,6 @@ public class KrbCred {
...
@@ -113,7 +90,6 @@ public class KrbCred {
EncryptionKey
sessionKey
EncryptionKey
sessionKey
=
delegatedCreds
.
getSessionKey
();
=
delegatedCreds
.
getSessionKey
();
PrincipalName
princ
=
delegatedCreds
.
getClient
();
PrincipalName
princ
=
delegatedCreds
.
getClient
();
Realm
realm
=
princ
.
getRealm
();
PrincipalName
tgService
=
delegatedCreds
.
getServer
();
PrincipalName
tgService
=
delegatedCreds
.
getServer
();
KrbCredInfo
credInfo
=
new
KrbCredInfo
(
sessionKey
,
KrbCredInfo
credInfo
=
new
KrbCredInfo
(
sessionKey
,
...
...
src/share/classes/sun/security/krb5/internal/HostAddress.java
浏览文件 @
a7fc6b8f
...
@@ -39,6 +39,7 @@ import java.net.Inet4Address;
...
@@ -39,6 +39,7 @@ import java.net.Inet4Address;
import
java.net.Inet6Address
;
import
java.net.Inet6Address
;
import
java.net.UnknownHostException
;
import
java.net.UnknownHostException
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Arrays
;
/**
/**
* Implements the ASN.1 HostAddress type.
* Implements the ASN.1 HostAddress type.
...
@@ -295,4 +296,11 @@ public class HostAddress implements Cloneable {
...
@@ -295,4 +296,11 @@ public class HostAddress implements Cloneable {
}
}
}
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
Arrays
.
toString
(
address
));
sb
.
append
(
'('
).
append
(
addrType
).
append
(
')'
);
return
sb
.
toString
();
}
}
}
src/share/classes/sun/security/krb5/internal/HostAddresses.java
浏览文件 @
a7fc6b8f
...
@@ -338,4 +338,9 @@ public class HostAddresses implements Cloneable {
...
@@ -338,4 +338,9 @@ public class HostAddresses implements Cloneable {
for
(
int
i
=
0
;
i
<
inetAddresses
.
length
;
i
++)
for
(
int
i
=
0
;
i
<
inetAddresses
.
length
;
i
++)
addresses
[
i
]
=
new
HostAddress
(
inetAddresses
[
i
]);
addresses
[
i
]
=
new
HostAddress
(
inetAddresses
[
i
]);
}
}
@Override
public
String
toString
()
{
return
Arrays
.
toString
(
addresses
);
}
}
}
test/sun/security/krb5/auto/KDC.java
浏览文件 @
a7fc6b8f
...
@@ -903,9 +903,10 @@ public class KDC {
...
@@ -903,9 +903,10 @@ public class KDC {
bFlags
[
Krb5
.
TKT_OPTS_FORWARDABLE
]
=
true
;
bFlags
[
Krb5
.
TKT_OPTS_FORWARDABLE
]
=
true
;
}
}
}
}
// We do not request for addresses for FORWARDED tickets
if
(
options
.
containsKey
(
Option
.
CHECK_ADDRESSES
)
if
(
options
.
containsKey
(
Option
.
CHECK_ADDRESSES
)
&&
body
.
kdcOptions
.
get
(
KDCOptions
.
FORWARDED
)
&&
body
.
kdcOptions
.
get
(
KDCOptions
.
FORWARDED
)
&&
body
.
addresses
=
=
null
)
{
&&
body
.
addresses
!
=
null
)
{
throw
new
KrbException
(
Krb5
.
KDC_ERR_BADOPTION
);
throw
new
KrbException
(
Krb5
.
KDC_ERR_BADOPTION
);
}
}
if
(
body
.
kdcOptions
.
get
(
KDCOptions
.
FORWARDED
)
||
if
(
body
.
kdcOptions
.
get
(
KDCOptions
.
FORWARDED
)
||
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录