Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
3cad1e6f
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看板
提交
3cad1e6f
编写于
5月 24, 2017
作者:
I
igerasim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8172525: Improve key keying case
Reviewed-by: mullan
上级
41156ddc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
21 deletion
+29
-21
src/share/classes/com/sun/crypto/provider/DESKey.java
src/share/classes/com/sun/crypto/provider/DESKey.java
+6
-4
src/share/classes/com/sun/crypto/provider/DESedeKey.java
src/share/classes/com/sun/crypto/provider/DESedeKey.java
+6
-4
src/share/classes/com/sun/crypto/provider/PBEKey.java
src/share/classes/com/sun/crypto/provider/PBEKey.java
+6
-4
src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
+11
-9
未找到文件。
src/share/classes/com/sun/crypto/provider/DESKey.java
浏览文件 @
3cad1e6f
...
...
@@ -76,7 +76,7 @@ final class DESKey implements SecretKey {
DESKeyGenerator
.
setParityBit
(
this
.
key
,
0
);
}
public
byte
[]
getEncoded
()
{
public
synchronized
byte
[]
getEncoded
()
{
// Return a copy of the key, rather than a reference,
// so that the key data cannot be modified from outside
return
this
.
key
.
clone
();
...
...
@@ -151,9 +151,11 @@ final class DESKey implements SecretKey {
*/
protected
void
finalize
()
throws
Throwable
{
try
{
if
(
this
.
key
!=
null
)
{
java
.
util
.
Arrays
.
fill
(
this
.
key
,
(
byte
)
0x00
);
this
.
key
=
null
;
synchronized
(
this
)
{
if
(
this
.
key
!=
null
)
{
java
.
util
.
Arrays
.
fill
(
this
.
key
,
(
byte
)
0x00
);
this
.
key
=
null
;
}
}
}
finally
{
super
.
finalize
();
...
...
src/share/classes/com/sun/crypto/provider/DESedeKey.java
浏览文件 @
3cad1e6f
...
...
@@ -78,7 +78,7 @@ final class DESedeKey implements SecretKey {
DESKeyGenerator
.
setParityBit
(
this
.
key
,
16
);
}
public
byte
[]
getEncoded
()
{
public
synchronized
byte
[]
getEncoded
()
{
return
this
.
key
.
clone
();
}
...
...
@@ -152,9 +152,11 @@ final class DESedeKey implements SecretKey {
*/
protected
void
finalize
()
throws
Throwable
{
try
{
if
(
this
.
key
!=
null
)
{
java
.
util
.
Arrays
.
fill
(
this
.
key
,
(
byte
)
0x00
);
this
.
key
=
null
;
synchronized
(
this
)
{
if
(
this
.
key
!=
null
)
{
java
.
util
.
Arrays
.
fill
(
this
.
key
,
(
byte
)
0x00
);
this
.
key
=
null
;
}
}
}
finally
{
super
.
finalize
();
...
...
src/share/classes/com/sun/crypto/provider/PBEKey.java
浏览文件 @
3cad1e6f
...
...
@@ -72,7 +72,7 @@ final class PBEKey implements SecretKey {
type
=
keytype
;
}
public
byte
[]
getEncoded
()
{
public
synchronized
byte
[]
getEncoded
()
{
return
this
.
key
.
clone
();
}
...
...
@@ -147,9 +147,11 @@ final class PBEKey implements SecretKey {
*/
protected
void
finalize
()
throws
Throwable
{
try
{
if
(
this
.
key
!=
null
)
{
java
.
util
.
Arrays
.
fill
(
this
.
key
,
(
byte
)
0x00
);
this
.
key
=
null
;
synchronized
(
this
)
{
if
(
this
.
key
!=
null
)
{
java
.
util
.
Arrays
.
fill
(
this
.
key
,
(
byte
)
0x00
);
this
.
key
=
null
;
}
}
}
finally
{
super
.
finalize
();
...
...
src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
浏览文件 @
3cad1e6f
...
...
@@ -190,7 +190,7 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey {
return
key
;
}
public
byte
[]
getEncoded
()
{
public
synchronized
byte
[]
getEncoded
()
{
return
key
.
clone
();
}
...
...
@@ -202,7 +202,7 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey {
return
iterCount
;
}
public
char
[]
getPassword
()
{
public
synchronized
char
[]
getPassword
()
{
return
passwd
.
clone
();
}
...
...
@@ -264,13 +264,15 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey {
*/
protected
void
finalize
()
throws
Throwable
{
try
{
if
(
this
.
passwd
!=
null
)
{
java
.
util
.
Arrays
.
fill
(
this
.
passwd
,
'0'
);
this
.
passwd
=
null
;
}
if
(
this
.
key
!=
null
)
{
java
.
util
.
Arrays
.
fill
(
this
.
key
,
(
byte
)
0x00
);
this
.
key
=
null
;
synchronized
(
this
)
{
if
(
this
.
passwd
!=
null
)
{
java
.
util
.
Arrays
.
fill
(
this
.
passwd
,
'0'
);
this
.
passwd
=
null
;
}
if
(
this
.
key
!=
null
)
{
java
.
util
.
Arrays
.
fill
(
this
.
key
,
(
byte
)
0x00
);
this
.
key
=
null
;
}
}
}
finally
{
super
.
finalize
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录