提交 01464df3 编写于 作者: M mullan

8049244: XML Signature performance issue caused by unbuffered signature data

Reviewed-by: xuelei
上级 cb477d31
......@@ -221,24 +221,24 @@ public final class DOMSignedInfo extends DOMStructure implements SignedInfo {
}
OutputStream os = new UnsyncBufferedOutputStream(bos);
try {
os.close();
} catch (IOException e) {
if (log.isLoggable(java.util.logging.Level.FINE)) {
log.log(java.util.logging.Level.FINE, e.getMessage(), e);
}
// Impossible
}
DOMSubTreeData subTree = new DOMSubTreeData(localSiElem, true);
try {
((DOMCanonicalizationMethod)
canonicalizationMethod).canonicalize(subTree, context, bos);
canonicalizationMethod).canonicalize(subTree, context, os);
} catch (TransformException te) {
throw new XMLSignatureException(te);
}
try {
os.flush();
} catch (IOException e) {
if (log.isLoggable(java.util.logging.Level.FINE)) {
log.log(java.util.logging.Level.FINE, e.getMessage(), e);
}
// Impossible
}
byte[] signedInfoBytes = bos.toByteArray();
// this whole block should only be done if logging is enabled
......@@ -253,6 +253,15 @@ public final class DOMSignedInfo extends DOMStructure implements SignedInfo {
}
this.canonData = new ByteArrayInputStream(signedInfoBytes);
try {
os.close();
} catch (IOException e) {
if (log.isLoggable(java.util.logging.Level.FINE)) {
log.log(java.util.logging.Level.FINE, e.getMessage(), e);
}
// Impossible
}
}
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册