Changeset 2569


Ignore:
Timestamp:
Feb 4, 2011, 4:37:41 PM (11 years ago)
Author:
Tim Podeszwa
Message:

bug fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/Soap/Soap.cs

    r2560 r2569  
    11021102                Reference reference = new Reference("#" + id.Value);
    11031103                //   Reference reference = new Reference("");
    1104                 XmlElement xpathElement = _securedSOAP.CreateElement("XPath");
     1104                XmlElement xpathElement = this._securedSOAP.CreateElement("XPath");
    11051105                string Xpath = "ancestor-or-self::Body";
    11061106                XmlElement root = this._securedSOAP.DocumentElement;
     
    12371237            signatureMethod.Attributes.Append(sigMeth);
    12381238            XmlNode securityHeader = this._securedSOAP.GetElementsByTagName("wsse:Security")[0];
    1239             securityHeader.InsertBefore(signature, securityHeader.FirstChild);
     1239           
    12401240            signature.AppendChild(signedInfo);
    12411241            signedInfo.AppendChild(canonicalizationMethod);
     
    12721272                XmlElement c14nTransform = this._securedSOAP.CreateElement("ds", "Transform", dsNamespace);
    12731273                XmlAttribute c14Url = this._securedSOAP.CreateAttribute("Algorithm");
    1274                 c14Url.Value = SignedXml.XmlDsigExcC14NTransformUrl;
     1274                c14Url.Value = SignedXml.XmlDsigEnvelopedSignatureTransformUrl;
    12751275                c14nTransform.Attributes.Append(c14Url);
    12761276                transforms.AppendChild(c14nTransform);
     
    13221322            }
    13231323            signature.AppendChild(this._securedSOAP.ImportNode(xmlKeyInfo, true));
    1324             XmlElement secHead = (XmlElement)this._securedSOAP.GetElementsByTagName("wsse:Security")[0];
     1324            securityHeader.InsertBefore(signature, securityHeader.FirstChild);
     1325         //   XmlElement secHead = (XmlElement)this._securedSOAP.GetElementsByTagName("wsse:Security")[0].Insert(signature);
    13251326            mySettings.securedsoap = this.CopyXmlToString(this._securedSOAP);
    13261327        }
     
    13431344        public byte[] GetDigestValueForElementWithSha1(XmlElement element)
    13441345        {
     1346            //XmlNode node = element.GetElementsByTagName("ds:Signature")[0];
     1347            //element.RemoveChild(node);
    13451348            Stream canonicalized = this.CanonicalizeNodeWithExcC14n(element);
    13461349            SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider();
     1350            StreamReader reader = new StreamReader(canonicalized);
     1351
     1352            string canonicalizedString = reader.ReadToEnd();
     1353           canonicalized.Position = 0;
     1354
    13471355            byte[] byteValue = sha1.ComputeHash(canonicalized);
    13481356            return byteValue;
Note: See TracChangeset for help on using the changeset viewer.