Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
0c9da838
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
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,发现更多精彩内容 >>
提交
0c9da838
编写于
3月 19, 2015
作者:
I
igerasim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7065233: To interpret case-insensitive string locale independently
Reviewed-by: xuelei
上级
c0818f6e
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
53 addition
and
48 deletion
+53
-48
src/share/classes/com/sun/crypto/provider/JceKeyStore.java
src/share/classes/com/sun/crypto/provider/JceKeyStore.java
+14
-14
src/share/classes/com/sun/crypto/provider/PBEKey.java
src/share/classes/com/sun/crypto/provider/PBEKey.java
+3
-2
src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java
src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java
+21
-20
src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
+4
-3
src/share/classes/javax/crypto/spec/SecretKeySpec.java
src/share/classes/javax/crypto/spec/SecretKeySpec.java
+4
-2
src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
+2
-2
src/share/classes/sun/security/provider/ConfigFile.java
src/share/classes/sun/security/provider/ConfigFile.java
+2
-2
src/share/classes/sun/security/provider/PolicyParser.java
src/share/classes/sun/security/provider/PolicyParser.java
+2
-2
src/share/classes/sun/security/tools/keytool/Main.java
src/share/classes/sun/security/tools/keytool/Main.java
+1
-1
未找到文件。
src/share/classes/com/sun/crypto/provider/JceKeyStore.java
浏览文件 @
0c9da838
/*
* Copyright (c) 1998, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
4
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -107,7 +107,7 @@ public final class JceKeyStore extends KeyStoreSpi {
{
Key
key
=
null
;
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
());
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
(
Locale
.
ENGLISH
));
if
(!((
entry
instanceof
PrivateKeyEntry
)
||
(
entry
instanceof
SecretKeyEntry
)))
{
...
...
@@ -150,7 +150,7 @@ public final class JceKeyStore extends KeyStoreSpi {
{
Certificate
[]
chain
=
null
;
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
());
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
(
Locale
.
ENGLISH
));
if
((
entry
instanceof
PrivateKeyEntry
)
&&
(((
PrivateKeyEntry
)
entry
).
chain
!=
null
))
{
...
...
@@ -178,7 +178,7 @@ public final class JceKeyStore extends KeyStoreSpi {
public
Certificate
engineGetCertificate
(
String
alias
)
{
Certificate
cert
=
null
;
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
());
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
(
Locale
.
ENGLISH
));
if
(
entry
!=
null
)
{
if
(
entry
instanceof
TrustedCertEntry
)
{
...
...
@@ -203,7 +203,7 @@ public final class JceKeyStore extends KeyStoreSpi {
public
Date
engineGetCreationDate
(
String
alias
)
{
Date
date
=
null
;
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
());
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
(
Locale
.
ENGLISH
));
if
(
entry
!=
null
)
{
// We have to create a new instance of java.util.Date because
...
...
@@ -266,7 +266,7 @@ public final class JceKeyStore extends KeyStoreSpi {
}
// store the entry
entries
.
put
(
alias
.
toLowerCase
(),
entry
);
entries
.
put
(
alias
.
toLowerCase
(
Locale
.
ENGLISH
),
entry
);
}
else
{
SecretKeyEntry
entry
=
new
SecretKeyEntry
();
...
...
@@ -274,7 +274,7 @@ public final class JceKeyStore extends KeyStoreSpi {
// seal and store the key
entry
.
sealedKey
=
keyProtector
.
seal
(
key
);
entries
.
put
(
alias
.
toLowerCase
(),
entry
);
entries
.
put
(
alias
.
toLowerCase
(
Locale
.
ENGLISH
),
entry
);
}
}
catch
(
Exception
e
)
{
...
...
@@ -322,7 +322,7 @@ public final class JceKeyStore extends KeyStoreSpi {
entry
.
chain
=
null
;
}
entries
.
put
(
alias
.
toLowerCase
(),
entry
);
entries
.
put
(
alias
.
toLowerCase
(
Locale
.
ENGLISH
),
entry
);
}
}
...
...
@@ -345,7 +345,7 @@ public final class JceKeyStore extends KeyStoreSpi {
{
synchronized
(
entries
)
{
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
());
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
(
Locale
.
ENGLISH
));
if
(
entry
!=
null
)
{
if
(
entry
instanceof
PrivateKeyEntry
)
{
throw
new
KeyStoreException
(
"Cannot overwrite own "
...
...
@@ -358,7 +358,7 @@ public final class JceKeyStore extends KeyStoreSpi {
TrustedCertEntry
trustedCertEntry
=
new
TrustedCertEntry
();
trustedCertEntry
.
cert
=
cert
;
trustedCertEntry
.
date
=
new
Date
();
entries
.
put
(
alias
.
toLowerCase
(),
trustedCertEntry
);
entries
.
put
(
alias
.
toLowerCase
(
Locale
.
ENGLISH
),
trustedCertEntry
);
}
}
...
...
@@ -373,7 +373,7 @@ public final class JceKeyStore extends KeyStoreSpi {
throws
KeyStoreException
{
synchronized
(
entries
)
{
entries
.
remove
(
alias
.
toLowerCase
());
entries
.
remove
(
alias
.
toLowerCase
(
Locale
.
ENGLISH
));
}
}
...
...
@@ -394,7 +394,7 @@ public final class JceKeyStore extends KeyStoreSpi {
* @return true if the alias exists, false otherwise
*/
public
boolean
engineContainsAlias
(
String
alias
)
{
return
entries
.
containsKey
(
alias
.
toLowerCase
());
return
entries
.
containsKey
(
alias
.
toLowerCase
(
Locale
.
ENGLISH
));
}
/**
...
...
@@ -416,7 +416,7 @@ public final class JceKeyStore extends KeyStoreSpi {
public
boolean
engineIsKeyEntry
(
String
alias
)
{
boolean
isKey
=
false
;
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
());
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
(
Locale
.
ENGLISH
));
if
((
entry
instanceof
PrivateKeyEntry
)
||
(
entry
instanceof
SecretKeyEntry
))
{
isKey
=
true
;
...
...
@@ -434,7 +434,7 @@ public final class JceKeyStore extends KeyStoreSpi {
*/
public
boolean
engineIsCertificateEntry
(
String
alias
)
{
boolean
isCert
=
false
;
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
());
Object
entry
=
entries
.
get
(
alias
.
toLowerCase
(
Locale
.
ENGLISH
));
if
(
entry
instanceof
TrustedCertEntry
)
{
isCert
=
true
;
}
...
...
src/share/classes/com/sun/crypto/provider/PBEKey.java
浏览文件 @
0c9da838
/*
* Copyright (c) 1997, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
4
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -27,6 +27,7 @@ package com.sun.crypto.provider;
import
java.security.KeyRep
;
import
java.security.spec.InvalidKeySpecException
;
import
java.util.Locale
;
import
javax.crypto.SecretKey
;
import
javax.crypto.spec.PBEKeySpec
;
...
...
@@ -91,7 +92,7 @@ final class PBEKey implements SecretKey {
for
(
int
i
=
1
;
i
<
this
.
key
.
length
;
i
++)
{
retval
+=
this
.
key
[
i
]
*
i
;
}
return
(
retval
^=
getAlgorithm
().
toLowerCase
().
hashCode
());
return
(
retval
^=
getAlgorithm
().
toLowerCase
(
Locale
.
ENGLISH
).
hashCode
());
}
public
boolean
equals
(
Object
obj
)
{
...
...
src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java
浏览文件 @
0c9da838
/*
* Copyright (c) 1997, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
4
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -32,6 +32,7 @@ import javax.crypto.SecretKey;
import
javax.crypto.SecretKeyFactorySpi
;
import
javax.crypto.spec.PBEKeySpec
;
import
java.util.HashSet
;
import
java.util.Locale
;
/**
* This class implements a key factory for PBE keys according to PKCS#5,
...
...
@@ -56,24 +57,24 @@ abstract class PBEKeyFactory extends SecretKeyFactorySpi {
static
{
validTypes
=
new
HashSet
<
String
>(
17
);
validTypes
.
add
(
"PBEWithMD5AndDES"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithSHA1AndDESede"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithSHA1AndRC2_40"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithSHA1AndRC2_128"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithSHA1AndRC4_40"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithSHA1AndRC4_128"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithMD5AndDES"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithSHA1AndDESede"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithSHA1AndRC2_40"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithSHA1AndRC2_128"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithSHA1AndRC4_40"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithSHA1AndRC4_128"
.
toUpperCase
(
Locale
.
ENGLISH
));
// Proprietary algorithm.
validTypes
.
add
(
"PBEWithMD5AndTripleDES"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithHmacSHA1AndAES_128"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithHmacSHA224AndAES_128"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithHmacSHA256AndAES_128"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithHmacSHA384AndAES_128"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithHmacSHA512AndAES_128"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithHmacSHA1AndAES_256"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithHmacSHA224AndAES_256"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithHmacSHA256AndAES_256"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithHmacSHA384AndAES_256"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithHmacSHA512AndAES_256"
.
toUpperCase
());
validTypes
.
add
(
"PBEWithMD5AndTripleDES"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithHmacSHA1AndAES_128"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithHmacSHA224AndAES_128"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithHmacSHA256AndAES_128"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithHmacSHA384AndAES_128"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithHmacSHA512AndAES_128"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithHmacSHA1AndAES_256"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithHmacSHA224AndAES_256"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithHmacSHA256AndAES_256"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithHmacSHA384AndAES_256"
.
toUpperCase
(
Locale
.
ENGLISH
));
validTypes
.
add
(
"PBEWithHmacSHA512AndAES_256"
.
toUpperCase
(
Locale
.
ENGLISH
));
}
public
static
final
class
PBEWithMD5AndDES
...
...
@@ -237,7 +238,7 @@ abstract class PBEKeyFactory extends SecretKeyFactorySpi {
protected
KeySpec
engineGetKeySpec
(
SecretKey
key
,
Class
<?>
keySpecCl
)
throws
InvalidKeySpecException
{
if
((
key
instanceof
SecretKey
)
&&
(
validTypes
.
contains
(
key
.
getAlgorithm
().
toUpperCase
()))
&&
(
validTypes
.
contains
(
key
.
getAlgorithm
().
toUpperCase
(
Locale
.
ENGLISH
)))
&&
(
key
.
getFormat
().
equalsIgnoreCase
(
"RAW"
)))
{
// Check if requested key spec is amongst the valid ones
...
...
@@ -279,7 +280,7 @@ abstract class PBEKeyFactory extends SecretKeyFactorySpi {
{
try
{
if
((
key
!=
null
)
&&
(
validTypes
.
contains
(
key
.
getAlgorithm
().
toUpperCase
()))
&&
(
validTypes
.
contains
(
key
.
getAlgorithm
().
toUpperCase
(
Locale
.
ENGLISH
)))
&&
(
key
.
getFormat
().
equalsIgnoreCase
(
"RAW"
)))
{
// Check if key originates from this factory
...
...
src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
浏览文件 @
0c9da838
/*
* Copyright (c) 2005, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
4
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -30,6 +30,7 @@ import java.nio.ByteBuffer;
import
java.nio.CharBuffer
;
import
java.nio.charset.Charset
;
import
java.util.Arrays
;
import
java.util.Locale
;
import
java.security.KeyRep
;
import
java.security.GeneralSecurityException
;
import
java.security.NoSuchAlgorithmException
;
...
...
@@ -143,7 +144,7 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey {
@Override
public
int
hashCode
()
{
return
Arrays
.
hashCode
(
password
)
*
41
+
prf
.
getAlgorithm
().
toLowerCase
(
).
hashCode
();
prf
.
getAlgorithm
().
toLowerCase
(
Locale
.
ENGLISH
).
hashCode
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
...
...
@@ -221,7 +222,7 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey {
for
(
int
i
=
1
;
i
<
this
.
key
.
length
;
i
++)
{
retval
+=
this
.
key
[
i
]
*
i
;
}
return
(
retval
^=
getAlgorithm
().
toLowerCase
().
hashCode
());
return
(
retval
^=
getAlgorithm
().
toLowerCase
(
Locale
.
ENGLISH
).
hashCode
());
}
public
boolean
equals
(
Object
obj
)
{
...
...
src/share/classes/javax/crypto/spec/SecretKeySpec.java
浏览文件 @
0c9da838
/*
* Copyright (c) 1998, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
4
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -26,6 +26,7 @@
package
javax.crypto.spec
;
import
java.security.spec.KeySpec
;
import
java.util.Locale
;
import
javax.crypto.SecretKey
;
/**
...
...
@@ -194,7 +195,8 @@ public class SecretKeySpec implements KeySpec, SecretKey {
if
(
this
.
algorithm
.
equalsIgnoreCase
(
"TripleDES"
))
return
(
retval
^=
"desede"
.
hashCode
());
else
return
(
retval
^=
this
.
algorithm
.
toLowerCase
().
hashCode
());
return
(
retval
^=
this
.
algorithm
.
toLowerCase
(
Locale
.
ENGLISH
).
hashCode
());
}
/**
...
...
src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
浏览文件 @
0c9da838
/*
* Copyright (c) 1999, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 201
4
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -900,7 +900,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
private
static
ObjectIdentifier
mapPBEAlgorithmToOID
(
String
algorithm
)
throws
NoSuchAlgorithmException
{
// Check for PBES2 algorithms
if
(
algorithm
.
toLowerCase
().
startsWith
(
"pbewithhmacsha"
))
{
if
(
algorithm
.
toLowerCase
(
Locale
.
ENGLISH
).
startsWith
(
"pbewithhmacsha"
))
{
return
pbes2_OID
;
}
return
AlgorithmId
.
get
(
algorithm
).
getOID
();
...
...
src/share/classes/sun/security/provider/ConfigFile.java
浏览文件 @
0c9da838
/*
* Copyright (c) 2000, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 201
4
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -451,7 +451,7 @@ public final class ConfigFile extends Configuration {
// controlFlag (required, optional, etc)
LoginModuleControlFlag
controlFlag
;
String
sflag
=
match
(
"controlFlag"
).
toUpperCase
();
String
sflag
=
match
(
"controlFlag"
).
toUpperCase
(
Locale
.
ENGLISH
);
switch
(
sflag
)
{
case
"REQUIRED"
:
controlFlag
=
LoginModuleControlFlag
.
REQUIRED
;
...
...
src/share/classes/sun/security/provider/PolicyParser.java
浏览文件 @
0c9da838
/*
* Copyright (c) 1997, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
4
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -707,7 +707,7 @@ public class PolicyParser {
}
catch
(
PropertyExpander
.
ExpandException
peee
)
{
throw
new
IOException
(
peee
.
getLocalizedMessage
());
}
properties
.
put
(
key
.
toLowerCase
(),
value
);
properties
.
put
(
key
.
toLowerCase
(
Locale
.
ENGLISH
),
value
);
}
return
properties
;
...
...
src/share/classes/sun/security/tools/keytool/Main.java
浏览文件 @
0c9da838
...
...
@@ -1494,7 +1494,7 @@ public final class Main {
boolean
useDefaultPBEAlgorithm
=
true
;
SecretKey
secKey
=
null
;
if
(
keyAlgName
.
toUpperCase
().
startsWith
(
"PBE"
))
{
if
(
keyAlgName
.
toUpperCase
(
Locale
.
ENGLISH
).
startsWith
(
"PBE"
))
{
SecretKeyFactory
factory
=
SecretKeyFactory
.
getInstance
(
"PBE"
);
// User is prompted for PBE credential
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录