Page MenuHomePhabricator

TargetInvocationException in ApiEdit.MD5
Open, Needs TriagePublicBUG REPORT

Description

description: Error thrown when trying to save a page.

workaround:

Exception:TargetInvocationException
Message:Exception has been thrown by the target of an invocation.
Call stack:<pre> 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 WikiFunctions.API.ApiEdit.MD5(Byte[] input)
at WikiFunctions.API.ApiEdit.MD5(String input)
at WikiFunctions.API.ApiEdit.Save(String pageText, String summary, Boolean minor, WatchOptions watch)</pre>
Inner exception:InvalidOperationException
Message:This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.
Call stack:<pre> at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()</pre>

OS: Microsoft Windows NT 6.2.9200.0
version: AutoWikiBrowser (5.9.0.0), WikiFunctions (5.9.0.0), revision 12137 (2016-12-25 12:48:36)
net: 2.0.50727.8766
duplicate:
site: https://en.wikipedia.org

Event Timeline

Aklapper changed the subtype of this task from "Task" to "Bug Report".Dec 14 2022, 1:14 PM

This issue is making AWB almost unusable for me, but I did figured out what is causing the issue. Apparently AWB is using some non-compliant encryption algorithms and my computer throws an error each time I try to save an edit. One can disable checking for FIPS compliance by following steps of "Disabling FIPS-Complaint Encryption on Windows". But unfortunately in my case the flag always comes back and I need a reboot to reset it.

This issue is making AWB almost unusable for me, but I did figured out what is causing the issue. Apparently AWB is using some non-compliant encryption algorithms and my computer throws an error each time I try to save an edit. One can disable checking for FIPS compliance by following steps of "Disabling FIPS-Complaint Encryption on Windows". But unfortunately in my case the flag always comes back and I need a reboot to reset it.

Nice to have an idea what is causing it.

The MD5 sum is not being used for encryption, but is used to give the api a checksum for the text being sent/saved, to ensure it’s all been received, not truncated or changed in transit.

The api doesn’t support anything else.

Is your computer part of a domain or similar? As that will change and reapply policies like this…

The issue with my computer is that for other tools to work some internet security related stuff, update schedule, etc. are managed by my employer. I can change thinks but if it is against some policy, after a while it will be reverted. I could use some other computer to run AWB, or flip the FIPS flag, reboot and have few days of working AWB. It sounds like very few people are affected by this issue, but at the moment AWB is incompatible with some Windows settings, which might become more commonly used. If it can not be fixed without changes to API, maybe check for this flag at the startup and provide information about what is happening and what are workarounds. I have been plagued by this issue for a long time but only recently figured out what is causing it after spending good part of a week debugging similar issues with a different software.

I don't know who you work for, but MS apparently doesn't even recommend enabling FIPS unless you really have to...

https://www.howtogeek.com/245859/why-you-shouldnt-enable-fips-compliant-encryption-on-windows/

Anyway, T362398: Supplement ApiEditPage's md5 parameter with something FIPS compliant filed for an alternative in the API.

We could stop AWB doing the md5 sum, but due to previous edit corruption we've seen, I don't know if that's necessarily a good idea.