Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
4eed2940
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4eed2940
编写于
1月 24, 2013
作者:
V
vinnie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8006855: PKCS12 test failures due to unsupported algorithm
Reviewed-by: mullan
上级
9eb93842
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
24 addition
and
4 deletion
+24
-4
src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
+3
-3
test/java/security/KeyStore/PBETest.java
test/java/security/KeyStore/PBETest.java
+2
-1
test/sun/security/pkcs12/StoreSecretKeyTest.java
test/sun/security/pkcs12/StoreSecretKeyTest.java
+19
-0
未找到文件。
src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
浏览文件 @
4eed2940
...
@@ -887,13 +887,13 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
...
@@ -887,13 +887,13 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
/*
/*
* Map a PBE algorithm name onto its object identifier
* Map a PBE algorithm name onto its object identifier
*/
*/
private
ObjectIdentifier
mapPBEAlgorithmToOID
(
String
algorithm
)
{
private
ObjectIdentifier
mapPBEAlgorithmToOID
(
String
algorithm
)
throws
NoSuchAlgorithmException
{
// Check for PBES2 algorithms
// Check for PBES2 algorithms
if
(
algorithm
.
toLowerCase
().
startsWith
(
"pbewithhmacsha"
))
{
if
(
algorithm
.
toLowerCase
().
startsWith
(
"pbewithhmacsha"
))
{
return
pbes2_OID
;
return
pbes2_OID
;
}
}
return
AlgorithmId
.
get
(
algorithm
).
getOID
();
return
null
;
}
}
/**
/**
...
...
test/java/security/KeyStore/PBETest.java
浏览文件 @
4eed2940
...
@@ -36,7 +36,8 @@ import javax.crypto.spec.*;
...
@@ -36,7 +36,8 @@ import javax.crypto.spec.*;
public
class
PBETest
{
public
class
PBETest
{
private
final
static
String
DIR
=
System
.
getProperty
(
"test.src"
,
"."
);
private
final
static
String
DIR
=
System
.
getProperty
(
"test.src"
,
"."
);
private
static
final
String
PBE_ALGO
=
"PBEWithHmacSHA1AndAES_128"
;
//private static final String PBE_ALGO = "PBEWithHmacSHA1AndAES_128";
private
static
final
String
PBE_ALGO
=
"PBEWithSHA1AndDESede"
;
private
static
final
char
[]
PASSWORD
=
"passphrase"
.
toCharArray
();
private
static
final
char
[]
PASSWORD
=
"passphrase"
.
toCharArray
();
private
static
final
String
KEYSTORE_TYPE
=
"JKS"
;
private
static
final
String
KEYSTORE_TYPE
=
"JKS"
;
private
static
final
String
KEYSTORE
=
DIR
+
"/keystore.jks"
;
private
static
final
String
KEYSTORE
=
DIR
+
"/keystore.jks"
;
...
...
test/sun/security/pkcs12/StoreSecretKeyTest.java
浏览文件 @
4eed2940
...
@@ -43,6 +43,14 @@ public class StoreSecretKeyTest {
...
@@ -43,6 +43,14 @@ public class StoreSecretKeyTest {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
// Skip test if AES is unavailable
try
{
SecretKeyFactory
.
getInstance
(
"AES"
);
}
catch
(
NoSuchAlgorithmException
nsae
)
{
System
.
out
.
println
(
"AES is unavailable. Skipping test..."
);
return
;
}
new
File
(
KEYSTORE
).
delete
();
new
File
(
KEYSTORE
).
delete
();
try
{
try
{
...
@@ -79,6 +87,17 @@ public class StoreSecretKeyTest {
...
@@ -79,6 +87,17 @@ public class StoreSecretKeyTest {
private
static
SecretKey
generateSecretKey
(
String
algorithm
,
int
size
)
private
static
SecretKey
generateSecretKey
(
String
algorithm
,
int
size
)
throws
NoSuchAlgorithmException
{
throws
NoSuchAlgorithmException
{
// Failover to DES if the requested secret key factory is unavailable
SecretKeyFactory
keyFactory
;
try
{
keyFactory
=
SecretKeyFactory
.
getInstance
(
algorithm
);
}
catch
(
NoSuchAlgorithmException
nsae
)
{
keyFactory
=
SecretKeyFactory
.
getInstance
(
"DES"
);
algorithm
=
"DES"
;
size
=
56
;
}
KeyGenerator
generator
=
KeyGenerator
.
getInstance
(
algorithm
);
KeyGenerator
generator
=
KeyGenerator
.
getInstance
(
algorithm
);
generator
.
init
(
size
);
generator
.
init
(
size
);
return
generator
.
generateKey
();
return
generator
.
generateKey
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录