Xpra: Ticket #2329: md5 on FIPS-enabled Linux systems

On FIPS-enabled Linux systems, Python's hashlib.md5() function is considered "unsafe" and does nothing except throw a ValueError? exception. A patch is attached.

Thu, 13 Jun 2019 14:42:52 GMT - Eric Lemings: attachment set

Xpra 1.x patch for FIPS-compliant checksums

Thu, 13 Jun 2019 14:50:33 GMT - Eric Lemings: attachment set

Xpra 2.5.2 patch for FIPS-compliant checksums

Thu, 13 Jun 2019 15:36:21 GMT - Antoine Martin: owner changed

Thanks for reporting this issue. I've only just glanced at the patches so far, the patch for v2.5.x looks fine but the patch for v1.0.x will cause hard to debug failures in the authentication modules: switching to sha1 (or sha256 for some - not sure why those are different) will cause the the authentication value provided by the client to not match the one generated by the server using a different hash. (that's one of the changes since v1: clients can specify a list of hashes they support and we choose the strongest ones first)

Thu, 13 Jun 2019 16:04:27 GMT - Antoine Martin:

How about this:

All of this can be backported to v2.5.x

For v1.0.x, I am tempted to add a utility method to the autentication modules for doing the hmac and just failing every time: we can't do md5 and doing something else should never match. (same for the proxy: returning an invalid string)

Thu, 13 Jun 2019 16:55:48 GMT - Eric Lemings:

I started with sha256 but later realized that sha1 is sufficient but didn't update them all hence the mix-up.

A utility wrapper sounds good. These patches are provided just as examples to fix the "bug".

Thu, 13 Jun 2019 17:51:01 GMT - Antoine Martin:

The untested fix for authentication modules in v1.0.x is in r22943: it will fail with a warning.

Backports for both v1.0.x and v2.5.x:

Will close after re-testing authentication with v1.0.x builds.

Wed, 03 Jul 2019 14:51:30 GMT - Antoine Martin: status changed; resolution set

Minor fix in r23091 + r23092 (backport to v1.0 in r23093), which also makes it possible to disable md5 using (this is useful for testing):

XPRA_NOMD5=1 xpra ...

We patch it out from hashlib.algorithms_available only because hashlib.algorithms_guaranteed says: Note that ‘md5’ is in this list despite some upstream vendors offering an odd “FIPS compliant” Python build that excludes it.

Tested OK with version 1.0

Mon, 28 Dec 2020 08:59:59 GMT - Antoine Martin:

Another related fix in r28262.

Also honour the flag in the automatic border colour code: r28263.

Sat, 23 Jan 2021 05:48:24 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2329