Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
d882736a
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看板
提交
d882736a
编写于
7月 20, 2009
作者:
M
mullan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6787645: CRL validation code should permit some clock skew when checking validity of CRLs
Reviewed-by: vinnie
上级
d786f271
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
49 addition
and
11 deletion
+49
-11
src/share/classes/java/security/cert/CertPathHelperImpl.java
src/share/classes/java/security/cert/CertPathHelperImpl.java
+6
-2
src/share/classes/java/security/cert/X509CRLSelector.java
src/share/classes/java/security/cert/X509CRLSelector.java
+26
-4
src/share/classes/sun/security/provider/certpath/CertPathHelper.java
...lasses/sun/security/provider/certpath/CertPathHelper.java
+9
-1
src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java
.../sun/security/provider/certpath/CrlRevocationChecker.java
+6
-2
src/share/classes/sun/security/provider/certpath/OCSPResponse.java
.../classes/sun/security/provider/certpath/OCSPResponse.java
+2
-2
未找到文件。
src/share/classes/java/security/cert/CertPathHelperImpl.java
浏览文件 @
d882736a
/*
/*
* Copyright 2002-200
6
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2002-200
9
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -46,7 +46,7 @@ class CertPathHelperImpl extends CertPathHelper {
...
@@ -46,7 +46,7 @@ class CertPathHelperImpl extends CertPathHelper {
/**
/**
* Initialize the helper framework. This method must be called from
* Initialize the helper framework. This method must be called from
* the static initializer of each class that is the target of one of
* the static initializer of each class that is the target of one of
* the methods in this class. This ensures that the helper i
f
initialized
* the methods in this class. This ensures that the helper i
s
initialized
* prior to a tunneled call from the Sun provider.
* prior to a tunneled call from the Sun provider.
*/
*/
synchronized
static
void
initialize
()
{
synchronized
static
void
initialize
()
{
...
@@ -59,4 +59,8 @@ class CertPathHelperImpl extends CertPathHelper {
...
@@ -59,4 +59,8 @@ class CertPathHelperImpl extends CertPathHelper {
Set
<
GeneralNameInterface
>
names
)
{
Set
<
GeneralNameInterface
>
names
)
{
sel
.
setPathToNamesInternal
(
names
);
sel
.
setPathToNamesInternal
(
names
);
}
}
protected
void
implSetDateAndTime
(
X509CRLSelector
sel
,
Date
date
,
long
skew
)
{
sel
.
setDateAndTime
(
date
,
skew
);
}
}
}
src/share/classes/java/security/cert/X509CRLSelector.java
浏览文件 @
d882736a
/*
/*
* Copyright 2000-200
6
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2000-200
9
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -72,6 +72,10 @@ import sun.security.x509.X500Name;
...
@@ -72,6 +72,10 @@ import sun.security.x509.X500Name;
*/
*/
public
class
X509CRLSelector
implements
CRLSelector
{
public
class
X509CRLSelector
implements
CRLSelector
{
static
{
CertPathHelperImpl
.
initialize
();
}
private
static
final
Debug
debug
=
Debug
.
getInstance
(
"certpath"
);
private
static
final
Debug
debug
=
Debug
.
getInstance
(
"certpath"
);
private
HashSet
<
Object
>
issuerNames
;
private
HashSet
<
Object
>
issuerNames
;
private
HashSet
<
X500Principal
>
issuerX500Principals
;
private
HashSet
<
X500Principal
>
issuerX500Principals
;
...
@@ -79,6 +83,7 @@ public class X509CRLSelector implements CRLSelector {
...
@@ -79,6 +83,7 @@ public class X509CRLSelector implements CRLSelector {
private
BigInteger
maxCRL
;
private
BigInteger
maxCRL
;
private
Date
dateAndTime
;
private
Date
dateAndTime
;
private
X509Certificate
certChecking
;
private
X509Certificate
certChecking
;
private
long
skew
=
0
;
/**
/**
* Creates an <code>X509CRLSelector</code>. Initially, no criteria are set
* Creates an <code>X509CRLSelector</code>. Initially, no criteria are set
...
@@ -417,7 +422,18 @@ public class X509CRLSelector implements CRLSelector {
...
@@ -417,7 +422,18 @@ public class X509CRLSelector implements CRLSelector {
if
(
dateAndTime
==
null
)
if
(
dateAndTime
==
null
)
this
.
dateAndTime
=
null
;
this
.
dateAndTime
=
null
;
else
else
this
.
dateAndTime
=
(
Date
)
dateAndTime
.
clone
();
this
.
dateAndTime
=
new
Date
(
dateAndTime
.
getTime
());
this
.
skew
=
0
;
}
/**
* Sets the dateAndTime criterion and allows for the specified clock skew
* (in milliseconds) when checking against the validity period of the CRL.
*/
void
setDateAndTime
(
Date
dateAndTime
,
long
skew
)
{
this
.
dateAndTime
=
(
dateAndTime
==
null
?
null
:
new
Date
(
dateAndTime
.
getTime
()));
this
.
skew
=
skew
;
}
}
/**
/**
...
@@ -657,8 +673,14 @@ public class X509CRLSelector implements CRLSelector {
...
@@ -657,8 +673,14 @@ public class X509CRLSelector implements CRLSelector {
}
}
return
false
;
return
false
;
}
}
if
(
crlThisUpdate
.
after
(
dateAndTime
)
Date
nowPlusSkew
=
dateAndTime
;
||
nextUpdate
.
before
(
dateAndTime
))
{
Date
nowMinusSkew
=
dateAndTime
;
if
(
skew
>
0
)
{
nowPlusSkew
=
new
Date
(
dateAndTime
.
getTime
()
+
skew
);
nowMinusSkew
=
new
Date
(
dateAndTime
.
getTime
()
-
skew
);
}
if
(
nowMinusSkew
.
after
(
nextUpdate
)
||
nowPlusSkew
.
before
(
crlThisUpdate
))
{
if
(
debug
!=
null
)
{
if
(
debug
!=
null
)
{
debug
.
println
(
"X509CRLSelector.match: update out of range"
);
debug
.
println
(
"X509CRLSelector.match: update out of range"
);
}
}
...
...
src/share/classes/sun/security/provider/certpath/CertPathHelper.java
浏览文件 @
d882736a
/*
/*
* Copyright 2002-200
6
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2002-200
9
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -25,9 +25,11 @@
...
@@ -25,9 +25,11 @@
package
sun.security.provider.certpath
;
package
sun.security.provider.certpath
;
import
java.util.Date
;
import
java.util.Set
;
import
java.util.Set
;
import
java.security.cert.X509CertSelector
;
import
java.security.cert.X509CertSelector
;
import
java.security.cert.X509CRLSelector
;
import
sun.security.x509.GeneralNameInterface
;
import
sun.security.x509.GeneralNameInterface
;
...
@@ -55,8 +57,14 @@ public abstract class CertPathHelper {
...
@@ -55,8 +57,14 @@ public abstract class CertPathHelper {
protected
abstract
void
implSetPathToNames
(
X509CertSelector
sel
,
protected
abstract
void
implSetPathToNames
(
X509CertSelector
sel
,
Set
<
GeneralNameInterface
>
names
);
Set
<
GeneralNameInterface
>
names
);
protected
abstract
void
implSetDateAndTime
(
X509CRLSelector
sel
,
Date
date
,
long
skew
);
static
void
setPathToNames
(
X509CertSelector
sel
,
static
void
setPathToNames
(
X509CertSelector
sel
,
Set
<
GeneralNameInterface
>
names
)
{
Set
<
GeneralNameInterface
>
names
)
{
instance
.
implSetPathToNames
(
sel
,
names
);
instance
.
implSetPathToNames
(
sel
,
names
);
}
}
static
void
setDateAndTime
(
X509CRLSelector
sel
,
Date
date
,
long
skew
)
{
instance
.
implSetDateAndTime
(
sel
,
date
,
skew
);
}
}
}
src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java
浏览文件 @
d882736a
/*
/*
* Copyright 2000-200
8
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2000-200
9
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -81,6 +81,10 @@ class CrlRevocationChecker extends PKIXCertPathChecker {
...
@@ -81,6 +81,10 @@ class CrlRevocationChecker extends PKIXCertPathChecker {
private
static
final
boolean
[]
ALL_REASONS
=
private
static
final
boolean
[]
ALL_REASONS
=
{
true
,
true
,
true
,
true
,
true
,
true
,
true
,
true
,
true
};
{
true
,
true
,
true
,
true
,
true
,
true
,
true
,
true
,
true
};
// Maximum clock skew in milliseconds (15 minutes) allowed when checking
// validity of CRLs
private
static
final
long
MAX_CLOCK_SKEW
=
900000
;
/**
/**
* Creates a <code>CrlRevocationChecker</code>.
* Creates a <code>CrlRevocationChecker</code>.
*
*
...
@@ -281,7 +285,7 @@ class CrlRevocationChecker extends PKIXCertPathChecker {
...
@@ -281,7 +285,7 @@ class CrlRevocationChecker extends PKIXCertPathChecker {
try
{
try
{
X509CRLSelector
sel
=
new
X509CRLSelector
();
X509CRLSelector
sel
=
new
X509CRLSelector
();
sel
.
setCertificateChecking
(
currCert
);
sel
.
setCertificateChecking
(
currCert
);
sel
.
setDateAndTime
(
mCurrentTime
);
CertPathHelper
.
setDateAndTime
(
sel
,
mCurrentTime
,
MAX_CLOCK_SKEW
);
for
(
CertStore
mStore
:
mStores
)
{
for
(
CertStore
mStore
:
mStores
)
{
for
(
java
.
security
.
cert
.
CRL
crl
:
mStore
.
getCRLs
(
sel
))
{
for
(
java
.
security
.
cert
.
CRL
crl
:
mStore
.
getCRLs
(
sel
))
{
...
...
src/share/classes/sun/security/provider/certpath/OCSPResponse.java
浏览文件 @
d882736a
...
@@ -149,9 +149,9 @@ class OCSPResponse {
...
@@ -149,9 +149,9 @@ class OCSPResponse {
private
SingleResponse
singleResponse
;
private
SingleResponse
singleResponse
;
// Maximum clock skew in milliseconds (1
0
minutes) allowed when checking
// Maximum clock skew in milliseconds (1
5
minutes) allowed when checking
// validity of OCSP responses
// validity of OCSP responses
private
static
final
long
MAX_CLOCK_SKEW
=
6
00000
;
private
static
final
long
MAX_CLOCK_SKEW
=
9
00000
;
// an array of all of the CRLReasons (used in SingleResponse)
// an array of all of the CRLReasons (used in SingleResponse)
private
static
CRLReason
[]
values
=
CRLReason
.
values
();
private
static
CRLReason
[]
values
=
CRLReason
.
values
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录