EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Threading Issue with EDIBlackBox

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
Posted: 03/11/2013 18:00:09
by Sam Wilkinson (Basic support level)
Joined: 02/28/2013
Posts: 5

I am currently evaluating EDIBlackBox and have started testing multiple-threads and have found that it does not appear to support multiple threads when calling TElAS2Receipt.Load(..) even when a new TElAS2Receipt instance is created per thread (as per http://www.eldos.com/security/articles/3995.php?sphrase_id=426790).

I have attached a zip file (renamed as .txt) with a Visual Studio 2012 Console Application demonstrating the issue.

The sample application builds up a list of data to process (content & certificates).
Then it utilizes the Parallel.ForEach(...) method (.net feature) to run a method to parse the AS2Receipt contents.

Parallel.ForEach(data, (entry) =>
    ParseReceipt(entry.Item1, entry.Item2);

It is failing in this section of code.
    TElAS2Receipt receipt = new TElAS2Receipt();
    receipt.Signature.CertStorage = certificates;
    receipt.Load(content); // <-- this fails
catch (Exception ex)

It works fine loading each file without doing any threading, but fails doing multiple threads.

Can you please advise on how I should go about loading each AS2Receipt file contents from streams in separate threads.

If this is a bug, does the same bug exist in TElAS2Message.Load(..)

[ Download ]
Posted: 03/12/2013 00:52:21
by Eugene Mayevski (EldoS Corp.)

Sam Wilkinson wrote:
but fails doing multiple threads.

Please specify what exactly "fails" mean in your particular case.

Sincerely yours
Eugene Mayevski
Posted: 03/12/2013 01:08:41
by Sam Wilkinson (Basic support level)
Joined: 02/28/2013
Posts: 5

It throws an EElASMessageError exception on the line I indicated above with the message "No content type specified (error code is 10009)".

The AS2Receipt messages it is parsing are valid (because it can load them individually one at a time without any threading), but when threading is involved (as per the sample application) then it throws the exception.

Below is a copy of the exception detail from Visual Studio.
SBASCommon.EElASMessageError was caught
  Message=No content type specified (error code is 10009)
       at SBASCommon.TElASReceipt.ProcessError(Int32 Code, String Message, Boolean Critical)
       at SBASCommon.TElASReceipt.DisassembleHeader(TElMessageHeader Header, UInt16& Scopes)
       at SBAS2.TElAS2Receipt.DisassembleHeader(TElMessageHeader Header, UInt16& Scopes)
       at SBASCommon.TElASReceipt.Load(Stream Stream)
       at TestMulti.Program.ParseReceipt(MemoryStream content, TElMemoryCertStorage certificates) in c:\TestMulti\Program.cs:line 52
Posted: 03/12/2013 02:10:07
by Eugene Mayevski (EldoS Corp.)

Thank you. These details are very helpful. I have carried out a couple of tests and so far the problem doesn't seem to be in our code. It looks more like a compiler glitch. Unfortunately, due to complexity of the MIME parser, it will take some time to locate and fix the issue. Simple debugging doesn't work well with that code.

I am moving the topic to the helpdesk so that our developers could respond you when there are any news regarding the problem.

Sincerely yours
Eugene Mayevski



Topic viewed 469 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!