Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
74554c43
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
74554c43
编写于
13年前
作者:
M
mullan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7094155: JSR105 code throws javax.xml.crypto.URIReferenceException when running into Java 7 VM
Reviewed-by: xuelei
上级
93f8d34b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
51 addition
and
2 deletion
+51
-2
jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/IdResolver.java
...un/org/apache/xml/internal/security/utils/IdResolver.java
+2
-0
jdk/test/javax/xml/crypto/dsig/GenerationTests.java
jdk/test/javax/xml/crypto/dsig/GenerationTests.java
+49
-2
未找到文件。
jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/IdResolver.java
浏览文件 @
74554c43
...
...
@@ -250,6 +250,8 @@ public class IdResolver {
int
index
=
s
==
null
?
elementIndex
:
names
.
indexOf
(
n
.
getNamespaceURI
());
index
=(
index
<
0
)
?
namesLength
:
index
;
String
name
=
n
.
getLocalName
();
if
(
name
==
null
)
name
=
n
.
getName
();
if
(
name
.
length
()>
2
)
continue
;
String
value
=
n
.
getNodeValue
();
...
...
This diff is collapsed.
Click to expand it.
jdk/test/javax/xml/crypto/dsig/GenerationTests.java
浏览文件 @
74554c43
/*
* Copyright (c) 2005, 20
09
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 20
11
, 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,7 +23,7 @@
/**
* @test
* @bug 4635230 6283345 6303830 6824440 6867348
* @bug 4635230 6283345 6303830 6824440 6867348
7094155
* @summary Basic unit tests for generating XML Signatures with JSR 105
* @compile -XDignore.symbol.file KeySelectors.java SignatureValidator.java
* X509KeySelector.java GenerationTests.java
...
...
@@ -134,6 +134,7 @@ public class GenerationTests {
test_create_signature_enveloping_sha512_rsa_sha384
();
test_create_signature_enveloping_sha512_rsa_sha512
();
test_create_signature_reference_dependency
();
test_create_signature_with_attr_in_no_namespace
();
}
private
static
void
setup
()
throws
Exception
{
...
...
@@ -443,6 +444,52 @@ public class GenerationTests {
sig
.
sign
(
dsc
);
// dumpDocument(doc, new PrintWriter(System.out));
DOMValidateContext
dvc
=
new
DOMValidateContext
(
kvks
,
doc
.
getDocumentElement
());
XMLSignature
sig2
=
fac
.
unmarshalXMLSignature
(
dvc
);
if
(
sig
.
equals
(
sig2
)
==
false
)
{
throw
new
Exception
(
"Unmarshalled signature is not equal to generated signature"
);
}
if
(
sig2
.
validate
(
dvc
)
==
false
)
{
throw
new
Exception
(
"Validation of generated signature failed"
);
}
System
.
out
.
println
();
}
static
void
test_create_signature_with_attr_in_no_namespace
()
throws
Exception
{
System
.
out
.
println
(
"* Generating signature-with-attr-in-no-namespace.xml"
);
// create references
List
<
Reference
>
refs
=
Collections
.
singletonList
(
fac
.
newReference
(
"#unknown"
,
sha1
));
// create SignedInfo
SignedInfo
si
=
fac
.
newSignedInfo
(
withoutComments
,
rsaSha1
,
refs
);
// create object-1
Document
doc
=
db
.
newDocument
();
Element
nc
=
doc
.
createElementNS
(
null
,
"NonCommentandus"
);
// add attribute with no namespace
nc
.
setAttribute
(
"Id"
,
"unknown"
);
XMLObject
obj
=
fac
.
newXMLObject
(
Collections
.
singletonList
(
new
DOMStructure
(
nc
)),
"object-1"
,
null
,
null
);
// create XMLSignature
XMLSignature
sig
=
fac
.
newXMLSignature
(
si
,
rsa
,
Collections
.
singletonList
(
obj
),
"signature"
,
null
);
DOMSignContext
dsc
=
new
DOMSignContext
(
getPrivateKey
(
"RSA"
),
doc
);
sig
.
sign
(
dsc
);
// dumpDocument(doc, new PrintWriter(System.out));
DOMValidateContext
dvc
=
new
DOMValidateContext
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部