Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
7b78dcc7
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看板
提交
7b78dcc7
编写于
1月 16, 2013
作者:
J
juh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8005389: Backout fix for JDK-6500133
Reviewed-by: mullan
上级
26cdda46
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
28 deletion
+40
-28
src/share/classes/sun/security/x509/URIName.java
src/share/classes/sun/security/x509/URIName.java
+1
-8
test/sun/security/x509/URIName/Parse.java
test/sun/security/x509/URIName/Parse.java
+39
-20
未找到文件。
src/share/classes/sun/security/x509/URIName.java
浏览文件 @
7b78dcc7
...
...
@@ -30,7 +30,6 @@ import java.net.URI;
import
java.net.URISyntaxException
;
import
sun.security.util.*
;
import
sun.net.www.ParseUtil
;
/**
* This class implements the URIName as required by the GeneralNames
...
...
@@ -107,13 +106,7 @@ public class URIName implements GeneralNameInterface {
try
{
uri
=
new
URI
(
name
);
}
catch
(
URISyntaxException
use
)
{
try
{
// Try parsing the URI again after encoding/escaping
// any illegal characters
uri
=
new
URI
(
ParseUtil
.
encodePath
(
name
));
}
catch
(
URISyntaxException
use2
)
{
throw
new
IOException
(
"invalid URI name:"
+
name
,
use2
);
}
throw
new
IOException
(
"invalid URI name:"
+
name
,
use
);
}
if
(
uri
.
getScheme
()
==
null
)
{
throw
new
IOException
(
"URI name must include scheme:"
+
name
);
...
...
test/sun/security/x509/URIName/Parse.java
浏览文件 @
7b78dcc7
/*
* Copyright (c) 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 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
...
...
@@ -23,11 +23,12 @@
/*
* @test
* @bug
6500133
* @summary CRL Distribution Point URIs with spaces or backslashes should
be
* parseable
* @bug
8005389
* @summary CRL Distribution Point URIs with spaces or backslashes should
*
not be
parseable
*/
import
java.io.ByteArrayInputStream
;
import
java.io.IOException
;
import
java.security.cert.CertificateFactory
;
import
java.security.cert.X509Certificate
;
import
sun.security.util.DerValue
;
...
...
@@ -90,27 +91,45 @@ public class Parse {
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
/* Parse a CRLDistributionPointsExtension URI with a space. */
CRLDistributionPointsExtensionTest
(
certWithSpaceInCDPStr
);
System
.
out
.
println
(
"Parsed CRLDistributionPointsExtension uri with "
+
"a space."
);
/* Try to parse a CRLDistributionPointsExtension URI with a space. */
try
{
CRLDistributionPointsExtensionTest
(
certWithSpaceInCDPStr
);
throw
new
RuntimeException
(
"Illegally parsed a "
+
"CRLDistributionPointsExtension uri with a space."
);
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"Caught the correct exception."
);
/* Parse a CRLDistributionPointsExtension URI with backslashes. */
CRLDistributionPointsExtensionTest
(
certWithBackslashesInCDPStr
);
System
.
out
.
println
(
"Parsed CRLDistributionPointsExtension uri with "
+
"backslashes."
);
}
/* Constructor a URIName from a uri with a space. */
/* Try to parse a CRLDistributionPointsExtension URI with backslashes. */
try
{
CRLDistributionPointsExtensionTest
(
certWithBackslashesInCDPStr
);
throw
new
RuntimeException
(
"Illegally parsed a "
+
"CRLDistributionPointsExtension uri with a backslashes."
);
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"Caught the correct exception."
);
}
/* Try to construct a URIName from a uri with a space. */
String
uriWithSpace
=
"file://crl file.crl"
;
URIName
name
=
new
URIName
(
uriWithSpace
);
System
.
out
.
println
(
"URI re-encoded from "
+
uriWithSpace
+
" to "
+
name
.
getName
());
URIName
name
;
try
{
name
=
new
URIName
(
uriWithSpace
);
throw
new
RuntimeException
(
"Illegally created a URIName "
+
"from a uri with a space."
);
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"Caught the correct exception."
);
}
/*
C
onstruct a URIName from a uri with backslashes. */
/*
Try to c
onstruct a URIName from a uri with backslashes. */
String
uriWithBackslashes
=
"file://\\\\CRL\\crl_file.crl"
;
name
=
new
URIName
(
uriWithBackslashes
);
System
.
out
.
println
(
"URI re-encoded from "
+
uriWithBackslashes
+
" to "
+
name
.
getName
());
try
{
name
=
new
URIName
(
uriWithBackslashes
);
throw
new
RuntimeException
(
"Illegally created a URIName "
+
"from a uri with backslashes."
);
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"Caught the correct exception."
);
}
System
.
out
.
println
(
"Tests passed."
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录