Bug Report B205202
Visible to All Users

Picture Edit and FIPS compliant exception

created 13 years ago

Hi,
I have been using the Picture Edit.
I found that once I finish with the Designer mode of Visual Studio, it would generate some codes like this:
this.pictureEdit1.Properties.ErrorImage = ((System.Drawing.Image)(resources.GetObject("pictureEdit1.Properties.ErrorImage")));
 this.pictureEdit1.Properties.InitialImage = ((System.Drawing.Image)(resources.GetObject("pictureEdit1.Properties.InitialImage")));

It was working fine, until one day I set the registry option for FIPS compliant to on,
(i.e. set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\ fipsalgorithmpolicy value from 0 to 1)
Then that first line will throw an exception, here's the stack trace:
   at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType)
   at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)
   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(String algName)
   at System.Security.Cryptography.MD5.Create()
   at DevExpress.XtraEditors.Controls.ImagesComparer.GetHashString(Byte[] arrayToHash)
   at DevExpress.XtraEditors.Controls.ImagesComparer.GetImageHash(Image image)
   at DevExpress.XtraEditors.Controls.ImagesComparer.AreEqual(Image imageA, Image imageB)
   at DevExpress.XtraEditors.Repository.RepositoryItemPictureEdit.set_ErrorImage(Image value)
And so, I have some questions:

  1. Is it normal that the designer mode would generate code for the .ErrorImage and .InitialImage by default? I didn't set any image to both field.
  2. Or, is there some setting that I can get the ImagesComparer to not use the MD5?
  3. Or, how can I properly workaround the exception? Currently I have to manually remove that two generated lines to avoid the exception everytime after I finish with the designer mode.
    Thanks in advance.
    JC

Answers

created 13 years ago

Hi Jackson,
Thank you for your message. Our developers are adding a static option to the DevExpress.XtraEditors.Controls.ImagesComparer class: CryptoServiceProvider. To resolve the FIPS compatibility issue, set this option to the CryptoServiceProvider.SHA1 value. It is better to set this option in the application entry point. The option will be available in the next minor update. If you need to fix this issue urgently, feel free to request a public fix. There is a corresponding button available on this page.
Thanks,
Uriah.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.