EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Problem with TransformChain.TransformData

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#14330
Posted: 09/01/2010 02:11:07
by David MICHEL (Standard support level)
Joined: 09/23/2009
Posts: 48

Hello,

Yesterday, I have make an update of version 7 with version 8 of SecureBlackBox.
I have a violation (EAccessViolation) on the function TransformData(FURINodeList);

Code
  
  ...
  RefList := TElXMLReferenceList.Create;
  try
    Ref  := TElXMLReference.Create;
    try
      //Algo Hash
      Ref.DigestMethod := xdmSHA256;
      //URINode = XPath
      Ref.URI := '#xpointer(//*[@authenticate=''true''])';
      ExtractURINode('//*[@authenticate]','http://www.ebics.org/H003',fnReqXml);
      
      Ref.URINode := FURINode;  
      Ref.URIData := nil;
      Ref.TransformChain.TransformData(FURINodeList);  <== VIOLATION

      //C14N Transform = 'Canonical transform'
      C14N := TElXMLC14NTransform.Create;
      try
        C14N.CanonicalizationMethod := xcmCanon;
        Ref.TransformChain.Add(C14N);
      except
      end;
      ....


Does this function have you it modified ?

Thanks in advance.


Sincerely yours,
David MICHEL.
#14332
Posted: 09/01/2010 02:47:33
by Dmytro Bogatskyy (EldoS Corp.)

Quote

Ref.TransformChain.TransformData(FURINodeList); <== VIOLATION

Please use for now (it will be fixed for the next build):
Code
var ReferenceNodes : TElXMLNodeArray;
  Buf: ByteArray;
SetLength(ReferenceNodes, FURINodeList.Count);
for i := 0 to i < FURINodeList.Count do
  ReferenceNodes[i] := FURINodeList[i].ParentNode;

Buf := Ref.TransformChain.TransformData(FURINodeList, ReferenceNodes);
// by the way calling TransformData without using return value doesn't make much sense
// so, if you are calling later in the code Ref.UpdateDigestValue method or ElXMLSigner.UpdateReferencesDigest then actual digest value will be calculated using URINode property
// you should:
Ref.DigestValue := CalculateDigest(@Buf[0], Length(Buf), Ref.DigestMethod);


Quote

//C14N Transform = 'Canonical transform'
C14N := TElXMLC14NTransform.Create;
try
C14N.CanonicalizationMethod := xcmCanon;
Ref.TransformChain.Add(C14N);
except
end;

This code should be added before a digest calculation of a reference or before calling TransformData method.
#14336
Posted: 09/01/2010 03:24:57
by David MICHEL (Standard support level)
Joined: 09/23/2009
Posts: 48

Thank you.

I will make the modifications as you advise it.

I just replaced FURINodeList.Count by FURINodeList.Length.

Best Regards.


Sincerely yours,
David MICHEL.

Reply

Statistics

Topic viewed 692 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!