Thales HSM Simulator for Linux

Jan 26, 2010 at 4:19 PM

any body has successfully story about compile the source under mono (linux) ??

Jan 27, 2010 at 7:33 AM

What part of the source would you be interested in compiling under mono?

Feb 22, 2010 at 3:11 AM

It would be great to get the whole simulator interface running under Linux.  For those of us who live in a world largely free of Windows anyway.  Its a very handy tool for when a proper device is not immediately available and you need to test something.

Feb 22, 2010 at 7:29 AM

I see your point. I'll check some more into this.

I assume that you've no interest in the GUI but a command-line version of the simulator would be sufficient for the task. I'm not really familiar with mono myself and the biggest hurdle would be to create an appropriate environment, compile the code and see how it runs under Linux.

Mar 30, 2010 at 7:58 PM

Initial signs aren't promising, not for a quick solution anyway. I had a shot at running the simulator under Ubuntu 9.10, Mono After some fiddling around with the code, the interface started up but the simulator couldn't start at all. I got a System.NotSupportedException when trying to run the Reset() method on a list enumerator.

Although my experience with Mono is close to none, I feel that getting this exception so quickly may indicate that we'll have a job making ThalesSim run under Mono anytime soon. I was quite dissapointed, because before trying anything I used the Mono Migration Analyzer and it reported a few minor issues with the ThalesSim simulator executable and no issues at all with ThalesCore.dll.

Mar 31, 2010 at 11:08 AM
After some digging around, I've found that the problem is that for Debian/Ubuntu Mono offers version ThalesSim needs huge refactoring to work with and we will not try to go there. My mistake with the Mono Migration Analyzer was that I checked the status of ThalesSim against Mono 2.6. As time permits, I will try to see how are things on a platform that supports 2.6, like openSUSE.
Apr 8, 2010 at 10:32 AM

Things are better on openSUSE but still no dice. On startup, the simulator gives out the following error:

System.InvalidCastException: Conversion from string "&H0" to type 'Long' is not valid. ---> System.InvalidCastException: Conversion from string "&H0" to type 'Decimal' is not valid.
  at Microsoft.VisualBasic.CompilerServices.DecimalType.FromString (System.String Value) [0x00000] in <filename unknown>:0
  at Microsoft.VisualBasic.CompilerServices.LongType.FromString (System.String value) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Microsoft.VisualBasic.CompilerServices.LongType.FromString (System.String value) [0x00000] in <filename unknown>:0
  at Microsoft.VisualBasic.CompilerServices.Conversions.ToLong (System.String Value) [0x00000] in <filename unknown>:0
  at ThalesSim.Core.Utility.XORHexStringsFull (System.String s1, System.String s2) [0x00000] in <filename unknown>:0
  at ThalesSim.Core.Cryptography.LMK.LMKStorage.GenerateLMKCheckValue () [0x00000] in <filename unknown>:0
  at ThalesSim.Core.ThalesMain.StartCrypto (System.String XMLParameterFile) [0x00000] in <filename unknown>:0

After seeing this error I would say that the safe thing to do will be to gradually replace calls to the Microsoft.VisualBasic namespace and then see how we stand with openSUSE. This will obviously take time and I would not expect ThalesSim to run under Linux in the immediate future.

Apr 8, 2010 at 9:30 PM
Edited Apr 8, 2010 at 9:31 PM

Well, it seems that my previous post was perhaps a bit hasty. After some minor rework (mostly targeted at removing a lot of CType, CInt, CBool, CByte calls) and removal of .Reset() method calls to IEnumerator, the simulator worked under openSUSE 11.2. There are some caveats (can't read the XML configuration file for some reason) and I didn't run the complete unit test package but the PVV Clashing demo was successfully executed against the simulator which was running under openSUSE. Relevant changes will be added to the 0.8.6 release along with a Wiki article in the documentation tab that will describe how to run the simulator under Linux.

Apr 9, 2010 at 10:36 PM

Steps to run the simulator under mono added in this wiki article.