Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
c690149d
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看板
提交
c690149d
编写于
9月 08, 2015
作者:
I
igerasim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8074068: Cleanup in java.base/share/classes/sun/security/x509/
Reviewed-by: mullan, ahgross, coffeys
上级
ed0fea2e
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
60 addition
and
74 deletion
+60
-74
src/share/classes/sun/security/x509/AlgorithmId.java
src/share/classes/sun/security/x509/AlgorithmId.java
+1
-1
src/share/classes/sun/security/x509/CRLDistributionPointsExtension.java
...ses/sun/security/x509/CRLDistributionPointsExtension.java
+5
-3
src/share/classes/sun/security/x509/CRLNumberExtension.java
src/share/classes/sun/security/x509/CRLNumberExtension.java
+3
-4
src/share/classes/sun/security/x509/DNSName.java
src/share/classes/sun/security/x509/DNSName.java
+6
-6
src/share/classes/sun/security/x509/EDIPartyName.java
src/share/classes/sun/security/x509/EDIPartyName.java
+1
-1
src/share/classes/sun/security/x509/GeneralSubtrees.java
src/share/classes/sun/security/x509/GeneralSubtrees.java
+1
-1
src/share/classes/sun/security/x509/IPAddressName.java
src/share/classes/sun/security/x509/IPAddressName.java
+11
-9
src/share/classes/sun/security/x509/IssuingDistributionPointExtension.java
.../sun/security/x509/IssuingDistributionPointExtension.java
+1
-1
src/share/classes/sun/security/x509/KeyIdentifier.java
src/share/classes/sun/security/x509/KeyIdentifier.java
+2
-2
src/share/classes/sun/security/x509/PolicyMappingsExtension.java
...re/classes/sun/security/x509/PolicyMappingsExtension.java
+1
-1
src/share/classes/sun/security/x509/PrivateKeyUsageExtension.java
...e/classes/sun/security/x509/PrivateKeyUsageExtension.java
+4
-2
src/share/classes/sun/security/x509/RDN.java
src/share/classes/sun/security/x509/RDN.java
+12
-22
src/share/classes/sun/security/x509/SubjectInfoAccessExtension.java
...classes/sun/security/x509/SubjectInfoAccessExtension.java
+3
-1
src/share/classes/sun/security/x509/URIName.java
src/share/classes/sun/security/x509/URIName.java
+1
-1
src/share/classes/sun/security/x509/X500Name.java
src/share/classes/sun/security/x509/X500Name.java
+4
-9
src/share/classes/sun/security/x509/X509AttributeName.java
src/share/classes/sun/security/x509/X509AttributeName.java
+1
-1
src/share/classes/sun/security/x509/X509CRLImpl.java
src/share/classes/sun/security/x509/X509CRLImpl.java
+2
-6
src/share/classes/sun/security/x509/X509CertImpl.java
src/share/classes/sun/security/x509/X509CertImpl.java
+1
-3
未找到文件。
src/share/classes/sun/security/x509/AlgorithmId.java
浏览文件 @
c690149d
...
...
@@ -588,7 +588,7 @@ public class AlgorithmId implements Serializable, DerEncoder {
}
if
(
oidTable
==
null
)
{
oidTable
=
new
HashMap
<
String
,
ObjectIdentifier
>(
1
);
oidTable
=
Collections
.<
String
,
ObjectIdentifier
>
emptyMap
(
);
}
initOidTable
=
true
;
}
...
...
src/share/classes/sun/security/x509/CRLDistributionPointsExtension.java
浏览文件 @
c690149d
...
...
@@ -29,6 +29,7 @@ import java.io.IOException;
import
java.io.OutputStream
;
import
java.util.*
;
import
java.util.Collections
;
import
sun.security.util.DerOutputStream
;
import
sun.security.util.DerValue
;
...
...
@@ -255,11 +256,12 @@ public class CRLDistributionPointsExtension extends Extension
*/
public
void
delete
(
String
name
)
throws
IOException
{
if
(
name
.
equalsIgnoreCase
(
POINTS
))
{
distributionPoints
=
new
ArrayList
<
DistributionPoint
>();
distributionPoints
=
Collections
.<
DistributionPoint
>
emptyList
();
}
else
{
throw
new
IOException
(
"Attribute name ["
+
name
+
"] not recognized by "
+
"CertAttrSet:"
+
extensionName
+
"."
);
"] not recognized by "
+
"CertAttrSet:"
+
extensionName
+
'.'
);
}
encodeThis
();
}
...
...
src/share/classes/sun/security/x509/CRLNumberExtension.java
浏览文件 @
c690149d
...
...
@@ -157,11 +157,10 @@ implements CertAttrSet<String> {
*/
public
BigInteger
get
(
String
name
)
throws
IOException
{
if
(
name
.
equalsIgnoreCase
(
NUMBER
))
{
if
(
crlNumber
==
null
)
return
null
;
else
return
crlNumber
;
return
crlNumber
;
}
else
{
throw
new
IOException
(
"Attribute name not recognized by"
+
" CertAttrSet:"
+
extensionName
+
"."
);
throw
new
IOException
(
"Attribute name not recognized by"
+
" CertAttrSet:"
+
extensionName
+
'.'
);
}
}
...
...
src/share/classes/sun/security/x509/DNSName.java
浏览文件 @
c690149d
...
...
@@ -232,15 +232,15 @@ public class DNSName implements GeneralNameInterface {
* @throws UnsupportedOperationException if not supported for this name type
*/
public
int
subtreeDepth
()
throws
UnsupportedOperationException
{
String
subtree
=
name
;
int
i
=
1
;
// subtree depth is always at least 1
int
sum
=
1
;
/
* count dots */
for
(
;
subtree
.
lastIndexOf
(
'.'
)
>=
0
;
i
++
)
{
subtree
=
subtree
.
substring
(
0
,
subtree
.
lastIndexOf
(
'.'
))
;
/
/ count dots
for
(
int
i
=
name
.
indexOf
(
'.'
);
i
>=
0
;
i
=
name
.
indexOf
(
'.'
,
i
+
1
)
)
{
++
sum
;
}
return
i
;
return
sum
;
}
}
src/share/classes/sun/security/x509/EDIPartyName.java
浏览文件 @
c690149d
...
...
@@ -197,7 +197,7 @@ public class EDIPartyName implements GeneralNameInterface {
*/
public
int
hashCode
()
{
if
(
myhash
==
-
1
)
{
myhash
=
37
+
party
.
hashCode
(
);
myhash
=
37
+
(
party
==
null
?
1
:
party
.
hashCode
()
);
if
(
assigner
!=
null
)
{
myhash
=
37
*
myhash
+
assigner
.
hashCode
();
}
...
...
src/share/classes/sun/security/x509/GeneralSubtrees.java
浏览文件 @
c690149d
...
...
@@ -191,7 +191,7 @@ public class GeneralSubtrees implements Cloneable {
// the list: if any subsequent entry matches or widens entry n,
// remove entry n. If any subsequent entries narrow entry n, remove
// the subsequent entries.
for
(
int
i
=
0
;
i
<
size
(
);
i
++)
{
for
(
int
i
=
0
;
i
<
(
size
()
-
1
);
i
++)
{
GeneralNameInterface
current
=
getGeneralNameInterface
(
i
);
boolean
remove1
=
false
;
...
...
src/share/classes/sun/security/x509/IPAddressName.java
浏览文件 @
c690149d
...
...
@@ -197,8 +197,10 @@ public class IPAddressName implements GeneralNameInterface {
// append a mask corresponding to the num of prefix bits specified
int
prefixLen
=
Integer
.
parseInt
(
name
.
substring
(
slashNdx
+
1
));
if
(
prefixLen
>
128
)
throw
new
IOException
(
"IPv6Address prefix is longer than 128"
);
if
(
prefixLen
<
0
||
prefixLen
>
128
)
{
throw
new
IOException
(
"IPv6Address prefix length ("
+
prefixLen
+
") in out of valid range [0,128]"
);
}
// create new bit array initialized to zeros
BitArray
bitArray
=
new
BitArray
(
MASKSIZE
*
8
);
...
...
@@ -317,7 +319,8 @@ public class IPAddressName implements GeneralNameInterface {
if
(!(
obj
instanceof
IPAddressName
))
return
false
;
byte
[]
other
=
((
IPAddressName
)
obj
).
getBytes
();
IPAddressName
otherName
=
(
IPAddressName
)
obj
;
byte
[]
other
=
otherName
.
address
;
if
(
other
.
length
!=
address
.
length
)
return
false
;
...
...
@@ -326,12 +329,10 @@ public class IPAddressName implements GeneralNameInterface {
// Two subnet addresses
// Mask each and compare masked values
int
maskLen
=
address
.
length
/
2
;
byte
[]
maskedThis
=
new
byte
[
maskLen
];
byte
[]
maskedOther
=
new
byte
[
maskLen
];
for
(
int
i
=
0
;
i
<
maskLen
;
i
++)
{
maskedThis
[
i
]
=
(
byte
)(
address
[
i
]
&
address
[
i
+
maskLen
]);
maskedOther
[
i
]
=
(
byte
)(
other
[
i
]
&
other
[
i
+
maskLen
]);
if
(
maskedThis
[
i
]
!=
maskedOther
[
i
]
)
{
byte
maskedThis
=
(
byte
)(
address
[
i
]
&
address
[
i
+
maskLen
]);
byte
maskedOther
=
(
byte
)(
other
[
i
]
&
other
[
i
+
maskLen
]);
if
(
maskedThis
!=
maskedOther
)
{
return
false
;
}
}
...
...
@@ -400,7 +401,8 @@ public class IPAddressName implements GeneralNameInterface {
else
if
(((
IPAddressName
)
inputName
).
equals
(
this
))
constraintType
=
NAME_MATCH
;
else
{
byte
[]
otherAddress
=
((
IPAddressName
)
inputName
).
getBytes
();
IPAddressName
otherName
=
(
IPAddressName
)
inputName
;
byte
[]
otherAddress
=
otherName
.
address
;
if
(
otherAddress
.
length
==
4
&&
address
.
length
==
4
)
// Two host addresses
constraintType
=
NAME_SAME_TYPE
;
...
...
src/share/classes/sun/security/x509/IssuingDistributionPointExtension.java
浏览文件 @
c690149d
...
...
@@ -261,6 +261,7 @@ public class IssuingDistributionPointExtension extends Extension
throw
new
IOException
(
"Attribute value should be of type ReasonFlags."
);
}
revocationReasons
=
(
ReasonFlags
)
obj
;
}
else
if
(
name
.
equalsIgnoreCase
(
INDIRECT_CRL
))
{
if
(!(
obj
instanceof
Boolean
))
{
...
...
@@ -290,7 +291,6 @@ public class IssuingDistributionPointExtension extends Extension
}
hasOnlyAttributeCerts
=
((
Boolean
)
obj
).
booleanValue
();
}
else
{
throw
new
IOException
(
"Attribute name ["
+
name
+
"] not recognized by "
+
...
...
src/share/classes/sun/security/x509/KeyIdentifier.java
浏览文件 @
c690149d
...
...
@@ -148,7 +148,7 @@ public class KeyIdentifier {
return
true
;
if
(!(
other
instanceof
KeyIdentifier
))
return
false
;
return
java
.
util
.
Arrays
.
equals
(
octetString
,
((
KeyIdentifier
)
other
).
getIdentifier
()
);
byte
[]
otherString
=
((
KeyIdentifier
)
other
).
octetString
;
return
java
.
util
.
Arrays
.
equals
(
octetString
,
otherString
);
}
}
src/share/classes/sun/security/x509/PolicyMappingsExtension.java
浏览文件 @
c690149d
...
...
@@ -102,7 +102,7 @@ implements CertAttrSet<String> {
public
PolicyMappingsExtension
()
{
extensionId
=
PKIXExtensions
.
KeyUsage_Id
;
critical
=
false
;
maps
=
new
ArrayList
<
CertificatePolicyMap
>
();
maps
=
Collections
.<
CertificatePolicyMap
>
emptyList
();
}
/**
...
...
src/share/classes/sun/security/x509/PrivateKeyUsageExtension.java
浏览文件 @
c690149d
...
...
@@ -33,6 +33,7 @@ import java.security.cert.CertificateExpiredException;
import
java.security.cert.CertificateNotYetValidException
;
import
java.util.Date
;
import
java.util.Enumeration
;
import
java.util.Objects
;
import
sun.security.util.*
;
...
...
@@ -206,16 +207,17 @@ implements CertAttrSet<String> {
*/
public
void
valid
(
Date
now
)
throws
CertificateNotYetValidException
,
CertificateExpiredException
{
Objects
.
requireNonNull
(
now
);
/*
* we use the internal Dates rather than the passed in Date
* because someone could override the Date methods after()
* and before() to do something entirely different.
*/
if
(
notBefore
.
after
(
now
))
{
if
(
notBefore
!=
null
&&
notBefore
.
after
(
now
))
{
throw
new
CertificateNotYetValidException
(
"NotBefore: "
+
notBefore
.
toString
());
}
if
(
notAfter
.
before
(
now
))
{
if
(
notAfter
!=
null
&&
notAfter
.
before
(
now
))
{
throw
new
CertificateExpiredException
(
"NotAfter: "
+
notAfter
.
toString
());
}
...
...
src/share/classes/sun/security/x509/RDN.java
浏览文件 @
c690149d
...
...
@@ -27,6 +27,8 @@ package sun.security.x509;
import
java.io.IOException
;
import
java.io.StringReader
;
import
java.util.Arrays
;
import
java.util.StringJoiner
;
import
java.util.*
;
import
sun.security.util.*
;
...
...
@@ -442,31 +444,19 @@ public class RDN {
assertion
[
0
].
toRFC2253String
(
oidMap
);
}
StringBuilder
relname
=
new
StringBuilder
();
if
(!
canonical
)
{
for
(
int
i
=
0
;
i
<
assertion
.
length
;
i
++)
{
if
(
i
>
0
)
{
relname
.
append
(
'+'
);
}
relname
.
append
(
assertion
[
i
].
toRFC2253String
(
oidMap
));
}
}
else
{
AVA
[]
toOutput
=
assertion
;
if
(
canonical
)
{
// order the string type AVA's alphabetically,
// followed by the oid type AVA's numerically
List
<
AVA
>
avaList
=
new
ArrayList
<
AVA
>(
assertion
.
length
);
for
(
int
i
=
0
;
i
<
assertion
.
length
;
i
++)
{
avaList
.
add
(
assertion
[
i
]);
}
java
.
util
.
Collections
.
sort
(
avaList
,
AVAComparator
.
getInstance
());
for
(
int
i
=
0
;
i
<
avaList
.
size
();
i
++)
{
if
(
i
>
0
)
{
relname
.
append
(
'+'
);
}
relname
.
append
(
avaList
.
get
(
i
).
toRFC2253CanonicalString
());
}
toOutput
=
assertion
.
clone
();
Arrays
.
sort
(
toOutput
,
AVAComparator
.
getInstance
());
}
StringJoiner
sj
=
new
StringJoiner
(
"+"
);
for
(
AVA
ava
:
toOutput
)
{
sj
.
add
(
canonical
?
ava
.
toRFC2253CanonicalString
()
:
ava
.
toRFC2253String
(
oidMap
));
}
return
relname
.
toString
();
return
sj
.
toString
();
}
}
...
...
src/share/classes/sun/security/x509/SubjectInfoAccessExtension.java
浏览文件 @
c690149d
...
...
@@ -28,6 +28,7 @@ package sun.security.x509;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.util.Collections
;
import
java.util.*
;
import
sun.security.util.DerOutputStream
;
...
...
@@ -200,7 +201,8 @@ public class SubjectInfoAccessExtension extends Extension
*/
public
void
delete
(
String
name
)
throws
IOException
{
if
(
name
.
equalsIgnoreCase
(
DESCRIPTIONS
))
{
accessDescriptions
=
new
ArrayList
<
AccessDescription
>();
accessDescriptions
=
Collections
.<
AccessDescription
>
emptyList
();
}
else
{
throw
new
IOException
(
"Attribute name ["
+
name
+
"] not recognized by "
+
...
...
src/share/classes/sun/security/x509/URIName.java
浏览文件 @
c690149d
...
...
@@ -165,7 +165,7 @@ public class URIName implements GeneralNameInterface {
String
host
=
uri
.
getSchemeSpecificPart
();
try
{
DNSName
hostDNS
;
if
(
host
.
charAt
(
0
)
==
'.'
)
{
if
(
host
.
startsWith
(
"."
)
)
{
hostDNS
=
new
DNSName
(
host
.
substring
(
1
));
}
else
{
hostDNS
=
new
DNSName
(
host
);
...
...
src/share/classes/sun/security/x509/X500Name.java
浏览文件 @
c690149d
...
...
@@ -346,6 +346,8 @@ public class X500Name implements GeneralNameInterface, Principal {
for
(
int
i
=
0
;
i
<
names
.
length
;
i
++)
{
list
.
addAll
(
names
[
i
].
avas
());
}
list
=
Collections
.
unmodifiableList
(
list
);
allAvaList
=
list
;
}
return
list
;
}
...
...
@@ -364,9 +366,6 @@ public class X500Name implements GeneralNameInterface, Principal {
*/
public
boolean
isEmpty
()
{
int
n
=
names
.
length
;
if
(
n
==
0
)
{
return
true
;
}
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
if
(
names
[
i
].
assertion
.
length
!=
0
)
{
return
false
;
...
...
@@ -1109,12 +1108,8 @@ public class X500Name implements GeneralNameInterface, Principal {
* and speed recognition of common X.500 attributes.
*/
static
ObjectIdentifier
intern
(
ObjectIdentifier
oid
)
{
ObjectIdentifier
interned
=
internedOIDs
.
get
(
oid
);
if
(
interned
!=
null
)
{
return
interned
;
}
internedOIDs
.
put
(
oid
,
oid
);
return
oid
;
ObjectIdentifier
interned
=
internedOIDs
.
putIfAbsent
(
oid
,
oid
);
return
(
interned
==
null
)
?
oid
:
interned
;
}
private
static
final
Map
<
ObjectIdentifier
,
ObjectIdentifier
>
internedOIDs
...
...
src/share/classes/sun/security/x509/X509AttributeName.java
浏览文件 @
c690149d
...
...
@@ -47,7 +47,7 @@ public class X509AttributeName {
*/
public
X509AttributeName
(
String
name
)
{
int
i
=
name
.
indexOf
(
SEPARATOR
);
if
(
i
==
(-
1
)
)
{
if
(
i
<
0
)
{
prefix
=
name
;
}
else
{
prefix
=
name
.
substring
(
0
,
i
);
...
...
src/share/classes/sun/security/x509/X509CRLImpl.java
浏览文件 @
c690149d
...
...
@@ -742,9 +742,7 @@ public class X509CRLImpl extends X509CRL implements DerEncoder {
public
byte
[]
getTBSCertList
()
throws
CRLException
{
if
(
tbsCertList
==
null
)
throw
new
CRLException
(
"Uninitialized CRL"
);
byte
[]
dup
=
new
byte
[
tbsCertList
.
length
];
System
.
arraycopy
(
tbsCertList
,
0
,
dup
,
0
,
dup
.
length
);
return
dup
;
return
tbsCertList
.
clone
();
}
/**
...
...
@@ -755,9 +753,7 @@ public class X509CRLImpl extends X509CRL implements DerEncoder {
public
byte
[]
getSignature
()
{
if
(
signature
==
null
)
return
null
;
byte
[]
dup
=
new
byte
[
signature
.
length
];
System
.
arraycopy
(
signature
,
0
,
dup
,
0
,
dup
.
length
);
return
dup
;
return
signature
.
clone
();
}
/**
...
...
src/share/classes/sun/security/x509/X509CertImpl.java
浏览文件 @
c690149d
...
...
@@ -1008,9 +1008,7 @@ public class X509CertImpl extends X509Certificate implements DerEncoder {
public
byte
[]
getSignature
()
{
if
(
signature
==
null
)
return
null
;
byte
[]
dup
=
new
byte
[
signature
.
length
];
System
.
arraycopy
(
signature
,
0
,
dup
,
0
,
dup
.
length
);
return
dup
;
return
signature
.
clone
();
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录