EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Time Stamping Problems

Posted: 04/09/2008 17:53:20
by Juan Karam (Basic support level)
Joined: 04/09/2008
Posts: 2


I have a small problem during the time stamp... using sample applications or my own. The error its the same:

When i use this code or the sample code:

TElHTTPSClient x = new TElHTTPSClient();
tspClient.HashAlgorithm = SBConstants.Unit.SB_ALGORITHM_DGST_SHA1;
tspClient.HTTPClient = x;
tspClient.URL = "http://timestamping.edelweb.fr/service/tsp";

TElCMSSignature signature = message.get_Signatures(index);

signature.SigningTime = DateTime.Now;

signature.CommitmentTypeIndication.Included = true;
signature.CommitmentTypeIndication.ProofOfOrigin = true;
signature.CommitmentTypeIndication.ProofOfCreation = true;
signature.UsePSS = false;
signature.Sign(cert, chain);

The error is:
Lenght can not be less than cero. Parameter name: Lenght.

Can you help me? I´m really disoriented.

Thanks =)
Posted: 04/10/2008 04:02:53
by Ken Ivanov (Team)

First, please specify which exactly method does expose the problem. It would be great if you provide us the entire call stack (with "Show non-user code" option turned on) as well.

Second -- did you try the CMSManager sample included to the distribution? Does it expose the same problem?
Posted: 04/10/2008 13:51:57
by Juan Karam (Basic support level)
Joined: 04/09/2008
Posts: 2


The method "signature.AddTimestamp(ts­pClient);" is throwing the exception.

Here is the call stack:

System.ArgumentOutOfRangeException was unhandled
Message="Length cannot be less than zero.\r\nParameter name: length"
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at System.String.Substring(Int32 startIndex, Int32 length)
at SBHTTPSClient.TElHTTPSClient.GetHeaderByName(TElStringList Headers, String Header)
at SBHTTPTSPClient.TElHTTPTSPClient.Timestamp(Byte[] HashedData, Int32& ServerResult, Int32& FailureInfo, Byte[]& ReplyCMS)
at SBCMS.TElCMSSignature.AddTimestamp(TElCustomTSPClient TSPClient)
at Eldos.Test.Program.CoSign() in C:\Users\Juan.Karam\Documents\Visual Studio 2008\Projects\Eldos.Test\Eldos.Test\Program.cs:line 200
at Eldos.Test.Program.Main(String[] args) in C:\Users\Juan.Karam\Documents\Visual Studio 2008\Projects\Eldos.Test\Eldos.Test\Program.cs:line 66
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

And yes the CMSManager and TinySigner have the same problem.

Thank you
Posted: 04/11/2008 01:50:17
by Eugene Mayevski (Team)

This is a problem of ElHTTPSClient component probably caused by some specific reply header. We will investigate it and let you know.

Sincerely yours
Eugene Mayevski
Posted: 04/11/2008 03:21:28
by Eugene Mayevski (Team)

This is a fresh issue of build 138, caused by the fact that we've added first line of response to the list of headers and it doesn't contain semicolon ":". I believe some other code (and not only ours) can stop working with this, but we need to have this line. So we will fix the underlying GetHeaderByName method.

Sincerely yours
Eugene Mayevski
Posted: 07/06/2011 05:59:55
by Salih Kardan (Basic support level)
Joined: 06/22/2011
Posts: 10


I am encoutering same problem now.
Is this problem solved last version of Secure Blackbox.

Thanks for help.
Posted: 07/06/2011 06:08:26
by Vsevolod Ievgiienko (Team)


Does the call stack in you case also point to SBHTTPSClient.TElHTTPSClient.GetHeaderByName? Does the problem occure with our demos?
Posted: 07/06/2011 06:15:22
by Salih Kardan (Basic support level)
Joined: 06/22/2011
Posts: 10

Hi Vsevolod Ievgiienko

Here is my call stack:

at SBCMS.TElCMSSignature.AddTimestamp(TElCustomTSPClient TSPClient)
at CMS.MainForm.RecalculateSignature(TElCMSSignature Sig) in C:\Users\Salih\Desktop\CmsTest\CMS\MainForm.cs:line 1504
at CMS.MainForm.HandleSignCMS(Object Sender, EventArgs e) in C:\Users\Salih\Desktop\CmsTest\CMS\MainForm.cs:line 926
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItem.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Command.DispatchID(Int32 id)
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.TreeView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
Posted: 07/06/2011 06:21:04
by Vsevolod Ievgiienko (Team)

Lets continue in this thread https://www.eldos.com/forum/read.php?FID=7&TID=3065 because your problem is different from the one described above. Please answer my question about our demo.



Topic viewed 2703 times

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


Back to top

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

Got it!