0 votes

After mail.dll upgraded to the latest version(3.0.16153.1847), when I enable the FIPS, initializing Imap will throw an exception. I don't know what causes it thus don't know how to fix this one.

Steps to reproduce:
1. In windows search bar, type "gpedit.msc", open the local computer policy window.
2. In Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options, enable "System cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing".
3. Restart computer, visual studio, recompile the projects.
4. When try to test the connection, when use (C#)

var imap = new Imap();

it throws out exception:
The type initializer for 'Limilabs.Client.ClientBase' threw an exception.

My operating system is Windows 10 Enterprise. Use visual studio 2013 for compiling, and chrome for website.

by (580 points)
What happens if you use LicenseHelper class as first line in your program:

var status = LicenseHelper.GetLicenseStatus();

Does it throw an Exception? What type/message?
What is the value of status if it doesn't?
It threw out exception as

An exception of type 'System.TypeInitializationException' occurred in Mail.dll but was not handled in user code

Additional information: The type initializer for ' ​  ' threw an exception.

Is the license issue? What's the correct way to connect the license and the product?

1 Answer

+1 vote

The inner exception for this problem is:
"This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms." at System.Security.Cryptography.AesManaged..ctor().

Mail.dll (compiled against .NET 4.5) uses AesManaged for some internal command obfuscation (it doesn't affect communication security in any way).

You can either disable fips setting or use .NET 2.0 version which uses different obfuscation technique.

You can also download this beta, it uses Aes instead of AesMAnaged (which is FIPS certified):
https://www.limilabs.com/static/mail/beta/2016_07_04_Mail.zip

by (301k points)
edited by
Does this mean for this version(3.0.16153.1847), we don't support the fips enabled environment for .NET 4.5?
No, you can use Mail.dll compiled against .NET 2.0 - it will work in .NET 4.5 without any problems.
Thanks, this works perfect!
...