Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
420d9241
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看板
提交
420d9241
编写于
6月 30, 2008
作者:
S
sherman
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
dca5d60a
efe3441c
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
119 addition
and
5 deletion
+119
-5
src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
...classes/com/sun/security/auth/module/Krb5LoginModule.java
+5
-1
src/share/classes/sun/security/provider/certpath/ConstraintsChecker.java
...es/sun/security/provider/certpath/ConstraintsChecker.java
+1
-1
src/share/classes/sun/security/provider/certpath/ForwardBuilder.java
...lasses/sun/security/provider/certpath/ForwardBuilder.java
+6
-1
src/share/classes/sun/security/provider/certpath/KeyChecker.java
...re/classes/sun/security/provider/certpath/KeyChecker.java
+1
-1
src/share/classes/sun/security/provider/certpath/PolicyChecker.java
...classes/sun/security/provider/certpath/PolicyChecker.java
+1
-1
test/java/security/cert/CertPathBuilder/targetConstraints/BuildEEBasicConstraints.java
...athBuilder/targetConstraints/BuildEEBasicConstraints.java
+79
-0
test/java/security/cert/CertPathBuilder/targetConstraints/anchor.cer
...ecurity/cert/CertPathBuilder/targetConstraints/anchor.cer
+8
-0
test/java/security/cert/CertPathBuilder/targetConstraints/ca.cer
...va/security/cert/CertPathBuilder/targetConstraints/ca.cer
+9
-0
test/java/security/cert/CertPathBuilder/targetConstraints/ee.cer
...va/security/cert/CertPathBuilder/targetConstraints/ee.cer
+9
-0
未找到文件。
src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
浏览文件 @
420d9241
/*
* Copyright 2000-200
6
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2000-200
8
Sun Microsystems, Inc. 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
...
...
@@ -1145,6 +1145,10 @@ public class Krb5LoginModule implements LoginModule {
sharedState
.
put
(
NAME
,
username
);
sharedState
.
put
(
PWD
,
password
);
}
}
else
{
// remove temp results for the next try
encKeys
=
null
;
principal
=
null
;
}
username
=
null
;
password
=
null
;
...
...
src/share/classes/sun/security/provider/certpath/ConstraintsChecker.java
浏览文件 @
420d9241
...
...
@@ -59,7 +59,7 @@ class ConstraintsChecker extends PKIXCertPathChecker {
private
int
i
;
private
NameConstraintsExtension
prevNC
;
private
static
Set
<
String
>
supportedExts
;
private
Set
<
String
>
supportedExts
;
/**
* Creates a ConstraintsChecker.
...
...
src/share/classes/sun/security/provider/certpath/ForwardBuilder.java
浏览文件 @
420d9241
/*
* Copyright 2000-200
7
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2000-200
8
Sun Microsystems, Inc. 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
...
...
@@ -198,6 +198,11 @@ class ForwardBuilder extends Builder {
X509CertSelector
sel
=
null
;
if
(
currentState
.
isInitial
())
{
if
(
targetCertConstraints
.
getBasicConstraints
()
==
-
2
)
{
// no need to continue: this means we never can match a CA cert
return
;
}
/* This means a CA is the target, so match on same stuff as
* getMatchingEECerts
*/
...
...
src/share/classes/sun/security/provider/certpath/KeyChecker.java
浏览文件 @
420d9241
...
...
@@ -50,7 +50,7 @@ class KeyChecker extends PKIXCertPathChecker {
private
CertSelector
targetConstraints
;
private
int
remainingCerts
;
private
static
Set
<
String
>
supportedExts
;
private
Set
<
String
>
supportedExts
;
/**
* Default Constructor
...
...
src/share/classes/sun/security/provider/certpath/PolicyChecker.java
浏览文件 @
420d9241
...
...
@@ -68,7 +68,7 @@ class PolicyChecker extends PKIXCertPathChecker {
private
int
inhibitAnyPolicy
;
private
int
certIndex
;
private
static
Set
<
String
>
supportedExts
;
private
Set
<
String
>
supportedExts
;
private
static
final
Debug
debug
=
Debug
.
getInstance
(
"certpath"
);
static
final
String
ANY_POLICY
=
"2.5.29.32.0"
;
...
...
test/java/security/cert/CertPathBuilder/targetConstraints/BuildEEBasicConstraints.java
0 → 100644
浏览文件 @
420d9241
/*
* Copyright 2008 Sun Microsystems, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @bug 6714842
* @library ../../../testlibrary
* @build CertUtils
* @run main BuildEEBasicConstraints
* @summary make sure a PKIX CertPathBuilder builds a path to an
* end entity certificate when the setBasicConstraints method of the
* X509CertSelector of the targetConstraints PKIXBuilderParameters
* parameter is set to -2.
*/
import
java.security.cert.Certificate
;
import
java.security.cert.CertPath
;
import
java.security.cert.CertStore
;
import
java.security.cert.CollectionCertStoreParameters
;
import
java.security.cert.PKIXBuilderParameters
;
import
java.security.cert.PKIXCertPathBuilderResult
;
import
java.security.cert.TrustAnchor
;
import
java.security.cert.X509Certificate
;
import
java.security.cert.X509CertSelector
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
public
final
class
BuildEEBasicConstraints
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
X509Certificate
rootCert
=
CertUtils
.
getCertFromFile
(
"anchor.cer"
);
TrustAnchor
anchor
=
new
TrustAnchor
(
rootCert
.
getSubjectX500Principal
(),
rootCert
.
getPublicKey
(),
null
);
X509CertSelector
sel
=
new
X509CertSelector
();
sel
.
setBasicConstraints
(-
2
);
PKIXBuilderParameters
params
=
new
PKIXBuilderParameters
(
Collections
.
singleton
(
anchor
),
sel
);
params
.
setRevocationEnabled
(
false
);
X509Certificate
eeCert
=
CertUtils
.
getCertFromFile
(
"ee.cer"
);
X509Certificate
caCert
=
CertUtils
.
getCertFromFile
(
"ca.cer"
);
ArrayList
<
X509Certificate
>
certs
=
new
ArrayList
<
X509Certificate
>();
certs
.
add
(
caCert
);
certs
.
add
(
eeCert
);
CollectionCertStoreParameters
ccsp
=
new
CollectionCertStoreParameters
(
certs
);
CertStore
cs
=
CertStore
.
getInstance
(
"Collection"
,
ccsp
);
params
.
addCertStore
(
cs
);
PKIXCertPathBuilderResult
res
=
CertUtils
.
build
(
params
);
CertPath
cp
=
res
.
getCertPath
();
// check that first certificate is an EE cert
List
<?
extends
Certificate
>
certList
=
cp
.
getCertificates
();
X509Certificate
cert
=
(
X509Certificate
)
certList
.
get
(
0
);
if
(
cert
.
getBasicConstraints
()
!=
-
1
)
{
throw
new
Exception
(
"Target certificate is not an EE certificate"
);
}
}
}
test/java/security/cert/CertPathBuilder/targetConstraints/anchor.cer
0 → 100644
浏览文件 @
420d9241
-----BEGIN CERTIFICATE-----
MIIBFzCBwgIBATANBgkqhkiG9w0BAQQFADAXMRUwEwYDVQQDEwxUcnVzdCBBbmNo
b3IwHhcNMDIxMTA3MTE1NzAzWhcNMjIxMTA3MTE1NzAzWjAXMRUwEwYDVQQDEwxU
cnVzdCBBbmNob3IwXDANBgkqhkiG9w0BAQEFAANLADBIAkEA9uCj12hwDgC1n9go
0ozQAVMM+DfX0vpKOemyGNp+ycSLfAq3pxBcUKbQhjSRL7YjPkEL8XC6pRLwyEoF
osWweQIDAQABMA0GCSqGSIb3DQEBBAUAA0EAzZta5M1qbbozj7jWnNyTgB4HUpzv
4eP0VYQb1pQY1/xEMczaRt+RuoIDnHCq5a1vOiwk6ZbdG6GlJKx9lj0oMQ==
-----END CERTIFICATE-----
test/java/security/cert/CertPathBuilder/targetConstraints/ca.cer
0 → 100644
浏览文件 @
420d9241
-----BEGIN CERTIFICATE-----
MIIBSjCB9aADAgECAgECMA0GCSqGSIb3DQEBBAUAMBcxFTATBgNVBAMTDFRydXN0
IEFuY2hvcjAeFw0wMjExMDcxMTU3MDNaFw0yMjExMDcxMTU3MDNaMA0xCzAJBgNV
BAMTAkNBMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ8mP3x37PablDfwldGL5G0+
l9NgMJSdxVNWBg+ySzQNsZklEFCxGfxPQW+EFYfafHbTbmnni2gsgU1mgPBTQDsC
AwEAAaM2MDQwCwYDVR0PBAQDAgIEMBcGA1UdIAQQMA4wBgYEVR0gADAEBgIqADAM
BgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA0EA9oCyzh0UKmNsKb+KpppbKYs8
iA8sDm9oDCwyVSXBM46zrP38nRcx3EdKFvGTwbb/Np+lcZALUsKVYQy3rlU+cQ==
-----END CERTIFICATE-----
test/java/security/cert/CertPathBuilder/targetConstraints/ee.cer
0 → 100644
浏览文件 @
420d9241
-----BEGIN CERTIFICATE-----
MIIBLTCB2KADAgECAgEDMA0GCSqGSIb3DQEBBAUAMA0xCzAJBgNVBAMTAkNBMB4X
DTAyMTEwNzExNTcwM1oXDTIyMTEwNzExNTcwM1owFTETMBEGA1UEAxMKRW5kIEVu
dGl0eTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDVBDfF+uBr5s5jzzDs1njKlZNt
h8hHzEt3ASh67Peos+QrDzgpUyFXT6fdW2h7iPf0ifjM8eW2xa+3EnPjjU5jAgMB
AAGjGzAZMBcGA1UdIAQQMA4wBgYEVR0gADAEBgIqADANBgkqhkiG9w0BAQQFAANB
AFo//WOboCNOCcA1fvcWW9oc4MvV8ZPvFIAbyEbgyFd4id5lGDTRbRPvvNZRvdsN
NM2gXYr+f87NHIXc9EF3pzw=
-----END CERTIFICATE-----
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录