Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
ffcf3ce4
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看板
提交
ffcf3ce4
编写于
3月 20, 2013
作者:
M
mullan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8010112: NullPointerException in sun.security.provider.certpath.CertId()
Reviewed-by: vinnie
上级
f257643d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
13 deletion
+39
-13
src/share/classes/sun/security/provider/certpath/CertId.java
src/share/classes/sun/security/provider/certpath/CertId.java
+13
-4
src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
.../security/provider/certpath/DistributionPointFetcher.java
+4
-6
src/share/classes/sun/security/provider/certpath/RevocationChecker.java
...ses/sun/security/provider/certpath/RevocationChecker.java
+9
-2
src/share/classes/sun/security/x509/X509CertImpl.java
src/share/classes/sun/security/x509/X509CertImpl.java
+13
-1
未找到文件。
src/share/classes/sun/security/provider/certpath/CertId.java
浏览文件 @
ffcf3ce4
/*
* Copyright (c) 2003, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
3
, 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
...
...
@@ -29,8 +29,10 @@ import java.io.IOException;
import
java.math.BigInteger
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
import
java.security.PublicKey
;
import
java.security.cert.X509Certificate
;
import
java.util.Arrays
;
import
javax.security.auth.x500.X500Principal
;
import
sun.misc.HexDumpEncoder
;
import
sun.security.x509.*
;
import
sun.security.util.*
;
...
...
@@ -70,6 +72,13 @@ public class CertId {
public
CertId
(
X509Certificate
issuerCert
,
SerialNumber
serialNumber
)
throws
IOException
{
this
(
issuerCert
.
getSubjectX500Principal
(),
issuerCert
.
getPublicKey
(),
serialNumber
);
}
public
CertId
(
X500Principal
issuerName
,
PublicKey
issuerKey
,
SerialNumber
serialNumber
)
throws
IOException
{
// compute issuerNameHash
MessageDigest
md
=
null
;
try
{
...
...
@@ -78,11 +87,11 @@ public class CertId {
throw
new
IOException
(
"Unable to create CertId"
,
nsae
);
}
hashAlgId
=
SHA1_ALGID
;
md
.
update
(
issuer
Cert
.
getSubjectX500Principal
()
.
getEncoded
());
md
.
update
(
issuer
Name
.
getEncoded
());
issuerNameHash
=
md
.
digest
();
// compute issuerKeyHash (remove the tag and length)
byte
[]
pubKey
=
issuer
Cert
.
getPublicKey
()
.
getEncoded
();
byte
[]
pubKey
=
issuer
Key
.
getEncoded
();
DerValue
val
=
new
DerValue
(
pubKey
);
DerValue
[]
seq
=
new
DerValue
[
2
];
seq
[
0
]
=
val
.
data
.
getDerValue
();
// AlgorithmID
...
...
@@ -94,7 +103,7 @@ public class CertId {
if
(
debug
)
{
HexDumpEncoder
encoder
=
new
HexDumpEncoder
();
System
.
out
.
println
(
"Issuer
Certificate is "
+
issuerCert
);
System
.
out
.
println
(
"Issuer
Name is "
+
issuerName
);
System
.
out
.
println
(
"issuerNameHash is "
+
encoder
.
encodeBuffer
(
issuerNameHash
));
System
.
out
.
println
(
"issuerKeyHash is "
+
...
...
src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
浏览文件 @
ffcf3ce4
/*
* Copyright (c) 2002, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 201
3
, 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
...
...
@@ -345,10 +345,8 @@ class DistributionPointFetcher {
return
false
;
}
else
{
// in case of self-issued indirect CRL issuer.
byte
[]
certAKID
=
certImpl
.
getExtensionValue
(
AuthorityKey_Id
.
toString
());
byte
[]
crlAKID
=
crlImpl
.
getExtensionValue
(
AuthorityKey_Id
.
toString
());
KeyIdentifier
certAKID
=
certImpl
.
getAuthKeyId
();
KeyIdentifier
crlAKID
=
crlImpl
.
getAuthKeyId
();
if
(
certAKID
==
null
||
crlAKID
==
null
)
{
// cannot recognize indirect CRL without AKID
...
...
@@ -359,7 +357,7 @@ class DistributionPointFetcher {
// reset the public key used to verify the CRL's signature
prevKey
=
certImpl
.
getPublicKey
();
}
}
else
if
(!
Arrays
.
equals
(
certAKID
,
crlAKID
))
{
}
else
if
(!
certAKID
.
equals
(
crlAKID
))
{
// we accept the case that a CRL issuer provide status
// information for itself.
if
(
issues
(
certImpl
,
crlImpl
,
provider
))
{
...
...
src/share/classes/sun/security/provider/certpath/RevocationChecker.java
浏览文件 @
ffcf3ce4
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012,
2013,
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
...
...
@@ -643,7 +643,14 @@ class RevocationChecker extends PKIXRevocationChecker {
OCSPResponse
response
=
null
;
CertId
certId
=
null
;
try
{
certId
=
new
CertId
(
issuerCert
,
currCert
.
getSerialNumberObject
());
if
(
issuerCert
!=
null
)
{
certId
=
new
CertId
(
issuerCert
,
currCert
.
getSerialNumberObject
());
}
else
{
// must be an anchor name and key
certId
=
new
CertId
(
anchor
.
getCA
(),
anchor
.
getCAPublicKey
(),
currCert
.
getSerialNumberObject
());
}
// check if there is a cached OCSP response available
byte
[]
responseBytes
=
ocspResponses
.
get
(
cert
);
...
...
src/share/classes/sun/security/x509/X509CertImpl.java
浏览文件 @
ffcf3ce4
/*
* Copyright (c) 1996, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
3
, 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
...
...
@@ -1095,6 +1095,18 @@ public class X509CertImpl extends X509Certificate implements DerEncoder {
}
}
public
KeyIdentifier
getAuthKeyId
()
{
AuthorityKeyIdentifierExtension
aki
=
getAuthorityKeyIdentifierExtension
();
if
(
aki
!=
null
)
{
try
{
return
(
KeyIdentifier
)
aki
.
get
(
AuthorityKeyIdentifierExtension
.
KEY_ID
);
}
catch
(
IOException
ioe
)
{}
// not possible
}
return
null
;
}
/**
* Get AuthorityKeyIdentifier extension
* @return AuthorityKeyIdentifier object or null (if no such object
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录