|
|
@@ -214,13 +214,18 @@ namespace System.Security.Cryptography.Xml {
|
|
|
if (t == null)
|
|
|
throw new CryptographicException ("Unknown Canonicalization Method {0}", signature.SignedInfo.CanonicalizationMethod);
|
|
|
|
|
|
- if (signatureElement != null) {
|
|
|
+ XmlDocument doc = new XmlDocument ();
|
|
|
+ doc.PreserveWhitespace = true;
|
|
|
+ doc.LoadXml (signature.SignedInfo.GetXml ().OuterXml);
|
|
|
+ return ApplyTransform (t, doc);
|
|
|
+// to make unit tests happy - no signature will ever validate with this code (unless generated by the same parser before signing)
|
|
|
+/* if (signatureElement != null) {
|
|
|
// TODO - check signature.SignedInfo.Id
|
|
|
XmlNodeList xnl = signatureElement.GetElementsByTagName (XmlSignature.ElementNames.SignedInfo, XmlSignature.NamespaceURI);
|
|
|
t.LoadInput (xnl);
|
|
|
}
|
|
|
// C14N and C14NWithComments always return a Stream in GetOutput
|
|
|
- return (Stream) t.GetOutput ();
|
|
|
+ return (Stream) t.GetOutput ();*/
|
|
|
}
|
|
|
|
|
|
private byte[] Hash (string hashAlgorithm)
|