Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
4a588548
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看板
提交
4a588548
编写于
10月 16, 2014
作者:
W
weijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8060474: Resolve more parsing ambiguity
Reviewed-by: mullan, ahgross
上级
7dcf3a38
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
76 addition
and
48 deletion
+76
-48
src/share/classes/sun/security/jgss/GSSHeader.java
src/share/classes/sun/security/jgss/GSSHeader.java
+3
-0
src/share/classes/sun/security/jgss/GSSNameImpl.java
src/share/classes/sun/security/jgss/GSSNameImpl.java
+4
-0
src/share/classes/sun/security/jgss/wrapper/GSSNameElement.java
...are/classes/sun/security/jgss/wrapper/GSSNameElement.java
+3
-0
src/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java
.../sun/security/krb5/internal/ccache/CCacheInputStream.java
+8
-8
src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java
...n/security/krb5/internal/ccache/FileCredentialsCache.java
+36
-36
src/share/classes/sun/security/krb5/internal/ktab/KeyTabInputStream.java
...es/sun/security/krb5/internal/ktab/KeyTabInputStream.java
+1
-1
src/share/classes/sun/security/krb5/internal/util/KrbDataInputStream.java
...s/sun/security/krb5/internal/util/KrbDataInputStream.java
+21
-3
未找到文件。
src/share/classes/sun/security/jgss/GSSHeader.java
浏览文件 @
4a588548
...
...
@@ -270,6 +270,9 @@ public class GSSHeader {
value
<<=
8
;
value
+=
0x0ff
&
in
.
read
();
}
if
(
value
<
0
)
{
throw
new
IOException
(
"Invalid length bytes"
);
}
}
return
value
;
}
...
...
src/share/classes/sun/security/jgss/GSSNameImpl.java
浏览文件 @
4a588548
...
...
@@ -257,6 +257,10 @@ public class GSSNameImpl implements GSSName {
((
0xFF
&
bytes
[
pos
++])
<<
16
)
|
((
0xFF
&
bytes
[
pos
++])
<<
8
)
|
(
0xFF
&
bytes
[
pos
++]));
if
(
mechPortionLen
<
0
||
pos
>
bytes
.
length
-
mechPortionLen
)
{
throw
new
GSSExceptionImpl
(
GSSException
.
BAD_NAME
,
"Exported name mech name is corrupted!"
);
}
byte
[]
mechPortion
=
new
byte
[
mechPortionLen
];
System
.
arraycopy
(
bytes
,
pos
,
mechPortion
,
0
,
mechPortionLen
);
...
...
src/share/classes/sun/security/jgss/wrapper/GSSNameElement.java
浏览文件 @
4a588548
...
...
@@ -233,6 +233,9 @@ public class GSSNameElement implements GSSNameSpi {
((
0xFF
&
nameVal
[
pos
++])
<<
16
)
|
((
0xFF
&
nameVal
[
pos
++])
<<
8
)
|
(
0xFF
&
nameVal
[
pos
++]));
if
(
mechPortionLen
<
0
)
{
throw
new
GSSException
(
GSSException
.
BAD_NAME
);
}
byte
[]
mechPortion
=
new
byte
[
mechPortionLen
];
System
.
arraycopy
(
nameVal
,
pos
,
mechPortion
,
0
,
mechPortionLen
);
return
mechPortion
;
...
...
src/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java
浏览文件 @
4a588548
...
...
@@ -122,7 +122,7 @@ public class CCacheInputStream extends KrbDataInputStream implements FileCCacheC
}
else
{
type
=
read
(
4
);
}
length
=
read
(
4
);
length
=
read
Length4
(
);
String
[]
result
=
new
String
[
length
+
1
];
/*
* DCE includes the principal's realm in the count; the new format
...
...
@@ -131,7 +131,7 @@ public class CCacheInputStream extends KrbDataInputStream implements FileCCacheC
if
(
version
==
KRB5_FCC_FVNO_1
)
length
--;
for
(
int
i
=
0
;
i
<=
length
;
i
++)
{
namelength
=
read
(
4
);
namelength
=
read
Length4
(
);
if
(
namelength
>
MAXNAMELENGTH
)
{
throw
new
IOException
(
"Invalid name length in principal name."
);
}
...
...
@@ -183,7 +183,7 @@ public class CCacheInputStream extends KrbDataInputStream implements FileCCacheC
keyType
=
read
(
2
);
if
(
version
==
KRB5_FCC_FVNO_3
)
read
(
2
);
/* keytype recorded twice in fvno 3 */
keyLen
=
read
(
4
);
keyLen
=
read
Length4
(
);
byte
[]
bytes
=
new
byte
[
keyLen
];
for
(
int
i
=
0
;
i
<
keyLen
;
i
++)
{
bytes
[
i
]
=
(
byte
)
read
();
...
...
@@ -209,12 +209,12 @@ public class CCacheInputStream extends KrbDataInputStream implements FileCCacheC
HostAddress
[]
readAddr
()
throws
IOException
,
KrbApErrException
{
int
numAddrs
,
addrType
,
addrLength
;
numAddrs
=
read
(
4
);
numAddrs
=
read
Length4
(
);
if
(
numAddrs
>
0
)
{
HostAddress
[]
addrs
=
new
HostAddress
[
numAddrs
];
for
(
int
i
=
0
;
i
<
numAddrs
;
i
++)
{
addrType
=
read
(
2
);
addrLength
=
read
(
4
);
addrLength
=
read
Length4
(
);
if
(!(
addrLength
==
4
||
addrLength
==
16
))
{
if
(
DEBUG
)
{
System
.
out
.
println
(
"Incorrect address format."
);
...
...
@@ -233,13 +233,13 @@ public class CCacheInputStream extends KrbDataInputStream implements FileCCacheC
AuthorizationDataEntry
[]
readAuth
()
throws
IOException
{
int
num
,
adtype
,
adlength
;
num
=
read
(
4
);
num
=
read
Length4
(
);
if
(
num
>
0
)
{
AuthorizationDataEntry
[]
auData
=
new
AuthorizationDataEntry
[
num
];
byte
[]
data
=
null
;
for
(
int
i
=
0
;
i
<
num
;
i
++)
{
adtype
=
read
(
2
);
adlength
=
read
(
4
);
adlength
=
read
Length4
(
);
data
=
new
byte
[
adlength
];
for
(
int
j
=
0
;
j
<
adlength
;
j
++)
{
data
[
j
]
=
(
byte
)
read
();
...
...
@@ -253,7 +253,7 @@ public class CCacheInputStream extends KrbDataInputStream implements FileCCacheC
byte
[]
readData
()
throws
IOException
{
int
length
;
length
=
read
(
4
);
length
=
read
Length4
(
);
if
(
length
==
0
)
{
return
null
;
}
else
{
...
...
src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java
浏览文件 @
4a588548
...
...
@@ -151,18 +151,18 @@ public class FileCredentialsCache extends CredentialsCache
synchronized
void
init
(
PrincipalName
principal
,
String
name
)
throws
IOException
,
KrbException
{
primaryPrincipal
=
principal
;
CCacheOutputStream
cos
=
new
CCacheOutputStream
(
new
FileOutputStream
(
name
));
try
(
FileOutputStream
fos
=
new
FileOutputStream
(
name
);
CCacheOutputStream
cos
=
new
CCacheOutputStream
(
fos
))
{
version
=
KRB5_FCC_FVNO_3
;
cos
.
writeHeader
(
primaryPrincipal
,
version
);
cos
.
close
();
}
load
(
name
);
}
synchronized
void
load
(
String
name
)
throws
IOException
,
KrbException
{
PrincipalName
p
;
CCacheInputStream
cis
=
new
CCacheInputStream
(
new
FileInputStream
(
name
));
try
(
FileInputStream
fis
=
new
FileInputStream
(
name
);
CCacheInputStream
cis
=
new
CCacheInputStream
(
fis
))
{
version
=
cis
.
readVersion
();
if
(
version
==
KRB5_FCC_FVNO_4
)
{
tag
=
cis
.
readTag
();
...
...
@@ -180,14 +180,14 @@ public class FileCredentialsCache extends CredentialsCache
}
}
else
primaryPrincipal
=
p
;
credentialsList
=
new
Vector
<
Credentials
>
();
credentialsList
=
new
Vector
<
Credentials
>
();
while
(
cis
.
available
()
>
0
)
{
Credentials
cred
=
cis
.
readCred
(
version
);
if
(
cred
!=
null
)
{
credentialsList
.
addElement
(
cred
);
}
}
cis
.
close
();
}
}
...
...
@@ -246,8 +246,8 @@ public class FileCredentialsCache extends CredentialsCache
* Saves the credentials cache file to the disk.
*/
public
synchronized
void
save
()
throws
IOException
,
Asn1Exception
{
CCacheOutputStream
cos
=
new
CCacheOutputStream
(
new
FileOutputStream
(
cacheName
));
try
(
FileOutputStream
fos
=
new
FileOutputStream
(
cacheName
);
CCacheOutputStream
cos
=
new
CCacheOutputStream
(
fos
))
{
cos
.
writeHeader
(
primaryPrincipal
,
version
);
Credentials
[]
tmp
=
null
;
if
((
tmp
=
getCredsList
())
!=
null
)
{
...
...
@@ -255,7 +255,7 @@ public class FileCredentialsCache extends CredentialsCache
cos
.
addCreds
(
tmp
[
i
]);
}
}
cos
.
close
();
}
}
boolean
match
(
String
[]
s1
,
String
[]
s2
)
{
...
...
src/share/classes/sun/security/krb5/internal/ktab/KeyTabInputStream.java
浏览文件 @
4a588548
...
...
@@ -58,7 +58,7 @@ public class KeyTabInputStream extends KrbDataInputStream implements KeyTabConst
* Reads the number of bytes this entry data occupy.
*/
int
readEntryLength
()
throws
IOException
{
return
read
(
4
);
return
read
Length4
(
);
}
...
...
src/share/classes/sun/security/krb5/internal/util/KrbDataInputStream.java
浏览文件 @
4a588548
...
...
@@ -56,15 +56,33 @@ public class KrbDataInputStream extends BufferedInputStream{
public
KrbDataInputStream
(
InputStream
is
){
super
(
is
);
}
/**
* Reads a length value which is represented in 4 bytes from
* this input stream. The value must be positive.
* @return the length value represented by this byte array.
* @throws IOException if there are not enough bytes or it represents
* a negative value
*/
final
public
int
readLength4
()
throws
IOException
{
int
len
=
read
(
4
);
if
(
len
<
0
)
{
throw
new
IOException
(
"Invalid encoding"
);
}
return
len
;
}
/**
* Reads up to the specific number of bytes from this input stream.
* @param num the number of bytes to be read.
* @return the int value of this byte array.
* @
exception IOException.
* @
throws IOException if there are not enough bytes
*/
public
int
read
(
int
num
)
throws
IOException
{
public
int
read
(
int
num
)
throws
IOException
{
byte
[]
bytes
=
new
byte
[
num
];
read
(
bytes
,
0
,
num
);
if
(
read
(
bytes
,
0
,
num
)
!=
num
)
{
throw
new
IOException
(
"Premature end of stream reached"
);
};
int
result
=
0
;
for
(
int
i
=
0
;
i
<
num
;
i
++)
{
if
(
bigEndian
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录