System.InvalidOperationException - This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms - with version 1.0.1

39 views
Skip to first unread message

Kiran Mistry

unread,
Nov 11, 2019, 7:19:22 PM11/11/19
to SquishIt
Hi,

We are trying to setup new DEV box and when deployed existing website, getting FIPS validation error. We had SquishIt 0.9.
To resolve the issue, we updated SquishIt to latest version 1.0.1 and still having following error.

Would like to know how to change the default hashing algorithm SqishIt using which is FIPS complaint.

Would really appreciate help resolving this issue.

Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Security.Cryptography.CryptoConfig.CreateFromName(String name, Object[] args)
   at System.Security.Cryptography.MD5.Create()
   at SquishIt.Framework.Utilities.Hasher.GetHash(Stream stream)
   at SquishIt.Framework.Utilities.Hasher.GetHash(String content)
   at SquishIt.Framework.Utilities.FilePathMutexProvider.CreateSharableMutexForPath(String normalizedPath)
   at SquishIt.Framework.Utilities.FilePathMutexProvider.GetMutexForPath(String path)
   at SquishIt.Framework.Utilities.CriticalRenderingSection..ctor(String path)
   at SquishIt.Framework.Base.BundleBase`1.RenderRelease(String key, String renderTo, IRenderer renderer)
   at Mayo.KCMS.SWD.Web.Layouts.GBS.Shared.MasterGoldLayout.Page_Load(Object sender, EventArgs e)

Nested Exception

Exception: System.InvalidOperationException
Message: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.
Source: mscorlib
   at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()


Let me know in case of more information required.

Thanks,
Kiran Mistry

Alex Ullrich

unread,
Nov 12, 2019, 10:47:56 AM11/12/19
to SquishIt
Hmm I thought we were using SHA1 as default.  I will push a change to make this the default later today.

In the meantime you can use the following in Startup or Global.asax.cs

            SquishIt.Framework.Configuration.Apply(c =>
            {
                c.DefaultHasher = new SHA1Hasher(new RetryableFileOpener());
            });

(or mix it in with whatever other startup code you have)

Let me know if this works, if it does I will go ahead and make that the default.

Thanks,

Alex

Kiran Mistry

unread,
Nov 15, 2019, 9:52:34 AM11/15/19
to SquishIt
Thanks Alex for your reply.

I did something like this which worked. Will try your suggestion as well.
Please let me know if you find anything specific in my implementation which we should not do.

public class SquishItConfig
{
public static void Register()
{
Configuration.Instance.DefaultHasher = new SHA1Hasher(new RetryableFileOpener());
}
}

Thanks,
Kiran

Alex Ullrich

unread,
Nov 16, 2019, 8:08:41 AM11/16/19
to SquishIt
That should work as well the apply method is basically there to make it fit in more easily with owin-type startup.

Thanks for pointing this out,

Alex

Alex Ullrich

unread,
Nov 18, 2019, 8:42:58 AM11/18/19
to SquishIt
I just pushed version 1.0.2 to nuget - believe this should fix your issue.  

Let me know if you have any other problems.

Thanks,

Alex

Kiran Mistry

unread,
Nov 19, 2019, 6:10:53 PM11/19/19
to SquishIt
Thanks Alex!
Reply all
Reply to author
Forward
0 new messages